Altar.LATER.Executor (Altar v0.1.2)
View SourceStateless tool execution for the Local Agent & Tool Execution Runtime (LATER).
This module provides a pure, stateless API to execute a registered tool using
a validated Altar.ADM.FunctionCall
. It looks up the tool in the
Altar.LATER.Registry
, invokes the implementation with the provided args, and
returns an Altar.ADM.ToolResult
via the validating constructor.
Summary
Functions
Execute a tool call against the given registry.
Functions
@spec execute_tool(GenServer.server(), Altar.ADM.FunctionCall.t()) :: {:ok, Altar.ADM.ToolResult.t()}
Execute a tool call against the given registry.
The function is pure with respect to input arguments: it looks up the
implementation function via the supplied registry pid/name and
deterministically constructs a ToolResult
based on the outcome of executing
that function with function_call.args
.
- If the tool is found and executes without raising, returns
{:ok, %ToolResult{is_error: false, content: result}}
. - If the tool raises, returns
{:ok, %ToolResult{is_error: true, content: %{error: ...}}}
. - If the tool is not found, returns
{:ok, %ToolResult{is_error: true, content: %{error: ...}}}
.