pub enum StreamEvent {
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,
},
Done {
state: State,
total_steps: usize,
},
Error {
message: String,
node: Option<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
Done
Graph execution completed
Error
Error occurred
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
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamEvent
impl Debug for StreamEvent
Auto Trait Implementations§
impl Freeze for StreamEvent
impl RefUnwindSafe for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnwindSafe for StreamEvent
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)