Sycophant.ToolCall (sycophant v0.4.2)

Copy Markdown

Represents a tool invocation requested by the LLM.

When an LLM decides to use a tool, it returns one or more ToolCall structs in response.tool_calls. Each contains a provider-assigned :id, the tool :name, and the parsed :arguments map.

Examples

%Sycophant.ToolCall{id: "call_abc", name: "get_weather", arguments: %{"city" => "Paris"}}

Summary

Functions

Reconstructs a ToolCall struct from a serialized map.

Types

t()

@type t() :: %Sycophant.ToolCall{
  arguments: map(),
  id: String.t(),
  metadata: map(),
  name: String.t()
}

Functions

from_map(data)

@spec from_map(map()) :: t()

Reconstructs a ToolCall struct from a serialized map.