Sycophant.Agent.Callbacks
(sycophant v0.4.2)
Copy Markdown
Callback function types for agent lifecycle hooks.
All callbacks are optional. When nil, the agent uses default behavior.
Summary
Functions
Creates a new Callbacks struct from keyword options.
Types
@type on_error() :: (Splode.Error.t(), Sycophant.Context.t() -> :retry | {:retry, pos_integer()} | {:continue, String.t() | Sycophant.Message.t() | [Sycophant.Message.t()]} | {:stop, term()})
@type on_max_steps() :: (non_neg_integer(), Sycophant.Context.t() -> :continue | :stop)
@type on_response() :: (Sycophant.Response.t() -> :ok)
@type on_tool_call() :: (Sycophant.ToolCall.t() -> :approve | :reject | {:modify, Sycophant.ToolCall.t()})
@type t() :: %Sycophant.Agent.Callbacks{ on_error: on_error() | nil, on_max_steps: on_max_steps() | nil, on_response: on_response() | nil, on_tool_call: on_tool_call() | nil }