pub enum ContentBlockStart {
Text {
text: String,
},
Thinking {
thinking: String,
},
RedactedThinking {
data: String,
},
ToolUse {
id: String,
name: String,
input: Value,
caller: Option<ToolCaller>,
thought_signature: Option<String>,
},
ServerToolUse {
id: String,
name: String,
input: Value,
kind: Option<String>,
caller: Option<ToolCaller>,
},
WebSearchToolResult {
tool_use_id: String,
content: Value,
kind: Option<String>,
},
WebFetchToolResult {
tool_use_id: String,
content: Value,
kind: Option<String>,
signature: Option<String>,
},
WebSearchCall {
id: String,
status: String,
kind: Option<String>,
action: Option<Value>,
},
ServerToolCalls {
steps: Vec<Value>,
},
}Expand description
Content block types used in streaming starts.
Variants§
Text
Thinking
RedactedThinking
Anthropic redacted_thinking: the provider withheld the whole block
for safety and replaced it with an encrypted payload that arrives
complete on the start event (no deltas). It must be captured and
replayed byte-exact — the API decrypts it to restore the turn’s
reasoning, and dropping it makes the next tool-loop request fail with
“Expected thinking or redacted_thinking, but found tool_use”.
Fields
data: StringTolerant of both a missing and an explicit-null data
(deserialize_redacted_data + default): a contract-violating
start event still decodes (empty payload + capture warn) instead
of failing the whole event and silently losing the turn. Note
that #[serde(default)] alone only covers the missing key — an
explicit "data": null would still fail String decoding.
ToolUse
Fields
caller: Option<ToolCaller>