Optimize an arbitrary candidate with a user-supplied evaluator.
This is the Elixir port of upstream optimize_anything: it wraps a normal
evaluator in a GEPA adapter, supports single-task and dataset modes, string
candidates, seed generation, evaluator diagnostics, cache-aware evaluation,
and the regular GEPA optimizer.
Summary
Functions
Build the seed-generation prompt used when seed_candidate is nil.
Return the default refiner prompt template.
Generate an initial seed candidate using an LM.
Return the process-local optimize-anything diagnostic log.
Append a diagnostic message to the process-local optimize-anything log.
Append a formatted diagnostic message to the process-local optimize-anything log.
Build a normalized hosted-provider LM client for optimize-anything helpers.
Optimize any candidate/evaluator pair.
Replace the process-local optimize-anything diagnostic log.
Return the internal key used to wrap string candidates.
Functions
Build the seed-generation prompt used when seed_candidate is nil.
@spec default_refiner_prompt() :: String.t()
Return the default refiner prompt template.
Generate an initial seed candidate using an LM.
@spec get_log_context() :: GEPA.OptimizeAnything.LogContext.Context.t()
Return the process-local optimize-anything diagnostic log.
@spec log(term()) :: :ok
Append a diagnostic message to the process-local optimize-anything log.
Append a formatted diagnostic message to the process-local optimize-anything log.
@spec make_litellm_lm( String.t(), keyword() ) :: GEPA.LLM.Client.t()
Build a normalized hosted-provider LM client for optimize-anything helpers.
@spec optimize_anything(keyword() | map() | GEPA.OptimizeAnything.Config.t()) :: {:ok, GEPA.Result.t()} | {:error, term()}
Optimize any candidate/evaluator pair.
@spec set_log_context(GEPA.OptimizeAnything.LogContext.Context.t()) :: :ok
Replace the process-local optimize-anything diagnostic log.
@spec str_candidate_key() :: String.t()
Return the internal key used to wrap string candidates.