class

Smith::LLM::ContentBlock

Inherits JSON::Serializable < Reference < Object

Content block can represent text, tool calls, or tool results

Constructors

new(pull : JSON::PullParser)
Source
new(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)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
redacted_thinking(data : String) : ContentBlock

The content is encrypted, so it is carried through untouched and never shown.

Source
text(content : String) : ContentBlock
Source
thinking(content : String, signature : String | Nil = nil) : ContentBlock
Source
tool_result(id : String, result : String, is_error : Bool = false) : ContentBlock
Source
tool_use(id : String, name : String, args : JSON::Any) : ContentBlock
Source

Instance methods

is_error
Source
signature

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.

Source
text
Source
thinking?
Source
tool_args
Source
tool_call_id
Source
tool_name
Source
type
Source

Nested types