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.
Summary
Functions
Applies every change or returns an error without yielding a partial program.
Applies changes and also returns the committed parameter snapshot.
Atomically replaces the complete optimizer-visible JSON state.
Atomically replaces complete optimizer-visible state or raises.
Returns every described, typed component exposed by a program.
Returns only the minimal digest-guarded changes from source to target.
Returns the textual instruction components consumed by GEPA.
Returns the typed parameters in the current snapshot.
Returns named persistent playbook parameters exposed by a program.
Functionally replaces one predictor's keyword config lens.
Replaces one named persistent playbook parameter.
Replaces a non-reserved ReAct or ReActV2 tool description.
Replaces a non-reserved ReAct or ReActV2 tool JSON schema.
Returns a revisioned, data-only snapshot of every exposed parameter.
Functionally updates one named persistent playbook parameter.
Returns the complete optimizer-visible state as a stable JSON map.
Types
Functions
Applies every change or returns an error without yielding a partial program.
@spec apply_changes_with_snapshot(struct(), [struct() | map()]) :: {:ok, struct(), struct()} | {:error, term()}
Applies changes and also returns the committed parameter snapshot.
Atomically replaces the complete optimizer-visible JSON state.
Atomically replaces complete optimizer-visible state or raises.
@spec components(struct()) :: [Imp.Optimizer.Component.t()]
Returns every described, typed component exposed by a program.
Returns only the minimal digest-guarded changes from source to target.
@spec instruction_components(struct()) :: [ %{name: name(), component: Imp.Optimizer.Component.t()} ]
Returns the textual instruction components consumed by GEPA.
Returns the typed parameters in the current snapshot.
@spec playbooks(struct()) :: [playbook_entry()]
Returns named persistent playbook parameters exposed by a program.
Functionally replaces one predictor's keyword config lens.
@spec put_playbook(struct(), name(), Imp.Playbook.t()) :: struct()
Replaces one named persistent playbook parameter.
@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.
@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.
Returns a revisioned, data-only snapshot of every exposed parameter.
@spec update_playbook(struct(), name(), (Imp.Playbook.t() -> Imp.Playbook.t())) :: struct()
Functionally updates one named persistent playbook parameter.
@spec values(struct()) :: %{ required(String.t()) => Imp.Optimizer.Parameter.json_value() }
Returns the complete optimizer-visible state as a stable JSON map.