GEPA.Adapters.Basic (GEPA v0.3.0)

Copy Markdown View Source

Basic adapter for simple Q&A tasks.

Evaluates candidates by checking if the expected answer appears in the generated response. Suitable for testing and simple optimization tasks.

Note: This is a simplified adapter for testing. For production use, implement the GEPA.Adapter behavior directly.

Summary

Functions

Evaluate a batch of examples with the candidate program.

Build reflective dataset from evaluation results.

Create a new basic adapter.

Types

t()

@type t() :: %GEPA.Adapters.Basic{
  failure_score: float(),
  llm_client: module() | struct()
}

Functions

evaluate(adapter, batch, candidate, capture_traces)

Evaluate a batch of examples with the candidate program.

make_reflective_dataset(basic, candidate, eval_batch, components_to_update)

@spec make_reflective_dataset(
  t(),
  GEPA.Adapter.candidate(),
  GEPA.EvaluationBatch.t(),
  [String.t()]
) :: {:ok, GEPA.Adapter.reflective_dataset()}

Build reflective dataset from evaluation results.

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new basic adapter.

Options

  • :llm_client - Module implementing generate/1 (default: GEPA.LLM.Mock)
  • :failure_score - Score for failed evaluations (default: 0.0)