pub enum StreamEvent {
State {
state: HashMap<String, Value>,
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: HashMap<String, Value>,
total_steps: usize,
},
Error {
message: String,
node: Option<String>,
},
}Available on crate feature
graph only.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 updates(node: &str, updates: HashMap<String, Value>) -> StreamEvent
pub fn updates(node: &str, updates: HashMap<String, Value>) -> StreamEvent
Create an updates event
Sourcepub fn message(node: &str, content: &str, is_final: bool) -> StreamEvent
pub fn message(node: &str, content: &str, is_final: bool) -> StreamEvent
Create a message event
Sourcepub fn debug(event_type: &str, data: Value) -> StreamEvent
pub fn debug(event_type: &str, data: Value) -> StreamEvent
Create a debug event
Sourcepub fn node_start(node: &str, step: usize) -> StreamEvent
pub fn node_start(node: &str, step: usize) -> StreamEvent
Create a node start event
Sourcepub fn node_end(node: &str, step: usize, duration_ms: u64) -> StreamEvent
pub fn node_end(node: &str, step: usize, duration_ms: u64) -> StreamEvent
Create a node end event
Sourcepub fn step_complete(step: usize, nodes_executed: Vec<String>) -> StreamEvent
pub fn step_complete(step: usize, nodes_executed: Vec<String>) -> StreamEvent
Create a step complete event
Sourcepub fn interrupted(node: &str, message: &str) -> StreamEvent
pub fn interrupted(node: &str, message: &str) -> StreamEvent
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 · Source§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
Source§impl Serialize for StreamEvent
impl Serialize for StreamEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request