Skip to content

Instantly share code, notes, and snippets.

View DeepakSilaych's full-sized avatar

Deepak Silaych DeepakSilaych

View GitHub Profile

Step 1: LLM Triggers the Handover

The process begins when the Language Model (LLM), after analyzing the conversation, decides human intervention is necessary.

  1. LLM JSON Response: The LLM's decision is communicated via a JSON object. To trigger the transfer, this object contains a specific key-value pair: {"transfer_to_human": true, "reason": "Customer is asking for a supervisor"}.
  2. Server-Side Trigger: The on_llm_response_a function in deepak/server.py serves as the callback for all LLM responses. It parses the incoming JSON and checks for the transfer_to_human boolean flag.
  3. Initiating Transfer: If the flag is true, the server calls trigger_human_transfer_a (deepak/server.py:1865). This function orchestrates the start of the handover.
  4. State Management: The core of the server's logic relies on a global dictionary _audio_out_leads which maps a unique lead_key to a StreamState dataclass object. Inside trigger_human_transfer_a:
  • The call's state is
@DeepakSilaych
DeepakSilaych / gsoc2025.md
Last active September 11, 2025 07:19
GSOC 2025 Report

Google Summer of Code 2025 Final Report: Anopheles Mosquito Genomic Taxon Classifier