# `GEPA.Adapter.Dispatch`
[🔗](https://github.com/nshkrdotcom/gepa_ex/blob/v0.3.0/lib/gepa/adapter/dispatch.ex#L1)

Adapter dispatch helpers used by the Elixir GEPA engine.

Python GEPA exposes one `GEPAAdapter` protocol. This Elixir port keeps a
lightweight behaviour/duck-typing boundary, but centralizes all dispatch so
the engine receives normalized `EvaluationBatch` values and consistent error
tuples.

# `adapter`

```elixir
@type adapter() :: module() | struct() | map()
```

# `candidate`

```elixir
@type candidate() :: %{required(String.t()) =&gt; String.t()}
```

# `evaluate`

```elixir
@spec evaluate(adapter(), [term()], candidate(), boolean()) ::
  {:ok, GEPA.EvaluationBatch.t()} | {:error, term()}
```

Evaluate a candidate through the configured adapter.

# `get_adapter_state`

```elixir
@spec get_adapter_state(adapter()) :: map()
```

Read opaque adapter state for checkpointing.

# `has_propose_new_texts?`

```elixir
@spec has_propose_new_texts?(adapter()) :: boolean()
```

Whether an adapter provides its own official-style proposal hook.

# `make_reflective_dataset`

```elixir
@spec make_reflective_dataset(adapter(), candidate(), GEPA.EvaluationBatch.t(), [
  String.t()
]) ::
  {:ok, map()} | {:error, term()}
```

Build a reflective dataset through the adapter.

# `module_for`

```elixir
@spec module_for(adapter()) :: module() | nil
```

Return the module that should receive adapter callbacks, when any.

# `propose_new_texts`

```elixir
@spec propose_new_texts(adapter(), candidate(), map(), [String.t()]) ::
  {:ok, map(), map(), map()} | {:error, term()} | :missing
```

Ask an adapter to propose replacement text, when it owns custom proposal logic.

# `set_adapter_state`

```elixir
@spec set_adapter_state(adapter(), map()) :: :ok | {:ok, term()} | term()
```

Restore opaque adapter state after loading a checkpoint.

---

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