🔍 Code Extractor

Browse Components

Showing 20 of 987 components

  • class DocChatEmbeddingFunction

    A custom ChromaDB embedding function that generates OpenAI embeddings with automatic text summarization for documents exceeding token limits.

    File: /tf/active/vicechatdev/docchat/document_indexer.py | Lines: 128-227

    embeddings chromadb openai text-processing summarization
  • function run_with_timeout

    Executes a function with a specified timeout using threading, raising a TimeoutException if the function exceeds the time limit.

    File: /tf/active/vicechatdev/docchat/document_indexer.py | Lines: 87-125

    timeout threading concurrency execution-control error-handling
  • class TimeoutException

    A custom exception class that is raised when an operation exceeds its allocated time limit.

    File: /tf/active/vicechatdev/docchat/document_indexer.py | Lines: 82-84

    exception error-handling timeout custom-exception time-management
  • function on_load

    Blueprint initialization hook that loads persisted chat sessions from disk when the DocChat blueprint is registered with the Flask application.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 341-354

    flask blueprint initialization lifecycle-hook session-management
  • function get_available_models

    Flask API endpoint that returns a JSON response containing the list of available LLM models and the default model configured in the application.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 331-336

    api endpoint flask llm models
  • function get_history

    Flask API endpoint that retrieves chat message history for the current user's session from an in-memory chat_sessions dictionary.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 315-326

    flask api-endpoint chat-history session-management authentication
  • function clear_session

    Flask route handler that clears the current user's chat session, deletes associated session data from memory and disk, and creates a new empty session.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 288-310

    flask session-management chat api-endpoint authentication
  • function clear_session_v1

    Clears all messages from a chat session identified by session_id, resets the session's updated timestamp, and persists the changes to disk in a thread-safe manner.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 264-271

    session-management chat thread-safe persistence state-management
  • function get_stats

    Flask API endpoint that retrieves and returns statistics about a document collection from a RAG (Retrieval-Augmented Generation) system.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 275-283

    flask api endpoint statistics rag
  • function get_task_status

    Flask API endpoint that retrieves the current status of a background task by its task ID from an in-memory active_tasks dictionary.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 265-270

    flask api rest-endpoint task-status background-task
  • function get_task_status_v1

    Thread-safe function that retrieves the current status of a task from a shared dictionary using a task identifier.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 202-205

    threading concurrency task-management status-tracking thread-safe
  • function index_all_documents

    Flask route handler that initiates background indexing of all documents in the system, creating a task ID for tracking progress and returning immediately while indexing continues asynchronously.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 221-260

    flask api-endpoint background-task document-indexing async-processing
  • function upload_document

    Flask route handler that processes file uploads, saves them securely to disk, and indexes the document content for retrieval-augmented generation (RAG) search.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 187-216

    file-upload document-processing flask-route authentication RAG
  • function chat

    Flask route handler that processes chat requests with RAG (Retrieval-Augmented Generation) capabilities, managing conversation sessions, chat history, and document-based question answering.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 104-182

    chat rag retrieval-augmented-generation conversational-ai document-qa
  • function user_guide_v1

    Flask route handler that renders the user guide page for the document chat application.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 97-99

    flask route-handler view-function authentication user-guide
  • function index_v1

    Flask route handler that renders the main DocChat interface with document collection statistics.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 86-92

    flask route-handler web-interface authentication rag
  • function save_session_to_disk_v1

    Persists a chat session to disk by serializing session data to a JSON file, converting datetime objects to ISO format strings for storage.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 52-65

    persistence session-management file-io serialization json
  • function get_current_username

    Retrieves the current user's username from Flask-Login's current_user object or falls back to the Flask session, returning 'anonymous' if neither is available.

    File: /tf/active/vicechatdev/docchat/blueprint.py | Lines: 42-49

    authentication flask user-management session flask-login
  • function get_adjusted_top_k

    Calculates an adjusted top_k value for multi-language search operations by multiplying the base value by the number of languages to ensure sufficient results per language.

    File: /tf/active/vicechatdev/docchat/config.py | Lines: 171-189

    multi-language search top-k result-scaling internationalization
  • class DocChatRAG

    Main RAG engine with three operating modes: 1. Basic RAG (similarity search) 2. Extensive (full document retrieval with preprocessing) 3. Full Reading (process all documents)

    File: /tf/active/vicechatdev/docchat/rag_engine.py | Lines: 330-2989

    class docchatrag