pub enum AssistantBlock {
Text {
text: String,
},
Reasoning {
text: String,
signature: Option<String>,
},
ToolCall {
id: ToolCallId,
name: String,
arguments: Value,
},
}Expand description
Assistant 专用内容块 — 比基础块多了推理和工具调用。
编译期保证只有 Assistant 消息可以包含 ToolCall 和 Reasoning。
Variants§
Trait Implementations§
Source§impl Clone for AssistantBlock
impl Clone for AssistantBlock
Source§fn clone(&self) -> AssistantBlock
fn clone(&self) -> AssistantBlock
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 AssistantBlock
impl Debug for AssistantBlock
Source§impl<'de> Deserialize<'de> for AssistantBlock
impl<'de> Deserialize<'de> for AssistantBlock
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 AssistantBlock
impl PartialEq for AssistantBlock
Source§fn eq(&self, other: &AssistantBlock) -> bool
fn eq(&self, other: &AssistantBlock) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AssistantBlock
impl Serialize for AssistantBlock
impl StructuralPartialEq for AssistantBlock
Auto Trait Implementations§
impl Freeze for AssistantBlock
impl RefUnwindSafe for AssistantBlock
impl Send for AssistantBlock
impl Sync for AssistantBlock
impl Unpin for AssistantBlock
impl UnsafeUnpin for AssistantBlock
impl UnwindSafe for AssistantBlock
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