pub enum ContentBlock {
Text {
text: String,
},
Thinking {
thinking: String,
},
RedactedThinking {
data: Option<String>,
},
ToolUse {
id: String,
name: String,
input: Value,
},
ToolResult {
tool_use_id: Option<String>,
content: Value,
},
Image {
source: Value,
},
InputText {
text: String,
},
OutputText {
text: String,
},
InputImage {
extra: BTreeMap<String, Value>,
},
Fallback {
extra: BTreeMap<String, Value>,
},
Unknown,
}Expand description
A content block that may carry text, used by both formats’ message bodies.
Unknown block types are preserved by tag in ContentBlock::Unknown.
Variants§
Text
Plain text.
Thinking
Anthropic reasoning block (not replayable across providers).
RedactedThinking
Anthropic redacted reasoning.
ToolUse
An assistant tool call (Anthropic shape).
ToolResult
A tool result (Anthropic shape).
Fields
Image
An image block (multimodal).
InputText
Codex input text block.
OutputText
Codex output text block.
InputImage
Codex input image block.
Fallback
PARITY-11 (provenance P011): a Claude provider-routing note —
real shape {"type":"fallback","from":{"model":..},"to":{"model":..}},
a mid-generation model swap (e.g. an overloaded model falling back to
another). session.rs’s loader folds it into a short bracketed text
marker rather than dropping it.
Unknown
Any block type we do not model yet. The tag is recovered via
ContentBlock::unknown_tag from the captured fields.
Implementations§
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