AshAi.ToToolError protocol (ash_ai v0.7.2)

Copy Markdown View Source

Converts Ash errors into concise readable tool error messages.

Implementations should return a concise error description.

Example

defimpl AshAi.ToToolError, for: MyApp.CustomError do
  def to_tool_error(error) do
    "custom error: #{error.message}"
  end
end

Summary

Types

t()

All the types that implement this protocol.

Functions

Returns a human-readable error message string for tool responses.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

to_tool_error(error)

@spec to_tool_error(t()) :: String.t()

Returns a human-readable error message string for tool responses.