pub enum ToolResultContentField {
Text(String),
Blocks(Vec<ToolResultContent>),
}Expand description
The content field of a ToolResult block.
Anthropic accepts either a plain string or an array of content blocks
(text + image). We use an untagged enum so that plain-string tool results
(the common case) serialize as "content": "..." and multi-modal results
serialize as "content": [{"type":"text","text":"..."},{"type":"image",...}].
Variants§
Text(String)
Plain text content (backward-compatible default).
Blocks(Vec<ToolResultContent>)
Array of text and/or image blocks (multi-modal tool output).
Implementations§
Trait Implementations§
Source§impl Clone for ToolResultContentField
impl Clone for ToolResultContentField
Source§fn clone(&self) -> ToolResultContentField
fn clone(&self) -> ToolResultContentField
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 ToolResultContentField
impl Debug for ToolResultContentField
Source§impl<'de> Deserialize<'de> for ToolResultContentField
impl<'de> Deserialize<'de> for ToolResultContentField
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 From<&str> for ToolResultContentField
impl From<&str> for ToolResultContentField
Source§impl From<String> for ToolResultContentField
impl From<String> for ToolResultContentField
Source§impl PartialEq<&str> for ToolResultContentField
impl PartialEq<&str> for ToolResultContentField
Source§impl PartialEq<str> for ToolResultContentField
impl PartialEq<str> for ToolResultContentField
Auto Trait Implementations§
impl Freeze for ToolResultContentField
impl RefUnwindSafe for ToolResultContentField
impl Send for ToolResultContentField
impl Sync for ToolResultContentField
impl Unpin for ToolResultContentField
impl UnsafeUnpin for ToolResultContentField
impl UnwindSafe for ToolResultContentField
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