Shared execution boundary for native provider calls and host-app callbacks.
Summary
Functions
Executes one provider request through the configured execution mode.
Executes a provider request while retaining diagnostic artifacts on failure.
Types
@type request() :: %{ optional(:documents) => [Aludel.Evals.TestCaseDocument.t()], optional(:messages) => [map()], optional(:metadata) => map(), kind: :run | :suite, prompt_version: Aludel.Prompts.PromptVersion.t(), variables: map(), provider: Aludel.Providers.Provider.t() }
@type result() :: %{ output: String.t(), input_tokens: non_neg_integer() | nil, output_tokens: non_neg_integer() | nil, latency_ms: non_neg_integer() | nil, cost_usd: float() | nil, metadata: map() | nil, artifacts: map() }
Functions
Executes one provider request through the configured execution mode.
Native mode renders the prompt and calls the configured provider. Callback
mode sends a sanitized input map to the host application's executor. Expected
failures return {:error, reason}.
Executes a provider request while retaining diagnostic artifacts on failure.
Documents are loaded concurrently before dispatch. Validation, storage,
configuration, provider, and callback failures return
{:error, reason, artifacts} so callers can persist the attempted input and
failure context.