Add Deepgram Voice Agent framework support#144
Open
weiz9 wants to merge 2 commits into
Open
Conversation
Adds a `deepgram` assistant-server framework backed by Deepgram's Voice Agent API (unified STT->LLM->TTS over a single WebSocket), so it can be benchmarked like the existing S2S frameworks. - New DeepgramAssistantServer (src/eva/assistant/deepgram_server.py), modeled on the Gemini Live server and the assistant_server_contract. - Register `deepgram` in worker._get_server_class and the framework Literal. - Parse raw WebSocket JSON by event `type` rather than the SDK's typed iterator, which in deepgram-sdk 6.1.x mis-deserializes every agent event as the same model (dropping transcripts and tool-call requests). - KeepAlive task to prevent Deepgram's ~10s input-audio timeout from closing the session while the (half-duplex) agent is speaking. - Compute model_response latency from the server-side receipt time of user_speech_stop (the simulator emits it on a monotonic clock). - Unit tests for settings/tool conversion + framework dispatch test. - Docs section in assistant_server_contract.md; .env.example framework enum. - Bump simulation_version 2.0.0 -> 2.1.0 (affects benchmark outputs).
…agent-framework # Conflicts: # src/eva/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
deepgramassistant-server framework backed by Deepgram's Voice Agent API (unified STT→LLM→TTS over a single WebSocket), so the Deepgram agent can be benchmarked like the existing S2S frameworks. Modeled on the Gemini Live server and thedocs/assistant_server_contract.mdcontract.Changes
src/eva/assistant/deepgram_server.py(DeepgramAssistantServer): bridges the Twilio-framed user-simulator WebSocket ↔client.agent.v1.connect(), with the standard audit-log / framework-log / metrics-log / audio-buffer handling.deepgramadded toworker._get_server_class()and theframeworkLiteralinmodels/config.py.tests/unit/assistant/test_deepgram_server.py(settings + tool-conversion) and a dispatch case intest_framework_dispatch.py.assistant_server_contract.md;deepgramadded to the framework enum in.env.example.simulation_version2.0.0 → 2.1.0 (affects benchmark outputs).Implementation notes (found via live testing)
deepgram-sdk6.1.x mis-deserializes every agent event to the same model via its typed iterator, dropping transcripts and tool-call requests. The server iterates the raw WebSocket and dispatches on the JSONtypeinstead (audio still arrives as binary frames).KeepAlivetask prevents Deepgram's ~10s input-audio timeout from closing the session while the half-duplex agent is speaking.model_responselatency is measured from the server-side receipt time of the simulator'suser_speech_stopevent.Testing
ruff,mypy(new file clean), andpre-commit run --all-filesall pass (version-bump + metric-signature hooks included).conversation_valid_end = 1.0), 500+ tool calls executed with scenario-DB mutations, and zero framework-level errors (no disconnects, audio timeouts, or event-processing failures).Config example
EVA_FRAMEWORK=deepgram EVA_MODEL__S2S=deepgram EVA_MODEL__S2S_PARAMS='{"api_key":"<deepgram-key>","model":"gpt-4o-mini"}'Optional
s2s_params(defaults):think_provider(open_ai),listen_model(nova-3),speak_model(aura-2-thalia-en),language(en).