A tool result content block representing the output of a tool invocation.
Appears in user messages to provide the result of a preceding
Omni.Content.ToolUse. The tool_use_id links back to the originating
tool use block. Content is restricted to Text and Attachment blocks
(image attachments are only supported by some providers).
Summary
Types
Allowed content types within a tool result.
Output of a tool invocation, linked to its originating ToolUse by ID.
Functions
Creates a new tool result content block from a keyword list or map.
Types
@type content() :: Omni.Content.Text.t() | Omni.Content.Attachment.t()
Allowed content types within a tool result.
@type t() :: %Omni.Content.ToolResult{ content: [content()], is_error: boolean(), name: String.t(), tool_use_id: String.t() }
Output of a tool invocation, linked to its originating ToolUse by ID.
Functions
@spec new(Enumerable.t()) :: t()
Creates a new tool result content block from a keyword list or map.
String content is wrapped in a Text block. nil content becomes [].