pub enum StreamDelta {
TextDelta {
delta: String,
block_index: usize,
},
ThinkingDelta {
delta: String,
block_index: usize,
},
ToolUseStart {
id: String,
name: String,
block_index: usize,
},
ToolInputDelta {
id: String,
delta: String,
block_index: usize,
},
Usage(Usage),
Done {
stop_reason: Option<StopReason>,
},
Error {
message: String,
recoverable: bool,
},
}Expand description
Events yielded during streaming LLM responses.
Each variant represents a different type of event that can occur during a streaming response from an LLM provider.
Variants§
TextDelta
A text delta for streaming text content.
Fields
ThinkingDelta
A thinking delta for streaming thinking/reasoning content.
Fields
ToolUseStart
Start of a tool use block (name and id are known).
Fields
ToolInputDelta
Incremental JSON for tool input (partial/incomplete JSON).
Fields
Usage(Usage)
Usage information (typically at stream end).
Done
Stream completed with stop reason.
Fields
§
stop_reason: Option<StopReason>Why the stream ended
Error
Error during streaming.
Trait Implementations§
Source§impl Clone for StreamDelta
impl Clone for StreamDelta
Source§fn clone(&self) -> StreamDelta
fn clone(&self) -> StreamDelta
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 StreamDelta
impl RefUnwindSafe for StreamDelta
impl Send for StreamDelta
impl Sync for StreamDelta
impl Unpin for StreamDelta
impl UnwindSafe for StreamDelta
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