pub enum ContentBlock {
Text(TextBlock),
Image(ImageBlock),
ToolUse(ToolUseBlock),
ToolResult(ToolResultBlock),
}Expand description
A text, image, tool-call, or tool-result block.
Serializes as an object with a snake-case type tag. See Message for examples.
Variants§
Text(TextBlock)
Text content block containing a string message.
Image(ImageBlock)
Image content block for vision-capable models.
ToolUse(ToolUseBlock)
Tool use request from the model to execute a function.
ToolResult(ToolResultBlock)
Tool execution result sent back to the model.
Trait Implementations§
Source§impl Clone for ContentBlock
impl Clone for ContentBlock
Source§impl Debug for ContentBlock
impl Debug for ContentBlock
Source§impl<'de> Deserialize<'de> for ContentBlock
impl<'de> Deserialize<'de> for ContentBlock
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 ContentBlock
impl RefUnwindSafe for ContentBlock
impl Send for ContentBlock
impl Sync for ContentBlock
impl Unpin for ContentBlock
impl UnsafeUnpin for ContentBlock
impl UnwindSafe for ContentBlock
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