Omni.Content.ToolUse (Omni v2.0.0)

Copy Markdown View Source

A tool use content block: the model asking for a tool to be run.

Only a model produces these, in assistant messages. Each is answered by an Omni.Content.ToolResult in the next user message.

Struct fields

  • :id - the provider's id for this tool use, which its result names
  • :name - the name of the tool
  • :input - the arguments, as the map the model wrote, with string keys
  • :signature - a token some providers attach and expect back on later turns. Omni handles it

Summary

Types

t()

The model's request to run a named tool with the given input.

Functions

Creates a new tool use content block from a keyword list or map.

Types

t()

@type t() :: %Omni.Content.ToolUse{
  id: String.t(),
  input: map(),
  name: String.t(),
  signature: String.t() | nil
}

The model's request to run a named tool with the given input.

Functions

new(attrs)

@spec new(Enumerable.t()) :: t()

Creates a new tool use content block from a keyword list or map.