Jido.Chat.Content.ToolUse (Jido Chat v1.0.0)

Copy Markdown View Source

Tool use content block for messages.

Represents a request to invoke a tool/action. This maps to the LLM's tool_use blocks and integrates with jido_action for execution.

Fields

  • id - Unique identifier for this tool invocation (used to correlate with ToolResult)
  • name - The name of the tool/action to invoke
  • input - The input parameters for the tool as a map

Example

ToolUse.new("call_123", "get_weather", %{location: "San Francisco"})
#=> %ToolUse{type: :tool_use, id: "call_123", name: "get_weather", input: %{location: "San Francisco"}}

Summary

Functions

Creates a new tool use content block.

Returns the Zoi schema for ToolUse content

Types

t()

@type t() :: %Jido.Chat.Content.ToolUse{
  id: binary(),
  input: map(),
  name: binary(),
  type: :tool_use
}

Functions

new(id, name, input \\ %{})

Creates a new tool use content block.

Parameters

  • id - Unique identifier for this tool invocation
  • name - The name of the tool/action to invoke
  • input - The input parameters for the tool (default: %{})

Examples

iex> ToolUse.new("call_1", "search", %{query: "elixir"})
%ToolUse{type: :tool_use, id: "call_1", name: "search", input: %{query: "elixir"}}

schema()

Returns the Zoi schema for ToolUse content