Altar.ADM.ToolResult (Altar v0.1.2)

View Source

ToolResult correlates a FunctionCall with its outcome.

Use new/1 to construct validated instances. This simple v1 structure records whether the result is an error and carries the content payload.

Summary

Types

t()

A validated ToolResult.

Functions

Construct a new validated ToolResult.

Types

t()

@type t() :: %Altar.ADM.ToolResult{
  call_id: String.t(),
  content: any(),
  is_error: boolean()
}

A validated ToolResult.

Functions

new(attrs)

@spec new(map() | keyword()) :: {:ok, t()} | {:error, String.t()}

Construct a new validated ToolResult.

Accepts a map or keyword list with:

  • :call_id (required): non-empty string; correlates with the triggering call
  • :content (optional): any term; if is_error: true, should ideally be a map like %{error: "..."}
  • :is_error (optional): boolean, defaults to false

Returns {:ok, %ToolResult{}} on success or {:error, reason}.