🔍 Code Extractor

Browse Components

Showing 20 of 1356 components

  • function register_docchat

    Registers a DocChat Flask blueprint with a Flask application instance, handling path configuration and error logging.

    File: /tf/active/vicechatdev/docchat/integration.py | Lines: 22-59

    flask blueprint registration web-framework initialization
  • function get_llm_instance

    Factory function that creates and returns an appropriate LLM (Large Language Model) instance based on the specified model name, automatically detecting the provider (OpenAI, Azure OpenAI, or Anthropic) and configuring it with the given parameters.

    File: /tf/active/vicechatdev/docchat/llm_factory.py | Lines: 171-208

    llm factory-pattern openai azure anthropic
  • class AzureOpenAIChatLLM

    Adapter class for interacting with Azure OpenAI's Chat Completions API, providing a simplified interface for generating chat responses using Azure-hosted OpenAI models.

    File: /tf/active/vicechatdev/docchat/llm_factory.py | Lines: 111-168

    azure openai chat llm api-adapter
  • class OpenAIChatLLM

    Adapter class for interacting with OpenAI's Chat Completions API, supporting both GPT-4 and GPT-5 model families with automatic parameter adjustment based on model type.

    File: /tf/active/vicechatdev/docchat/llm_factory.py | Lines: 75-108

    openai llm chat-completion gpt-4 gpt-5
  • class OpenAIResponsesLLM

    Adapter class for OpenAI's Responses API, specifically designed for GPT-5 family models with automatic fallback mechanisms to stable models when responses fail.

    File: /tf/active/vicechatdev/docchat/llm_factory.py | Lines: 22-72

    openai llm gpt-5 responses-api adapter
  • class LLMMessage

    A simple dataclass that represents a message for Large Language Model (LLM) interactions, containing only the message content as a string.

    File: /tf/active/vicechatdev/docchat/llm_factory.py | Lines: 18-19

    dataclass message llm data-container language-model
  • function test_incremental_indexing

    Comprehensive test function that validates incremental indexing functionality of a document indexing system, including initial indexing, change detection, re-indexing, and force re-indexing scenarios.

    File: /tf/active/vicechatdev/docchat/test_incremental_indexing.py | Lines: 32-207

    testing incremental-indexing document-indexing integration-test file-system
  • function modify_test_document

    Modifies the content of a test document file by writing new content to it, with a built-in delay to ensure the file's modification time changes.

    File: /tf/active/vicechatdev/docchat/test_incremental_indexing.py | Lines: 25-29

    testing file-operations file-modification test-utilities mtime
  • function create_test_document

    Creates a text file at the specified path with the given content, primarily used for testing purposes.

    File: /tf/active/vicechatdev/docchat/test_incremental_indexing.py | Lines: 20-22

    testing file-creation test-utilities file-io document-creation
  • function test_libreoffice_conversion

    Tests LibreOffice's ability to convert a document file to PDF format using headless mode, with timeout protection and comprehensive error reporting.

    File: /tf/active/vicechatdev/docchat/test_problematic_files.py | Lines: 99-159

    libreoffice pdf-conversion document-processing testing subprocess
  • function test_docx_file

    Tests the ability to open and read a Microsoft Word (.docx) document file, validating file existence, size, and content extraction capabilities.

    File: /tf/active/vicechatdev/docchat/test_problematic_files.py | Lines: 57-97

    document-testing file-validation docx word-document diagnostic
  • function test_pptx_file

    Tests the ability to open and read a PowerPoint (.pptx) file using the python-pptx library, validating file existence, size, and basic slide iteration.

    File: /tf/active/vicechatdev/docchat/test_problematic_files.py | Lines: 17-55

    powerpoint pptx file-validation testing diagnostic
  • function test_frontend_files

    A test function that validates the presence of model selection functionality in frontend files (HTML, JavaScript, and CSS) for a document chat application.

    File: /tf/active/vicechatdev/docchat/test_model_selection.py | Lines: 135-169

    testing frontend validation integration-test file-checking
  • function test_api_models_endpoint

    A unit test function that validates the structure and content of the /api/models endpoint response, ensuring it contains the correct model configuration data.

    File: /tf/active/vicechatdev/docchat/test_model_selection.py | Lines: 110-132

    testing unit-test api-validation endpoint-testing configuration-validation
  • function test_flask_routes

    A test function that validates Flask application routes are properly configured by checking for required endpoints.

    File: /tf/active/vicechatdev/docchat/test_model_selection.py | Lines: 85-107

    testing flask routes validation web-application
  • function test_rag_engine

    A test function that validates the RAG engine's ability to correctly instantiate different LLM models (OpenAI, Anthropic, Gemini) based on configuration settings.

    File: /tf/active/vicechatdev/docchat/test_model_selection.py | Lines: 50-82

    testing rag llm model-switching validation
  • function test_config

    A test function that validates the presence and correctness of all required configuration settings for a multi-model RAG (Retrieval-Augmented Generation) system.

    File: /tf/active/vicechatdev/docchat/test_model_selection.py | Lines: 9-47

    testing validation configuration unit-test assertion
  • class DocumentIndexer

    A class for indexing documents into ChromaDB with support for multiple file formats (PDF, Word, PowerPoint, Excel, text files), smart incremental indexing, and document chunk management.

    File: /tf/active/vicechatdev/docchat/document_indexer.py | Lines: 790-1144

    document-indexing vector-database chromadb embeddings pdf-processing
  • 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