LlmCore.Agent.ToolDispatch.Event (llm_core v0.3.0)

Copy Markdown View Source

Event struct flowing through the ToolDispatch pipeline.

Created by DispatchTools when it detects a tool call with a registered dispatch recipe. Carries all context needed for dispatch orchestration.

Fields

Input — set by DispatchTools before pipeline entry

  • call — The original %Call{} that triggered dispatch
  • resolve_fn — Function to execute individual tool calls
  • recipe — Recipe function or nil for passthrough

Pipeline state — populated by stages

  • strategy:passthrough or :recipe
  • plan — Execution plan from recipe evaluation
  • serial_results — Results from serial step execution
  • serial_context — Accumulated context from serial results
  • current_step — Current parallel step being executed
  • total_parallel — Total number of parallel steps expected
  • step_result — Result of the current parallel step
  • parallel_results — Collected parallel step results
  • errors — Accumulated errors from any failed steps

Output — read by DispatchTools after pipeline exit

  • result — Final composed string result
  • status:ok or :error
  • error — Error detail when status == :error

Summary

Types

t()

@type t() :: %LlmCore.Agent.ToolDispatch.Event{
  call: LlmToolkit.Tool.Call.t() | nil,
  current_step: map() | nil,
  error: term() | nil,
  errors: [map()],
  parallel_results: [map()],
  plan: map() | nil,
  recipe: (map() -> map()) | nil,
  resolve_fn:
    (LlmToolkit.Tool.Call.t() -> {:ok, String.t()} | {:error, String.t()}) | nil,
  result: String.t() | nil,
  serial_context: map(),
  serial_results: [map()],
  status: :ok | :error,
  step_result: map() | nil,
  strategy: :passthrough | :recipe,
  total_parallel: non_neg_integer()
}