🔍 Code Extractor

Browse Components

Showing 20 of 759 components

  • 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
  • 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