Behaviour and configuration helpers for execution mode dispatch.
Summary
Functions
Validates and normalizes the configured execution mode.
Resolves the configured callback executor module.
Returns the raw configured execution mode, defaulting to :native.
Returns the execution mode label used by the web interface.
Types
@type input() :: %{ kind: :run | :suite, prompt_version: prompt_version_input(), variables: map(), messages: [map()], documents: [document_input()], provider: provider_input() | nil, metadata: map() | nil }
@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 }
Callbacks
Functions
@spec configured_execution_mode() :: {:ok, :native | :callback} | {:error, {:invalid_execution_mode, term()}}
Validates and normalizes the configured execution mode.
An unset value selects native execution. Any value other than :native or
:callback returns an :invalid_execution_mode error.
Resolves the configured callback executor module.
The module must be loaded and export run/1. Missing and invalid
configuration return tagged errors instead of raising.
@spec execution_mode() :: term()
Returns the raw configured execution mode, defaulting to :native.
Use configured_execution_mode/0 when validating configuration at a runtime
boundary.
@spec execution_mode_label() :: String.t()
Returns the execution mode label used by the web interface.