Overview
Use this guide when you want to subscribe to a CrewAI stream and print or route frames as they arrive. The basic pattern is:stream.result.
Print LLM Output
If you only care about text generated by LLM calls, subscribe to thellm projection and print frame.content:
frame.content is an empty string for frames that do not carry printable text, so this is also safe:
Print Tool Activity
Tool events arrive on thetools channel. Use frame.type to distinguish starts, finishes, and errors.
frame.event is the structured payload for the source event. Use it for metadata such as tool names, arguments, message roles, and runtime identifiers.
Watch Flow Progress
Flow lifecycle and method execution frames arrive on theflow channel:
Interleave Selected Channels
Useinterleave() when you want a subset of channels while preserving their relative order:
Stream a Direct LLM Call
Directllm.call(...) returns the final assembled result. To stream a direct LLM call, use llm.stream_events(...):
Stream a Conversational Turn
Conversational Flows exposestream_turn() for one user message:
Async Consumers
Async streams use the same channel projections:Cleanup
Use the stream as a context manager when possible. If a client disconnects or you stop consuming early, close the stream:await stream.aclose().
