7. Streaming and Multi-turn
7. Streaming and Multi-turn
The HelloWorld sample proves basics. Real systems need richer task state, incremental updates, and multi-turn continuation.
Why this step matters
- Beginners see how A2A task state works in practice.
- Developers learn how to emit status and artifact events correctly.
- Advanced teams validate continuation and recovery behavior.
Run the LangGraph sample
- Configure
GOOGLE_API_KEYfor the sample. - Start the server in the LangGraph sample directory.
- Run
test_client.pyfrom another terminal.
What to observe
TaskStatusUpdateEventduring intermediate processing.TaskArtifactUpdateEventwhen final outputs are produced.- Task continuation after
input_requiredresponses.
Multi-turn continuation pattern
- Client sends an initial ambiguous request.
- Agent returns
input_requiredwith clarification prompt. - Client sends another message with the same
taskIdandcontextId. - Server continues the same task until completion.
Important v1.0 alignment
- Do not rely on a
finalflag in status events. - Use task state transitions plus stream closure to detect completion.
Next step
Continue to 8. Next Steps .