# `Aludel.Executor`
[🔗](https://github.com/ccarvalho-eng/aludel/blob/main/lib/aludel/executor.ex#L1)

Behaviour and configuration helpers for execution mode dispatch.

# `document_input`

```elixir
@type document_input() :: %{
  name: String.t(),
  content_type: String.t(),
  data: binary()
}
```

# `input`

```elixir
@type input() :: %{
  kind: :run | :suite,
  prompt_version: prompt_version_input(),
  variables: map(),
  messages: [map()],
  documents: [document_input()],
  provider: provider_input() | nil,
  metadata: map() | nil
}
```

# `prompt_version_input`

```elixir
@type prompt_version_input() :: %{
  id: binary(),
  template: String.t(),
  version: integer()
}
```

# `provider_input`

```elixir
@type provider_input() :: %{
  id: binary(),
  provider: atom(),
  model: String.t(),
  config: map() | nil
}
```

# `result`

```elixir
@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
}
```

# `run`

```elixir
@callback run(input()) :: {:ok, result()} | {:error, term()}
```

# `configured_execution_mode`

```elixir
@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.

# `configured_executor`

```elixir
@spec configured_executor() ::
  {:ok, module()} | {:error, :executor_not_configured | term()}
```

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.

# `execution_mode`

```elixir
@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.

# `execution_mode_label`

```elixir
@spec execution_mode_label() :: String.t()
```

Returns the execution mode label used by the web interface.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
