Smith::LLM::ContentBlock
Inherits JSON::Serializable < Reference < Object
Content block can represent text, tool calls, or tool results
Constructors
new(pull : JSON::PullParser)
Sourcenew(type : BlockType, text : String | Nil = nil, tool_call_id : String | Nil = nil, tool_name : String | Nil = nil, tool_args : JSON::Any | Nil = nil, is_error : Bool | Nil = nil, signature : String | Nil = nil)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
Sourceredacted_thinking(data : String) : ContentBlock
The content is encrypted, so it is carried through untouched and never shown.
text(content : String) : ContentBlock
Sourcethinking(content : String, signature : String | Nil = nil) : ContentBlock
Sourcetool_result(id : String, result : String, is_error : Bool = false) : ContentBlock
Sourcetool_use(id : String, name : String, args : JSON::Any) : ContentBlock
SourceInstance methods
is_error
Sourcesignature
Anthropic's cryptographic signature over a thinking block. It must go back exactly as it came: never truncated, normalised or regenerated, or the next request is rejected. Defaulted in the declaration so sessions saved before thinking existed still deserialize.
text
Sourcethinking?
Sourcetool_args
Sourcetool_call_id
Sourcetool_name
Sourcetype
Source