Planck.AI.Tool (Planck.AI v0.1.0)

Copy Markdown View Source

Defines a tool that can be called by the model during a conversation.

The parameters field is a JSON Schema map describing the tool's input.

Examples

iex> Planck.AI.Tool.new(
...>   name: "bash",
...>   description: "Execute a shell command",
...>   parameters: %{
...>     "type" => "object",
...>     "properties" => %{
...>       "command" => %{"type" => "string", "description" => "The command to run"}
...>     },
...>     "required" => ["command"]
...>   }
...> )
%Planck.AI.Tool{name: "bash", description: "Execute a shell command", parameters: %{"type" => "object", "properties" => %{"command" => %{"type" => "string", "description" => "The command to run"}}, "required" => ["command"]}}

Summary

Functions

Builds a %Planck.AI.Tool{} struct from keyword options.

Types

t()

@type t() :: %Planck.AI.Tool{
  description: String.t(),
  name: String.t(),
  parameters: map()
}

Functions

new(opts)

@spec new(keyword()) :: t()

Builds a %Planck.AI.Tool{} struct from keyword options.

Options

  • :name — tool name (required)
  • :description — human-readable description (required)
  • :parameters — JSON Schema map describing the tool's input (required)