pub enum ContentBlock {
Text {
text: String,
cache_control: Option<CacheControl>,
},
Image {
source: ImageSource,
},
ToolUse {
id: String,
name: String,
input: Value,
},
ToolResult {
tool_use_id: String,
content: ToolResultContent,
is_error: bool,
cache_control: Option<CacheControl>,
},
Thinking {
thinking: String,
signature: String,
},
RedactedThinking {
data: String,
},
}Expand description
Content blocks used in both requests and responses.
Variants§
Text
Plain text.
Fields
cache_control: Option<CacheControl>Prompt-cache breakpoint marker (last-message placement, plan §4.3).
Image
An image.
Fields
source: ImageSourceWhere the image bytes come from.
ToolUse
A tool call emitted by the assistant.
Fields
ToolResult
A tool result, carried in a user turn.
Fields
content: ToolResultContentThe result payload.
is_error: boolWhether the tool call failed. Our delta over grok’s structs — the protocol carries it (ADR-0013) and Anthropic honours it.
cache_control: Option<CacheControl>Prompt-cache breakpoint marker.
Thinking
Assistant extended thinking. Replayed verbatim with its signature on
subsequent requests (plan §4.2) — Anthropic 400s a thinking + tool_use
turn whose signed thinking block is not echoed back.
Fields
RedactedThinking
Encrypted assistant thinking, replayed verbatim like signed thinking. Delta over grok’s structs: observed live during the Task-12 smoke — without this variant the whole response fails to deserialize.
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