Event Stream
@llm_chat calls return an AsyncGenerator[ReactOutput, None]; @llm_function exposes the same event stream through fn.stream(...). Each yielded item is either a response (final output) or an event (lifecycle signal).
ReactOutput
ResponseYield
Contains the final agent output:EventYield
Contains a lifecycle event:The 14 Event Types
Loop Lifecycle
LLM Call
Tool Execution
Custom Events
Custom events are emitted by tools via
ToolEventEmitter — used for streaming tool output (e.g., PyRepl stdout, shell output).
Convenience Filters
EventOrigin (Fork Routing)
When using SelfRef forks, events come from multiple agents.EventOrigin identifies the source: