pub enum ModelResponsePartDelta {
Text(TextPartDelta),
ToolCall(ToolCallPartDelta),
Thinking(ThinkingPartDelta),
BuiltinToolCall(BuiltinToolCallPartDelta),
}Expand description
Delta content for different part types.
Variants§
Text(TextPartDelta)
Text content delta.
ToolCall(ToolCallPartDelta)
Tool call arguments delta.
Thinking(ThinkingPartDelta)
Thinking content delta.
BuiltinToolCall(BuiltinToolCallPartDelta)
Builtin tool call arguments delta.
Implementations§
Source§impl ModelResponsePartDelta
impl ModelResponsePartDelta
Sourcepub fn is_tool_call(&self) -> bool
pub fn is_tool_call(&self) -> bool
Check if this is a tool call delta.
Sourcepub fn is_thinking(&self) -> bool
pub fn is_thinking(&self) -> bool
Check if this is a thinking delta.
Sourcepub fn is_builtin_tool_call(&self) -> bool
pub fn is_builtin_tool_call(&self) -> bool
Check if this is a builtin tool call delta.
Sourcepub fn content_delta(&self) -> Option<&str>
pub fn content_delta(&self) -> Option<&str>
Get the content delta if applicable.
Sourcepub fn apply(&self, part: &mut ModelResponsePart) -> bool
pub fn apply(&self, part: &mut ModelResponsePart) -> bool
Apply this delta to a matching ModelResponsePart.
Returns true if the delta was successfully applied (types matched),
false if the types didn’t match.
Trait Implementations§
Source§impl Clone for ModelResponsePartDelta
impl Clone for ModelResponsePartDelta
Source§fn clone(&self) -> ModelResponsePartDelta
fn clone(&self) -> ModelResponsePartDelta
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 ModelResponsePartDelta
impl Debug for ModelResponsePartDelta
Source§impl<'de> Deserialize<'de> for ModelResponsePartDelta
impl<'de> Deserialize<'de> for ModelResponsePartDelta
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelResponsePartDelta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelResponsePartDelta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModelResponsePartDelta
impl PartialEq for ModelResponsePartDelta
Source§impl Serialize for ModelResponsePartDelta
impl Serialize for ModelResponsePartDelta
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ModelResponsePartDelta
Auto Trait Implementations§
impl Freeze for ModelResponsePartDelta
impl RefUnwindSafe for ModelResponsePartDelta
impl Send for ModelResponsePartDelta
impl Sync for ModelResponsePartDelta
impl Unpin for ModelResponsePartDelta
impl UnwindSafe for ModelResponsePartDelta
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