pub enum AssistantMessageDelta {
Text {
content_index: usize,
delta: Cow<'static, str>,
},
Thinking {
content_index: usize,
delta: Cow<'static, str>,
},
ToolCall {
content_index: usize,
delta: Cow<'static, str>,
},
}Expand description
A typed incremental update during streaming, used in MessageUpdate events.
The delta field uses Cow<'static, str> to avoid cloning on the hot
path when the caller can transfer ownership of the underlying String.
Variants§
Text
An appended text string fragment.
Thinking
An appended reasoning fragment.
ToolCall
An appended JSON argument fragment for a tool call.
Trait Implementations§
Source§impl Clone for AssistantMessageDelta
impl Clone for AssistantMessageDelta
Source§fn clone(&self) -> AssistantMessageDelta
fn clone(&self) -> AssistantMessageDelta
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 AssistantMessageDelta
impl Debug for AssistantMessageDelta
Source§impl<'de> Deserialize<'de> for AssistantMessageDelta
impl<'de> Deserialize<'de> for AssistantMessageDelta
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 AssistantMessageDelta
impl RefUnwindSafe for AssistantMessageDelta
impl Send for AssistantMessageDelta
impl Sync for AssistantMessageDelta
impl Unpin for AssistantMessageDelta
impl UnsafeUnpin for AssistantMessageDelta
impl UnwindSafe for AssistantMessageDelta
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