# `Dsxir.Predictor`

Predictor behaviour. A predictor is a stateless module that turns inputs into
a `%Dsxir.Prediction{}` by routing through an adapter and the active LM.

## Augmented outputs

Some predictors synthesize extra output fields at runtime that are not
declared on the underlying signature module (e.g. `:reasoning` from
`Dsxir.Predictor.ChainOfThought`, `:trajectory` from
`Dsxir.Predictor.ReAct`). Impls report these via the optional
`c:augmented_outputs/1` callback so that `Dsxir.Artifact` allows them
through the demo field validation on save/load. The callback is
optional; impls that do not augment their signature can omit it.

# `signature`

```elixir
@type signature() :: module() | Dsxir.Signature.Compiled.t()
```

# `augmented_outputs`
*optional* 

```elixir
@callback augmented_outputs(signature()) :: [atom()]
```

Output field names synthesized by the predictor at runtime, in addition
to the declared outputs of `signature`. Optional. Defaults to `[]` for
impls that do not implement it.

# `forward`

```elixir
@callback forward(
  state :: Dsxir.Program.State.t(),
  signature :: signature(),
  inputs :: map(),
  opts :: keyword()
) :: {Dsxir.Program.State.t(), Dsxir.Prediction.t()}
```

# `augmented_outputs`

```elixir
@spec augmented_outputs(module(), signature()) :: [atom()]
```

Resolve the augmented output names for `impl` against `signature`, or
return `[]` when the impl does not implement `c:augmented_outputs/1`.

---

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