pub enum ContentBlock {
Text {
text: String,
},
Thinking {
thinking: String,
signature: String,
},
RedactedThinking {
data: String,
},
ToolUse {
id: String,
name: ToolName,
input: Payload,
},
Image(ImageRef),
ToolResult {
tool_use_id: String,
content: String,
is_error: bool,
attachments: Vec<ImageRef>,
},
}Expand description
Canonical content block. Tool inputs are Payload — the float ban
holds here because these bytes become ledger payloads verbatim.
Thinking and RedactedThinking are carried unchanged end to end:
the provider verifies signature against the reasoning it issued, and
altering either block earns a 400 that names them as unmodifiable.
The block shapes are the city dialect’s, so
https://platform.claude.com/docs/en/build-with-claude/thinking is
what a change to them has to agree with.
Variants§
Text
Thinking
RedactedThinking
ToolUse
Image(ImageRef)
A picture the model can see. Carries the reference and the
dimensions; the bytes are fetched at the wire by whoever is about
to send them (gateway::endpoint), so this block stays a thing a
ledger can hold.
ToolResult
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
Source§impl PartialEq for ContentBlock
impl PartialEq for ContentBlock
Source§impl Serialize for ContentBlock
impl Serialize for ContentBlock
impl StructuralPartialEq for ContentBlock
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