GoogleStephen Allen, Kaz SatoTutorial
Step by Step guide: Build a Voice Agent That Never Goes Silent using ADK
Summary
Voice agents that block on slow tool calls produce dead air, causing users to assume the call dropped and hang up. The open-source Agent Development Kit (ADK) with gemini-3.8-live addresses this with two non-blocking patterns. Streaming tools use Python async generators that yield progress updates, enabling the agent to narrate stages like connecting, scanning records, and aggregating revenue while the task runs in the background. Background execution uses single-yield generators or FunctionTool with response_scheduling to deliver results when idle, allowing users to ask unrelated questions without cancellation, and benchmark sales-report workflows show first words appearing in 1.2 seconds instead of 14.4. Scheduling modes WHEN_IDLE, INTERRUPT, and SILENT control when the model reacts to incoming tool results, ensuring the agent remains conversational throughout complex operations, with production features for cancellation and idempotency.
Context
Traditional voice agents block on tool calls, producing dead air during long queries (e.g., 13 seconds). This silence causes users to assume the call dropped and hang up, whereas text chat can show loading spinners for the same delay.
Approach / What changed
Using ADK’s streaming tools (async generators yielding progress updates) and background execution with single-yield generators or FunctionTool with response_scheduling (WHEN_IDLE, INTERRUPT, SILENT) to implement non-blocking voice agents that avoid dead air during long-running tool calls.
Takeaways
Switching from blocking to streaming tools in ADK reduces agent first-word latency from 14.4 seconds to 1.2 seconds in benchmark sales-report workflows.
ADK supports three response_scheduling behaviors: WHEN_IDLE waits for a natural pause, INTERRUPT cuts into current speech, and SILENT stores results silently in conversation history.
User barge-in does not cancel running streaming tools; to explicitly stop a tool, the model must call the built-in stop_streaming function.
FAQ
How do streaming tools avoid dead air?
Streaming tools use async generators that yield progress updates at each stage. The agent can narrate updates like 'Connecting to warehouse...' while the query continues in the background, keeping the conversation alive.
What scheduling modes are available?
Three modes: WHEN_IDLE delivers tool results at the next natural pause, INTERRUPT cuts off current speech mid-sentence, and SILENT adds the result to conversation history without announcement.
Can streaming and scheduling be combined?
Yes. response_scheduling can be set on a streaming tool to stamp every partial update, or per-update scheduling can be set dynamically by yielding FunctionResponse objects.
Source and freshness
- Source
- developers.googleblog.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.