pub enum ChatStreamEvent {
ContentDelta {
delta: String,
index: Option<usize>,
},
ToolCallDelta {
id: String,
function_name: Option<String>,
arguments_delta: Option<String>,
index: Option<usize>,
},
ThinkingDelta {
delta: String,
},
UsageUpdate {
usage: Usage,
},
StreamStart {
metadata: ResponseMetadata,
},
StreamEnd {
response: ChatResponse,
},
Error {
error: String,
},
}Expand description
Chat streaming event
Variants§
ContentDelta
Content delta (incremental text)
Fields
ToolCallDelta
Tool call delta
Fields
ThinkingDelta
Thinking/reasoning content delta (for models that support internal reasoning)
This includes content from <think> tags, reasoning fields, and thinking modes
UsageUpdate
Usage statistics update
StreamStart
Stream start event with metadata
Fields
§
metadata: ResponseMetadataResponse metadata
StreamEnd
Stream end event with final response
Fields
§
response: ChatResponseFinal response
Error
Error occurred during streaming
Trait Implementations§
Source§impl Clone for ChatStreamEvent
impl Clone for ChatStreamEvent
Source§fn clone(&self) -> ChatStreamEvent
fn clone(&self) -> ChatStreamEvent
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 ChatStreamEvent
impl Debug for ChatStreamEvent
Source§impl<'de> Deserialize<'de> for ChatStreamEvent
impl<'de> Deserialize<'de> for ChatStreamEvent
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
Auto Trait Implementations§
impl Freeze for ChatStreamEvent
impl RefUnwindSafe for ChatStreamEvent
impl Send for ChatStreamEvent
impl Sync for ChatStreamEvent
impl Unpin for ChatStreamEvent
impl UnwindSafe for ChatStreamEvent
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