pub enum ContentBlock {
Text {
text: String,
},
Image {
attachment_id: String,
},
Audio {
attachment_id: String,
},
Video {
attachment_id: String,
},
ToolUse {
tool_call_id: ToolCallId,
name: String,
input: Value,
},
ToolResult {
tool_call_id: ToolCallId,
content: Vec<ContentBlock>,
},
Unknown,
}Expand description
Re-exports of the v2 wire types per ADR 0015. v2 is shipped as
part of inferd-client 0.2 so consumers building against v2 can
reach the proto types without a separate inferd-proto dep.
One element of a MessageV2::content array.
Forward-compatibility: unknown content-block types deserialise as
the Unknown variant so v2.0 daemons / clients ignore content
shapes added in later v2.x revisions gracefully. The daemon emits
invalid_request only if the model needs the unknown content to
proceed (per ADR 0015 §“v2 ContentBlock variants”).
Variants§
Text
Plain text segment within a message.
Image
Reference to an image-kind attachment in the request’s top-level
attachments[] table.
Audio
Reference to an audio-kind attachment.
Video
Reference to a video-kind attachment. Backends that don’t
support video reject the request with attachment_unsupported.
ToolUse
Assistant-emitted invocation. Consumers don’t typically construct
these on the request side — the daemon emits them as response
frames; consumers then send a follow-up request with a matching
ToolResult block. Allowed in request messages[] only when
replaying prior assistant turns for context.
Fields
tool_call_id: ToolCallIdPairs this invocation with the corresponding ToolResult.
ToolResult
Consumer-constructed result of executing a tool. Routed back into the model’s context by the daemon’s chat-templating layer.
Fields
tool_call_id: ToolCallIdMust match the tool_call_id of the assistant-emitted
ToolUse block this is responding to.
content: Vec<ContentBlock>Result content; typically a single Text block.
Unknown
Forward-compatible escape hatch — any type value the local
build doesn’t recognise lands here so older clients/daemons
don’t reject newer payloads at parse time.
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 moreSource§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<ContentBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ContentBlock
impl PartialEq for ContentBlock
Source§fn eq(&self, other: &ContentBlock) -> bool
fn eq(&self, other: &ContentBlock) -> bool
self and other values to be equal, and is used by ==.