#[non_exhaustive]pub enum ContentKind {
Text {},
ToolUse {
id: String,
name: String,
},
Thinking {
id: Option<String>,
},
RedactedThinking {
data: String,
},
Image {
media_type: String,
},
ServerToolUse {
id: String,
name: String,
},
ServerToolResult {
kind: String,
tool_use_id: String,
content: Value,
},
Other(Value),
}Expand description
What kind of content block is opening (§3.2). Externally tagged so it
renders {"text":{}} / {"tool_use":{…}} exactly as the §5.2 sample shows.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text
ToolUse
Thinking
id is the OpenAI Responses reasoning-item id (rs_…), surfaced at block
open so a --json harness can rebuild the item for replay; None for
Anthropic/Google (no reasoning-item id). Serializes {"thinking":{}} when
None — byte-identical to the pre-reasoning-round-trip shape (bl-61a9).
RedactedThinking
The Anthropic opaque blob, present AT block open (the wire delivers it on
the block start, mirroring ServerToolResult’s inline content — no delta
follows), so it round-trips through the decoded stream (bl-61a9).
Image
A model-RETURNED image (bl-0987): the response mirror of the request-side
Content::Image{Base64}. The media type is the block’s identity at open; the
bytes follow as Delta::ImageDelta base64 fragments. Gemini image models and the
OpenAI Responses image_generation tool produce it; every other dialect is the
empty set.
ServerToolUse
Opaque server-tool invocation (CR-4). Streams start+json_delta+stop like ToolUse.
ServerToolResult
Opaque server-tool RESULT. kind is the verbatim wire tag (open set); the full
content arrives INLINE at content_block_start (no deltas).
Other(Value)
Forward-compat: an unknown externally-tagged kind rides here verbatim
(the whole {tag: body} object) so a pinned consumer passes it through.