Raw live text chunks from the underlying strategy.
Structured live + finalized event stream.
This includes raw text/tool/lifecycle events and also the finalized
final-output event after post-processing completes.
Finalized scalar text after guardrails, HITL, and parsing hooks.
Final aggregate usage for the streamed run.
Optional costUSD?: numberFinal per-agent execution ledger for the streamed run.
Final structured payload; resolves to undefined when structured output
was not configured for the run.
Finalized approved-only text stream.
Unlike textStream, this yields only the post-guardrail/post-HITL answer.
For most runs it emits a single finalized chunk.
Public stream result returned by
agency().stream(...).This exposes both low-latency raw streaming and finalized post-processing results so callers can choose the right trade-off for their UI or runtime.
Prefer:
textStreamfor raw token-by-token UXfullStreamfor structured lifecycle eventstextorfinalTextStreamfor the finalized approved answertextStreammay differ from the finalized answer when output guardrails orbeforeReturnHITL rewrite the result.finalTextStreamandtextalways reflect the finalized post-processing output.Example