pub enum StreamEvent {
TextDelta {
index: usize,
text: String,
},
InputJsonDelta {
index: usize,
partial_json: String,
},
ContentBlockStop {
index: usize,
},
MessageDelta {
status: ResponseStatus,
usage: TokenUsage,
},
MessageDone,
}Expand description
Incremental event emitted during SSE streaming.
Events within a single response arrive in order and reference the content block they
belong to via index. A stream ends with MessageDone.
Variants§
TextDelta
Appended text for the text block at index.
InputJsonDelta
Partial JSON fragment for the tool-use block at index. Concatenate the fragments
across deltas to reconstruct the full tool input; intermediate chunks are not valid JSON.
ContentBlockStop
The content block at index is complete; no further deltas will target it.
MessageDelta
Final status and cumulative token usage for the response. Emitted after all content blocks.
MessageDone
End of stream. No further events follow.
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