ADK.Tool.FunctionTool (adk_ex v1.1.0)

Copy Markdown View Source

A tool backed by an anonymous function.

The simplest way to create a tool — provide a name, description, parameter schema, and a handler function.

Summary

Functions

Creates a new FunctionTool.

Types

handler()

@type handler() :: (ADK.Tool.Context.t(), map() -> {:ok, map()} | {:error, term()})

t()

@type t() :: %ADK.Tool.FunctionTool{
  description: String.t(),
  handler: handler(),
  is_long_running: boolean(),
  name: String.t(),
  parameters: map()
}

Functions

new(opts)

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

Creates a new FunctionTool.