Expand description
Unified Streaming for Workflows and Agents
Provides token-level and event-level streaming across all workflow types:
- Graph node execution with LLM token streaming
- Handoff conversation streaming
- Workflow step streaming
- Real-time event callbacks
§Example
ⓘ
use cortexai_crew::streaming::{StreamingGraph, WorkflowEvent};
// Create a streaming graph
let streaming = StreamingGraph::new(graph, backend);
// Execute with event stream
let mut stream = streaming.execute_streaming(initial_state).await?;
while let Some(event) = stream.next().await {
match event? {
WorkflowEvent::NodeStarted { node_id } => println!("Starting: {}", node_id),
WorkflowEvent::TokenDelta { token } => print!("{}", token),
WorkflowEvent::NodeCompleted { node_id, .. } => println!("\nDone: {}", node_id),
WorkflowEvent::WorkflowCompleted { .. } => break,
_ => {}
}
}Structs§
- Event
Callback Builder - Builder for event callbacks
- Event
Emitter - Event emitter for sending events to multiple receivers
- Event
Handler - Handler for workflow events
- Streaming
Graph - Streaming wrapper for Graph execution
- Streaming
Handoff - Streaming wrapper for Handoff execution
- Streaming
Stats - Statistics about a streaming execution
- Token
Collector - Collector for aggregating streamed tokens
Enums§
- Streaming
Node Type - Type of streaming node
- Streaming
Status - Status of streaming workflow completion
- Workflow
Event - Unified workflow event for streaming
- Workflow
Type - Type of workflow
Type Aliases§
- Event
Callback - Event callback function type
- Event
Stream - Stream of workflow events