# `Imp.ProgramParameters`
[🔗](https://github.com/deepfates/imp/blob/v0.18.1/lib/imp/program_parameters.ex#L1)

Named optimizer lenses and typed parameter snapshots for Imp programs.

`predictors/1` is the canonical lens used by instruction and demonstration
optimizers. `snapshot/1`, `diff/2`, and `apply_changes/2` provide a bounded
data-only contract: IDs are stable strings,
values are JSON data, each change carries a content digest guard, and a
multi-change update is committed atomically.

Built-in predictors expose instruction, demos, and config parameters.
Programs with persistent playbooks expose their serialized playbook. ReAct
and ReActV2 also expose non-reserved tool descriptions and schemas; those
lenses never serialize or replace a tool runner, the reserved `submit` tool,
or a tool policy.

# `entry`

```elixir
@type entry() :: %{name: name(), predictor: struct()}
```

# `name`

```elixir
@type name() :: atom() | String.t()
```

# `playbook_entry`

```elixir
@type playbook_entry() :: %{name: name(), playbook: Imp.Playbook.t()}
```

# `apply_changes`

```elixir
@spec apply_changes(struct(), [struct() | map()]) ::
  {:ok, struct()} | {:error, term()}
```

Applies every change or returns an error without yielding a partial program.

# `apply_changes_with_snapshot`

```elixir
@spec apply_changes_with_snapshot(struct(), [struct() | map()]) ::
  {:ok, struct(), struct()} | {:error, term()}
```

Applies changes and also returns the committed parameter snapshot.

# `apply_values`

```elixir
@spec apply_values(struct(), map()) :: {:ok, struct()} | {:error, term()}
```

Atomically replaces the complete optimizer-visible JSON state.

# `apply_values!`

```elixir
@spec apply_values!(struct(), map()) :: struct()
```

Atomically replaces complete optimizer-visible state or raises.

# `components`

```elixir
@spec components(struct()) :: [Imp.Optimizer.Component.t()]
```

Returns every described, typed component exposed by a program.

# `diff`

```elixir
@spec diff(struct(), struct()) :: [struct()]
```

Returns only the minimal digest-guarded changes from `source` to `target`.

# `instruction_components`

```elixir
@spec instruction_components(struct()) :: [
  %{name: name(), component: Imp.Optimizer.Component.t()}
]
```

Returns the textual instruction components consumed by GEPA.

# `parameters`

```elixir
@spec parameters(struct()) :: [struct()]
```

Returns the typed parameters in the current snapshot.

# `playbooks`

```elixir
@spec playbooks(struct()) :: [playbook_entry()]
```

Returns named persistent playbook parameters exposed by a program.

# `predictors`

```elixir
@spec predictors(struct()) :: [entry()]
```

# `put_config`

```elixir
@spec put_config(struct(), name(), keyword()) :: struct()
```

Functionally replaces one predictor's keyword config lens.

# `put_demos`

```elixir
@spec put_demos(struct(), name(), [term()]) :: struct()
```

# `put_instruction`

```elixir
@spec put_instruction(struct(), name(), String.t()) :: struct()
```

# `put_playbook`

```elixir
@spec put_playbook(struct(), name(), Imp.Playbook.t()) :: struct()
```

Replaces one named persistent playbook parameter.

# `put_tool_description`

```elixir
@spec put_tool_description(
  Imp.Predict.ReAct.t() | Imp.Predict.ReActV2.t(),
  name(),
  String.t()
) ::
  Imp.Predict.ReAct.t() | Imp.Predict.ReActV2.t()
```

Replaces a non-reserved ReAct or ReActV2 tool description.

# `put_tool_schema`

```elixir
@spec put_tool_schema(Imp.Predict.ReAct.t() | Imp.Predict.ReActV2.t(), name(), map()) ::
  Imp.Predict.ReAct.t() | Imp.Predict.ReActV2.t()
```

Replaces a non-reserved ReAct or ReActV2 tool JSON schema.

# `snapshot`

```elixir
@spec snapshot(struct()) :: struct()
```

Returns a revisioned, data-only snapshot of every exposed parameter.

# `update_playbook`

```elixir
@spec update_playbook(struct(), name(), (Imp.Playbook.t() -&gt; Imp.Playbook.t())) ::
  struct()
```

Functionally updates one named persistent playbook parameter.

# `update_predictor`

```elixir
@spec update_predictor(struct(), name(), (struct() -&gt; struct())) :: struct()
```

# `values`

```elixir
@spec values(struct()) :: %{
  required(String.t()) =&gt; Imp.Optimizer.Parameter.json_value()
}
```

Returns the complete optimizer-visible state as a stable JSON map.

---

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