pub enum StreamEvent {
TextDelta(String),
ContentBlockComplete(ContentBlock),
ToolUseStart {
id: String,
name: String,
},
ToolInputDelta {
id: String,
partial_json: String,
},
Done {
usage: Usage,
stop_reason: Option<StopReason>,
},
Ttft(u64),
Error(String),
}Expand description
Events yielded by the stream parser.
Variants§
TextDelta(String)
Partial text being streamed.
ContentBlockComplete(ContentBlock)
A complete content block has been finalized.
ToolUseStart
A tool use block is being accumulated (for progress display).
ToolInputDelta
Partial JSON for a tool input being accumulated.
Done
The model has finished generating. Contains final usage.
Ttft(u64)
Time to first token, in milliseconds.
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