#[non_exhaustive]pub enum ContentBlock {
Text {
text: String,
},
Image {
source: ImageSource,
},
Reasoning {
format: ReasoningFormat,
text: String,
signature: Option<String>,
payload: Option<Value>,
},
ToolUse {
id: String,
name: String,
input: Value,
},
ToolResult {
tool_use_id: String,
content: Vec<ResultChunk>,
is_error: bool,
},
}Expand description
A typed piece of message content, modeled on Anthropic’s content blocks.
#[non_exhaustive] so new block kinds can be added without a breaking change;
only Text, ToolUse, and ToolResult are exercised in v0.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text
Plain text.
Image
An image (multimodal).
Fields
source: ImageSourceWhere the image bytes come from.
Reasoning
Assistant reasoning, unified across wires (ADR-0013 amendment
2026-07-19; replaces the earlier Thinking/RedactedThinking pair).
ReasoningFormat selects the replay contract; each wire’s build
replays only its own format(s) and drops foreign formats (a session
never crosses wires, so nothing is lost).
Fields
format: ReasoningFormatWhich encoding/replay contract this data follows.
ToolUse
A tool call emitted by the assistant.
Fields
id: StringProvider-assigned id, paired with a later ContentBlock::ToolResult.
ToolResult
The result of a tool call, carried in a Role::User message.
Fields
tool_use_id: StringThe id of the ContentBlock::ToolUse this answers.
content: Vec<ResultChunk>The result content (text and/or images).
Trait Implementations§
Source§impl Clone for ContentBlock
impl Clone for ContentBlock
Source§fn clone(&self) -> ContentBlock
fn clone(&self) -> ContentBlock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more