Nous.Errors.ToolError exception (nous v0.17.2)

Copy Markdown View Source

Error during tool execution.

Raised when a tool function fails during execution.

Summary

Functions

Render any tool failure for the model: a one-line summary for logs and telemetry, and a response that goes back as the tool result.

Types

t()

@type t() :: %Nous.Errors.ToolError{
  __exception__: true,
  attempt: non_neg_integer() | nil,
  message: String.t(),
  original_error: any(),
  tool_name: String.t() | nil
}

Functions

format_for_model(tool_error, tool_name)

@spec format_for_model(term(), String.t()) :: %{
  summary: String.t(),
  response: String.t()
}

Render any tool failure for the model: a one-line summary for logs and telemetry, and a response that goes back as the tool result.

A ToolError keeps its structure (attempt count, original cause); any other exception contributes its message; anything else is inspected.