Co-authored-by: George Weale <gweale@google.com> COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6544 from allen-stephen:feat/live-workflow-evals 1f4a15fe22cf7a9231fd808ca4835e7d30dce155 PiperOrigin-RevId: 963504694
Live Workflow Sample
Overview
This sample composes three short, single-purpose live (voice) agents into a graph-based workflow:
greeter_agent— greets and confirms the caller's name.dob_verifier_agent— captures and validates the caller's date of birth (using thevalidate_date_of_birthtool).goals_agent— once identity is verified, delivers the call goals and wraps up the conversation.
Each stage runs in mode='task' and hands a typed result to the next
(GreeterOutput, DobOutput). The stages are wired directly into the
workflow's edges, so the framework runs them in order.
Sample Inputs
-
Hi, yes, this is John DoeConfirms identity so
greeter_agentcan complete and hand off. -
My date of birth is July 12th, 1985Triggers
validate_date_of_birthindob_verifier_agent; this DOB matches the mocked record and verifies the caller. -
No, no other questions. Thanks!Lets
goals_agentwrap up the call and end with "Goodbye.".
Graph
graph TD
START --> greeter_agent
greeter_agent --> dob_verifier_agent
dob_verifier_agent -->|calls| validate_date_of_birth(validate_date_of_birth)
dob_verifier_agent --> goals_agent
How To
-
Sequence live agents with
mode='task': Each stage is anAgentset tomode='task', so it runs its own turn-taking loop and completes before the next stage begins. Because the agents use a live model (gemini-live-2.5-flash-native-audio), the whole workflow runs as a voice conversation. -
Pass typed handoffs between stages: Give each stage an
output_schema(e.g.GreeterOutput,DobOutput) so its result is a validated, typed value that the next stage receives as input. -
Sequence the stages directly in
edges: Wire the agents into theWorkflowedges in order; no routing functions are needed for a linear flow:root_agent = Workflow( name='live_workflow', edges=[ (START, greeter_agent), (greeter_agent, dob_verifier_agent), (dob_verifier_agent, goals_agent), ], ) -
Run the agent with the ADK web interface and start a Live Session:
uv run adk web contributing/samples/live/live_workflow -
Evaluate the workflow in live mode:
test_config.jsonandlive_workflow.evalset.jsonscore the workflow with anllm_audiouser simulator that adapts to each stage instead of following a fixed script.- Install the eval extra:
uv pip install -e ".[eval]". - Add a
.envin this directory with Vertex AI credentials (seelive_bidi_streaming_single_agent/.env). The project needs access to both the Live API and Gemini TTS models. - Run the eval:
uv run adk eval \ contributing/samples/live/live_workflow \ contributing/samples/live/live_workflow/live_workflow.evalset.json \ --config_file_path contributing/samples/live/live_workflow/test_config.json
- Install the eval extra:
Related Guides
- Task-mode Agents - How
mode='task'agents run their own loop and complete with a typed result. - Workflow - Building
graph-based workflows with a
Workflowroot agent. - Graph - Defining nodes and
sequencing them with
edges.