Alloy.Tool.Executor (alloy v0.10.1)

Copy Markdown View Source

Executes tool calls and returns result messages.

Supports parallel execution via Task.Supervisor.async_stream - multiple tool calls in a single assistant response are executed concurrently under Alloy.TaskSupervisor.

Summary

Functions

execute_all(tool_calls, tool_fns, state)

@spec execute_all([map()], %{required(String.t()) => module()}, Alloy.Agent.State.t()) ::
  Alloy.Message.t() | {:halted, String.t()}

execute_all(tool_calls, tool_fns, state, opts)

@spec execute_all(
  [map()],
  %{required(String.t()) => module()},
  Alloy.Agent.State.t(),
  keyword()
) ::
  {:ok, Alloy.Message.t(), [map()]} | {:halted, String.t()}