🔍 Code Extractor

Browse Components

Showing 20 of 2143 components

  • function api_clear_memory

    Flask API endpoint that clears the chat memory from the server-side chat engine, removing all stored conversation messages.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 1314-1341

    flask api endpoint chat memory-management
  • function api_load_template

    Flask API endpoint that loads and returns instruction template content by template name, with authentication required.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 1290-1310

    flask api rest-endpoint template-loading authentication
  • function api_save_template

    Flask API endpoint that saves a new instruction template by validating input data and delegating to the chat engine's template storage mechanism.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 1268-1286

    flask api rest-endpoint template-management post-request
  • function api_save_template_v1

    Flask API endpoint that saves a new instruction template by accepting a POST request with template name and instructions, then persisting it via the chat_engine.

    File: /tf/active/vicechatdev/vice_ai/complex_app.py | Lines: 2389-2407

    flask api rest-endpoint template-management post-request
  • function api_collections_v1

    Flask API endpoint that retrieves and returns a list of available data collections from the chat engine instance.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 1246-1253

    flask api rest-endpoint collections rag
  • function api_cancel_task

    Flask API endpoint that cancels a background task if it belongs to the authenticated user and is currently processing.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 1219-1242

    api flask rest-endpoint task-management cancellation
  • function api_task_status_v1

    Flask API endpoint that retrieves and returns the status of a background task, with user authorization checks.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 1180-1215

    api flask background-tasks task-status authentication
  • function api_chat_v1

    Handle chat API requests with support for long-running tasks

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 726-1176

    function api_chat
  • function chat_v1

    Flask route handler that renders the main chat interface with available collections and instruction templates, requiring authentication.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 700-722

    flask web-route chat-interface authentication template-rendering
  • function process_chat_request_background

    Process chat request in background thread

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 274-628

    function process_chat_request_background
  • function init_chat_engine_v1

    Initializes a global chat engine instance using OneCo_hybrid_RAG and validates its configuration by checking for required attributes like available_collections and data_handles.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 245-268

    initialization chat-engine RAG hybrid-rag setup
  • function add_cache_headers_v1

    Flask after_request decorator function that adds HTTP cache control headers to responses based on debug mode, endpoint type, and request path.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 227-243

    flask http-headers caching cache-control middleware
  • function cleanup_old_documents

    Periodically removes documents and their associated files that are older than 2 hours from the uploaded_documents dictionary, cleaning up both file system storage and memory.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 135-166

    cleanup maintenance file-management document-management scheduled-task
  • function remove_user_document

    Removes a specific document for a user by deleting the file from the filesystem and removing its metadata from the in-memory storage structure.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 112-133

    document-management file-deletion thread-safe cleanup storage-management
  • function get_user_documents

    Thread-safe function that retrieves all documents associated with a specific user email from a global document storage dictionary.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 107-110

    document-management thread-safe user-data flask concurrency
  • function store_document

    Thread-safe function that stores document information (file path, text content, metadata) in a global dictionary indexed by user email and document ID.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 94-105

    document-storage thread-safe user-session file-management concurrent-access
  • function cleanup_old_tasks_v1

    Removes tasks from the active_tasks dictionary that are older than 1 hour (3600 seconds) based on their creation timestamp, using thread-safe locking.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 81-92

    cleanup task-management threading thread-safe memory-management
  • function fail_task

    Marks a task as failed by updating its status, recording the error message, and setting the completion timestamp in a thread-safe manner.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 68-74

    task-management error-handling thread-safe concurrency state-management
  • function fail_task_v1

    Marks a task as failed by updating its status, recording the error message, and setting the completion timestamp in a thread-safe manner.

    File: /tf/active/vicechatdev/docchat/app.py | Lines: 193-199

    task-management error-handling thread-safe state-management concurrency
  • function complete_task_v1

    Thread-safe function that marks a task as completed by updating its status, storing the result, and recording the completion timestamp in a shared task dictionary.

    File: /tf/active/vicechatdev/vice_ai/app.py | Lines: 60-66

    task-management threading concurrency state-management thread-safe