🔍 Code Extractor

Browse Components

Showing 20 of 796 components

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

    A class that extracts relevant information from documents using a small LLM (Language Model), designed for Extensive and Full Reading modes in RAG systems.

    File: /tf/active/vicechatdev/docchat/rag_engine.py | Lines: 92-327

    information-extraction document-processing llm rag query-based
  • function matches_source_filter

    Checks if a document path matches any of the provided source filters using exact match, folder prefix match, path component sequence match, or filename match.

    File: /tf/active/vicechatdev/docchat/rag_engine.py | Lines: 31-89

    path-matching file-filtering document-filtering path-normalization string-matching
  • function check_configuration

    A comprehensive configuration verification function that checks and displays the status of all DocChat system settings, including API keys, models, ChromaDB connection, directories, and LLM initialization.

    File: /tf/active/vicechatdev/docchat/verify_setup.py | Lines: 13-141

    configuration verification diagnostics setup validation
  • function export_to_word

    Flask route handler that exports a chat conversation to a formatted Microsoft Word (.docx) document with styled headings, timestamps, and references.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1758-1834

    export word-document docx chat-history conversation-export
  • function list_custom_instructions

    Flask API endpoint that retrieves and returns a list of all custom instruction markdown files stored in the 'instructions' directory.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1740-1753

    flask api rest-api file-listing directory-scanning
  • function load_custom_instructions

    Flask API endpoint that loads and returns the content of custom instruction files from a designated instructions directory with security validation.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1716-1736

    flask api-endpoint file-loading security path-traversal-prevention
  • function save_custom_instructions

    Flask API endpoint that saves custom instructions to a markdown file in a designated instructions directory with filename sanitization.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1684-1712

    flask api-endpoint file-operations rest-api file-saving
  • function get_instruction_templates

    Flask API endpoint that returns a dictionary of predefined instruction templates for different document types including SOPs, work instructions, quality forms, and document comparison guidelines.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1530-1680

    flask api endpoint templates instructions
  • function internal_error

    Flask error handler that catches internal server errors (HTTP 500), logs them, and returns a standardized JSON error response.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1524-1526

    flask error-handler http-500 exception-handling logging
  • function view_document

    Flask route handler that serves documents for in-browser viewing by accepting a file path as a query parameter, validating security constraints, and returning the file with appropriate MIME types and CORS headers.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1426-1504

    flask file-serving document-viewer security path-validation
  • function api_index_progress

    Flask API endpoint that retrieves the current progress status of an asynchronous indexing task by its task ID.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1404-1422

    flask api rest-endpoint progress-tracking async-task
  • function api_index_folder

    Flask API endpoint that initiates a background task to index documents in a specified folder, tracking progress and returning a task ID for status monitoring.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1301-1400

    flask api endpoint background-task document-indexing
  • function api_clear_history

    Flask API endpoint that clears the chat history for the current user session by removing stored conversation data associated with the session ID.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 1286-1297

    flask api endpoint chat history