pub enum StreamEvent {
TextDelta(String),
ReasoningDelta(String),
ReasoningBlockStart,
FunctionCallStart {
index: usize,
call_id: String,
name: String,
},
FunctionCallDelta {
index: usize,
delta: String,
},
FunctionCallDone {
index: usize,
arguments: String,
},
UsageUpdate {
usage: Option<Value>,
stop_reason: Option<String>,
},
Done(Value),
Error(String),
}Expand description
Events emitted during a streaming LLM response.
Variants§
TextDelta(String)
A chunk of text content from the assistant.
ReasoningDelta(String)
A chunk of reasoning/thinking content.
ReasoningBlockStart
A new reasoning/thinking block is starting (used to insert separators between multiple interleaved thinking blocks in a single response).
FunctionCallStart
A new function/tool call is starting.
Fields: (index, call_id, function_name)
FunctionCallDelta
A chunk of function call arguments.
FunctionCallDone
Function call arguments are complete.
UsageUpdate
Usage/metadata update (input_tokens, output_tokens, stop_reason).
Done(Value)
The complete response is available (streaming finished). Contains the full response body for final processing.
Error(String)
An error occurred during streaming.
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 moreAuto Trait Implementations§
impl Freeze for StreamEvent
impl RefUnwindSafe for StreamEvent
impl Send for StreamEvent
impl Sync for StreamEvent
impl Unpin for StreamEvent
impl UnsafeUnpin 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