pub enum StreamEvent {
MessageStart {
id: String,
model: String,
usage: Usage,
},
ContentBlockStart {
index: u32,
content_block: ContentBlock,
},
ContentBlockDelta {
index: u32,
delta: ContentDelta,
},
ContentBlockStop {
index: u32,
},
MessageDelta {
stop_reason: Option<StopReason>,
usage: Usage,
},
MessageStop,
Ping,
Error {
message: String,
},
}Expand description
A streaming event from the LLM provider.
Variants§
MessageStart
The message has started.
ContentBlockStart
A content block has started.
Fields
§
content_block: ContentBlockThe initial content block (may be partial).
ContentBlockDelta
A delta (incremental update) to a content block.
ContentBlockStop
A content block has finished.
MessageDelta
Final message metadata.
MessageStop
The message is complete.
Ping
Keepalive ping.
Error
An error occurred.
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 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