pub enum StreamEvent {
Show 14 variants
State {
state: State,
step: usize,
},
Updates {
node: String,
updates: HashMap<String, Value>,
},
Message {
node: String,
content: String,
is_final: bool,
},
Custom {
node: String,
event_type: String,
data: Value,
},
Debug {
event_type: String,
data: Value,
},
NodeStart {
node: String,
step: usize,
},
NodeEnd {
node: String,
step: usize,
duration_ms: u64,
},
StepComplete {
step: usize,
nodes_executed: Vec<String>,
},
Interrupted {
node: String,
message: String,
},
NodeInterrupt {
node: String,
message: String,
data: Option<Value>,
},
Resumed {
step: usize,
pending_nodes: Vec<String>,
},
Done {
state: State,
total_steps: usize,
},
Error {
message: String,
node: Option<String>,
},
RouteDispatched {
source: String,
targets: Vec<String>,
},
}Expand description
Events emitted during streaming
Variants§
State
State snapshot
Updates
State updates from a node
Message
Message/token from LLM
Custom
Custom event from node
Debug
Debug event
NodeStart
Node started execution
NodeEnd
Node completed execution
StepComplete
Super-step completed
Interrupted
Execution was interrupted
NodeInterrupt
A node asked to pause, reported by Node::execute_stream.
The streamed path yields events rather than a NodeOutput, so a node’s own
interrupt request needs a way through. The executor turns this into the
pause and does not forward it, so a caller sees only Interrupted.
Resumed
Execution resumed from a checkpoint
Done
Graph execution completed
Error
Error occurred
RouteDispatched
Emitted when dynamic route dispatch occurs.
Implementations§
Source§impl StreamEvent
impl StreamEvent
Sourcepub fn node_start(node: &str, step: usize) -> Self
pub fn node_start(node: &str, step: usize) -> Self
Create a node start event
Sourcepub fn step_complete(step: usize, nodes_executed: Vec<String>) -> Self
pub fn step_complete(step: usize, nodes_executed: Vec<String>) -> Self
Create a step complete event
Sourcepub fn interrupted(node: &str, message: &str) -> Self
pub fn interrupted(node: &str, message: &str) -> Self
Create an interrupted event
Sourcepub fn node_interrupt(node: &str, message: &str, data: Option<Value>) -> Self
pub fn node_interrupt(node: &str, message: &str, data: Option<Value>) -> Self
Create an event reporting that a node asked to pause.
Sourcepub fn route_dispatched(source: &str, targets: Vec<String>) -> Self
pub fn route_dispatched(source: &str, targets: Vec<String>) -> Self
Create a route dispatched event
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more