Step-by-Step Streaming
Thestream method provides a clean interface for receiving intermediate steps during agent execution. Each step represents a tool call and its result.
Low-Level Event Streaming
For more granular control, use thestream_events method to get real-time output events:
The streaming API is based on LangChain’s
stream_events method. For more details on event types and data structure, check the LangChain streaming documentation.Choosing the Right Streaming Method
Use stream() when:
• You want to show step-by-step progress
• You need to process each tool call individually
• You’re building a workflow UI
• You want simple, clean step tracking
Use stream_events() when:
• You need fine-grained control over events
• You’re building real-time chat interfaces
• You want to stream LLM reasoning text
• You need custom event filtering