type field that tells you what happened — text being generated, a tool being called, a payment receipt, or the final result.
Why streaming
Streaming lets you show progress as it happens. Instead of waiting 10 seconds for a full response, you see the first words in under a second. For agent calls that involve tool use, you see each tool start and finish in real time.Basic streaming
What you receive
The stream yields typed events. The most common ones:
The stream also yields timing events, reasoning deltas, plan events, child agent events, and conclave events. See Stream Protocol for the complete reference.
The final result
After the stream ends, theStreamIterator resolves with a final result containing the full text, tool calls, receipt, and budget: