pub enum LlmResponseChunk {
MessageStart {
id: Option<String>,
model: Option<String>,
},
TextDelta {
index: usize,
text: String,
},
ReasoningDelta {
index: usize,
text: String,
},
ToolCallDelta {
index: usize,
id: Option<String>,
name: Option<String>,
arguments_delta: Option<String>,
},
Usage(Usage),
MessageStop {
reason: Option<String>,
},
DecodeError {
message: String,
},
StreamError {
message: String,
},
}Expand description
One provider-neutral streaming response chunk.
Variants§
MessageStart
Starts a response message.
Fields
TextDelta
Adds text to one output index.
ReasoningDelta
Adds reasoning text to one output index.
ToolCallDelta
Adds or updates a tool call at one index.
Fields
Usage(Usage)
Reports token usage, normally near the end of the stream.
MessageStop
Ends a response message.
DecodeError
Reports that an inbound stream event could not be decoded.
StreamError
Reports an upstream failure delivered inside an otherwise successful stream.
Trait Implementations§
Source§impl Clone for LlmResponseChunk
impl Clone for LlmResponseChunk
Source§fn clone(&self) -> LlmResponseChunk
fn clone(&self) -> LlmResponseChunk
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 moreSource§impl Debug for LlmResponseChunk
impl Debug for LlmResponseChunk
Source§impl<'de> Deserialize<'de> for LlmResponseChunk
impl<'de> Deserialize<'de> for LlmResponseChunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<LlmResponseChunk> for LlmResponseStreamEvent
impl From<LlmResponseChunk> for LlmResponseStreamEvent
Source§fn from(chunk: LlmResponseChunk) -> Self
fn from(chunk: LlmResponseChunk) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LlmResponseChunk
impl PartialEq for LlmResponseChunk
Source§impl Serialize for LlmResponseChunk
impl Serialize for LlmResponseChunk
impl StructuralPartialEq for LlmResponseChunk
Auto Trait Implementations§
impl Freeze for LlmResponseChunk
impl RefUnwindSafe for LlmResponseChunk
impl Send for LlmResponseChunk
impl Sync for LlmResponseChunk
impl Unpin for LlmResponseChunk
impl UnsafeUnpin for LlmResponseChunk
impl UnwindSafe for LlmResponseChunk
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