GEPAReflectionProposer

Proposes improved instructions for GEPA modules by reflecting on execution failures.

For each module to update, the proposer sends the current instruction, failure traces, and expected outputs to a reflection LM, which analyzes the failures and proposes a new instruction.

Types

Link copied to clipboard
data class FailureFeedback(val input: String, val expectedLabel: String, val actualOutput: String, val score: Double, val trajectory: Prompt)

Feedback collected from a single failed execution, fed to the reflection LM.

Functions

Link copied to clipboard
suspend fun proposeCrossover(module: OptimizableModule, instructionA: String, scoreA: Double, instructionB: String, scoreB: Double): String

Proposes a merged instruction from two candidates via crossover.

Link copied to clipboard
suspend fun proposeInstruction(module: OptimizableModule, currentInstruction: String, failures: List<GEPAReflectionProposer.FailureFeedback>): String

Proposes a new instruction for the given module based on failure analysis.