pub enum StreamEvent {
TextDelta(String),
ToolUse(ToolUseBlock),
ThinkingDelta(String),
ContentBlock(ContentBlock),
Stop {
stop_reason: StopReason,
usage: Option<TokenUsage>,
},
}Expand description
Events from streaming model responses
Variants§
TextDelta(String)
Incremental text delta
ToolUse(ToolUseBlock)
Tool use detected
ThinkingDelta(String)
Incremental thinking delta (extended thinking)
ContentBlock(ContentBlock)
A complete content block for conversation replay, in provider order. Providers emitting this event must emit every block, including text and tools. TextDelta/ToolUse remain available for existing streaming consumers.
Stop
Streaming stopped
Fields
§
stop_reason: StopReasonWhy the model stopped
§
usage: Option<TokenUsage>Token usage for this response (if available)
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone 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 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