pub enum StreamEvent<S: State> {
Show 16 variants
Values {
state: S,
step: usize,
},
FilteredValues {
data: Value,
step: usize,
},
Updates {
node: String,
update: S::Update,
step: usize,
},
FilteredUpdates {
node: String,
data: Value,
step: usize,
},
Messages {
chunk: MessageChunk,
metadata: MessageStreamMetadata,
},
Custom {
node: String,
data: Value,
ns: Vec<String>,
},
TaskStart {
node: String,
task_id: String,
step: usize,
},
TaskEnd {
node: String,
task_id: String,
step: usize,
duration_ms: u64,
},
Interrupt {
node: String,
payload: Value,
resumable: bool,
ns: Vec<String>,
},
BudgetExceeded {
reason: BudgetExceededReason,
usage: BudgetUsage,
},
End {
output: S,
},
Cancelled {
step: usize,
},
Debug(DebugEvent),
Tools(ToolsEvent),
CheckpointSaved {
checkpoint_id: String,
metadata: CheckpointMetadata,
step: usize,
},
TaskDetail {
task_id: String,
node: String,
step: usize,
attempt: usize,
event: TaskEventType,
},
}Expand description
Stream event during graph execution
Variants§
Values
Complete state snapshot
FilteredValues
Filtered state snapshot (only selected fields as JSON).
Emitted instead of Values when
StreamConfig::output_keys is set. The data field contains a JSON
object with only the keys requested by the caller.
Updates
Node update
FilteredUpdates
Filtered node update (only selected fields as JSON).
Emitted instead of Updates when
StreamConfig::output_keys is set.
Messages
LLM token chunk
Custom
Custom event from node
TaskStart
Task started
TaskEnd
Task completed
Interrupt
HITL interrupt
BudgetExceeded
Budget exceeded
End
Graph execution completed
Fields
output: SCancelled
Graph execution was cancelled (e.g. by the caller dropping the stream).
Emitted when the graph is interrupted before reaching a natural End.
Consumers use this to distinguish between successful completion
(End), cancellation (Cancelled),
and errors (propagated via Result).
Debug(DebugEvent)
Debug event
Tools(ToolsEvent)
Tool lifecycle event
CheckpointSaved
Checkpoint saved
TaskDetail
Detailed task event
Implementations§
Source§impl<S: State> StreamEvent<S>
impl<S: State> StreamEvent<S>
Sourcepub fn namespace(&self) -> &[String]
pub fn namespace(&self) -> &[String]
Return the namespace segment list attached to this event, if any.
Events originating from subgraphs carry a non-empty ns field (the
nesting path). Top-level graph events return an empty slice.
This is used by stream filtering to decide whether to forward or
suppress subgraph events.