struct

Smith::Tools::CallResult

Inherits Struct < Value < Object

Constructors

new(id : String, content : String, is_error : Bool = false, media : Array(Smith::LLM::ContentBlock) = Array(Smith::LLM::ContentBlock).new)
Source

Instance methods

content
Source
is_error
Source
media

An image or PDF the call produced. Empty for every error path and for every tool that answers in text, which is nearly all of them.

Source
to_content_blocks

The tool_result, then whatever travelled with it — flat, as siblings in the same message, each stamped with the call's id.

Nesting them inside the tool_result would match Anthropic's wire shape, but every part of smith that walks a message — the session store that externalizes attachment bytes, the token estimate, the renderers — reads top-level blocks. Flat keeps all of that working untouched, and the one provider that wants them nested folds them back at serialization time.

Source