pub enum StreamEvent {
FirstByte,
ThinkingDelta(String),
TextDelta(String),
ToolUseStart {
id: String,
name: String,
},
ToolInputDelta {
bytes_so_far: usize,
},
Done(ChatResponse),
Error(String),
}Expand description
Incremental events emitted during a streaming chat turn.
Variants§
FirstByte
First byte received from the server — agent should stop any waiting spinner.
ThinkingDelta(String)
Extended-thinking text delta (Anthropic thinking block).
TextDelta(String)
Visible assistant text delta.
ToolUseStart
A new tool_use block started.
ToolInputDelta
Incremental progress for the current tool_use block’s JSON input.
bytes_so_far is the total accumulated size of the partial JSON
received for this block — useful for driving progress indicators
while the model streams large arguments (e.g. a full file body).
Done(ChatResponse)
Final turn result — includes the full assembled content blocks.
Error(String)
Fatal error 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 (const: unstable) · 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