pub enum ToolResultContent {
Text(String),
Blocks(Vec<ContentBlock>),
}Expand description
tool_result.content 字段:string 或 ContentBlock 数组。
#[serde(untagged)] 让 JSON "hello" 直接解到 Text 变体,[…] 解到 Blocks。
Variants§
Text(String)
Blocks(Vec<ContentBlock>)
Implementations§
Trait Implementations§
Source§impl Clone for ToolResultContent
impl Clone for ToolResultContent
Source§impl Debug for ToolResultContent
impl Debug for ToolResultContent
Source§impl<'de> Deserialize<'de> for ToolResultContent
impl<'de> Deserialize<'de> for ToolResultContent
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 JsonSchema for ToolResultContent
impl JsonSchema for ToolResultContent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ToolResultContent
impl PartialEq for ToolResultContent
Source§impl Serialize for ToolResultContent
impl Serialize for ToolResultContent
impl StructuralPartialEq for ToolResultContent
Auto Trait Implementations§
impl Forget for ToolResultContent
impl Freeze for ToolResultContent
impl Move for ToolResultContent
impl RefUnwindSafe for ToolResultContent
impl Send for ToolResultContent
impl Sync for ToolResultContent
impl Unpin for ToolResultContent
impl UnsafeUnpin for ToolResultContent
impl UnwindSafe for ToolResultContent
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