pub enum AssistantStreamChunk {
Text {
delta: String,
},
Thinking {
delta: String,
},
Reasoning {
delta: String,
},
ReasoningDetails {
delta: Vec<Value>,
},
ToolCallDelta {
index: usize,
id_delta: Option<String>,
name_delta: Option<String>,
arguments_delta: Option<String>,
},
}Expand description
One token-level chunk during streaming.
Apps render these as deltas. The loop ignores them (it only looks at
Start for the placeholder and Done / Error for the assembled
final message).
Variants§
Text
Text being appended to the visible assistant content.
Thinking
Hidden reasoning being appended (think-then-act block).
Reasoning
Native provider reasoning being appended.
ReasoningDetails
Native provider reasoning detail blocks being appended.
ToolCallDelta
Tool call accumulating: arguments JSON streaming in piece by piece.
Trait Implementations§
Source§impl Clone for AssistantStreamChunk
impl Clone for AssistantStreamChunk
Source§fn clone(&self) -> AssistantStreamChunk
fn clone(&self) -> AssistantStreamChunk
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 AssistantStreamChunk
impl Debug for AssistantStreamChunk
Source§impl<'de> Deserialize<'de> for AssistantStreamChunk
impl<'de> Deserialize<'de> for AssistantStreamChunk
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 AssistantStreamChunk
impl RefUnwindSafe for AssistantStreamChunk
impl Send for AssistantStreamChunk
impl Sync for AssistantStreamChunk
impl Unpin for AssistantStreamChunk
impl UnsafeUnpin for AssistantStreamChunk
impl UnwindSafe for AssistantStreamChunk
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