Source:
03_streaming.py · 03-streaming.tsagent.stream(input) to receive lifecycle events as the agent runs. After iterating, call .result() for the final RunResult.
Iterate events
Event types
| Event | Fired when |
|---|---|
iteration_start | A new think→act cycle begins. |
text_delta | The model emits a chunk of final text. |
tool_start / tool_end | A tool is about to run / has completed. |
result | The final RunResult (also returned by .result()). |
AgentStreamEvent in TypeScript and lives in opperai.agent._stream in Python.