pub enum ModelStreamEvent {
TextDelta {
text: String,
},
ThinkingDelta {
text: String,
},
Status {
label: String,
},
Usage {
input_tokens: Option<u64>,
output_tokens: Option<u64>,
cache_creation_tokens: Option<u64>,
cache_read_tokens: Option<u64>,
},
ToolCall(ToolInvocation),
Done,
}Expand description
A single event from a model provider’s streaming response.
Variants§
TextDelta
An incremental text delta from the assistant.
ThinkingDelta
An incremental thinking/reasoning delta.
Status
A status message from the provider (e.g. “processing”, “queued”).
Usage
Token usage information reported by the provider.
Fields
ToolCall(ToolInvocation)
The model requested a tool invocation.
Done
The stream has ended.
Trait Implementations§
Source§impl Clone for ModelStreamEvent
impl Clone for ModelStreamEvent
Source§fn clone(&self) -> ModelStreamEvent
fn clone(&self) -> ModelStreamEvent
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 moreSource§impl Debug for ModelStreamEvent
impl Debug for ModelStreamEvent
Source§impl<'de> Deserialize<'de> for ModelStreamEvent
impl<'de> Deserialize<'de> for ModelStreamEvent
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 PartialEq for ModelStreamEvent
impl PartialEq for ModelStreamEvent
Source§impl Serialize for ModelStreamEvent
impl Serialize for ModelStreamEvent
impl StructuralPartialEq for ModelStreamEvent
Auto Trait Implementations§
impl Freeze for ModelStreamEvent
impl RefUnwindSafe for ModelStreamEvent
impl Send for ModelStreamEvent
impl Sync for ModelStreamEvent
impl Unpin for ModelStreamEvent
impl UnsafeUnpin for ModelStreamEvent
impl UnwindSafe for ModelStreamEvent
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