feat(agent): Phase 4 — Voice Agent WebSocket client (#152) - #167
Open
dg-coreylweathers wants to merge 1 commit into
Open
feat(agent): Phase 4 — Voice Agent WebSocket client (#152)#167dg-coreylweathers wants to merge 1 commit into
dg-coreylweathers wants to merge 1 commit into
Conversation
7 tasks
New `agent` feature and module for Deepgram's Voice Agent. Deepgram::agent() -> Agent; start()/start_at_url() open a live session at wss://agent.deepgram.com/v1/agent/converse, returning an AgentHandle (send Settings, UpdateSpeak/UpdateThink/UpdatePrompt, InjectUserMessage/ InjectAgentMessage, FunctionCallResponse, KeepAlive, and binary audio) and an AgentEventStream (futures::Stream) of typed AgentResponse events (Welcome, SettingsApplied, ConversationText, UserStartedSpeaking, AgentThinking, FunctionCallRequest, AgentStartedSpeaking, AgentAudioDone, History, Error, Warning, mid-session *Updated acks, and an Unknown catch-all). Fully typed Settings config: inline or saved (Uuid) agent configs; listen/think/speak provider settings (Deepgram STT V1/V2; OpenAI, Anthropic, AWS Bedrock, Google, Groq think providers; Deepgram, ElevenLabs, Cartesia, OpenAI, AWS Polly speak providers); audio I/O config; conversation history. All response/event types are #[non_exhaustive]; unknown message types are preserved. Examples simple_agent and function_calling. Ported and adapted from the maintainer's feat/agent-websocket branch; the live WebSocket client only. The REST saved-configuration/variables/ think-models namespace is deferred per the parity assessment. All additive (cargo semver-checks: no new breaking changes). Live-verified end-to-end against production: Settings applied, greeting audio + History + ConversationText received. Closes #152 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dg-coreylweathers
force-pushed
the
feat/phase-4-voice-agent
branch
from
July 31, 2026 11:55
49bde36 to
ff7d5a2
Compare
Author
|
Review addressed. Worker fix verified correct by the review (no busy-spin, no dropped messages, ordering/Ping/close semantics preserved; verified live under |
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.
Phase 4 — Voice Agent WebSocket client
Stacked on #166 (Phase 3). Base is
feat/phase-3-tts-ws-selfhosted; GitHub retargets tomainas the stack merges. This is the strategic bet from the parity assessment.What's included
agentfeature + module.Deepgram::agent()→Agent;start()/start_at_url()open a live session atwss://agent.deepgram.com/v1/agent/converse, returning anAgentHandle(sendSettings,UpdateSpeak/UpdateThink/UpdatePrompt,InjectUserMessage/InjectAgentMessage,FunctionCallResponse,KeepAlive, and binary audio) and anAgentEventStream(futures::Stream) of typedAgentResponseevents (Welcome,SettingsApplied,ConversationText,UserStartedSpeaking,AgentThinking,FunctionCallRequest,AgentStartedSpeaking,AgentAudioDone,History,Error,Warning, mid-session*Updatedacks,Unknown).Settings: inline or saved (Uuid) configs;listen/think/speakprovider settings (Deepgram STT V1/V2; OpenAI/Anthropic/AWS Bedrock/Google/Groq think; Deepgram/ElevenLabs/Cartesia/OpenAI/AWS Polly speak); audio I/O; conversation history. All event/response types#[non_exhaustive]; unknown messages preserved.simple_agent,function_calling.Provenance & scope
Ported and adapted from the maintainer's
feat/agent-websocketbranch — the live WebSocket client only. The REST saved-configuration / variables / think-models namespace is deferred per the assessment ("deferred until the live Voice Agent client exists").Verification (Rust 1.97 container)
-D warnings/ fmt /cargo test --all --all-features(207 lib + 141 doctests) ✅cargo checkincl. agent-only ✅; doc build-D warnings✅cargo semver-checks: no new breaking changes (only the inherited Phase 1 Extra metadata support #130 breaks).Welcome,Settings applied, received greeting audio +ConversationText"Hello! How can I help today?" +History+AgentAudioDone. Also verified the session runs cleanly under a current_thread runtime (no hang).Note (fix beyond the port)
The ported agent worker had the same latent busy-spin/current-thread-hang as the Phase 3 TTS-WS worker (kept selecting on the drained input channel after close). Fixed here identically (stop selecting on
message_rxonce input closes; sharedhandle_agent_inboundhelper) and verified undercurrent_thread.Closes #152