Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/agent / evaluator-optimizer
evaluator-optimizer
evaluatorOptimizer({...}) — Generator → Evaluator iteration loop with three rubric kinds and a REQUIRED iteration cap.
Iteration boundary discipline: each iteration is a fresh agent.run-equivalent boundary. Intra-loop reasoning per RB-42 / suggested DEC-158 applies WITHIN one iteration, not ACROSS iterations. The Generator's iteration-N input is the original user input + the Evaluator's iteration-(N-1) critique (NOT the Generator's iteration-(N-1) internal message history).
Interfaces
| Interface | Description |
|---|---|
| EvaluatorOptimizerOptions | Options accepted by evaluatorOptimizer. maxIterations is REQUIRED — the helper asserts >= 1 at construction time. |
| EvaluatorOptimizerOutcome | Aggregate outcome of an evaluatorOptimizer({...}) run. |
| EvaluatorOutcome | Per-iteration evaluation outcome returned by the Evaluator. |
Type Aliases
| Type Alias | Description |
|---|---|
| EvaluatorCallable | Evaluator callable shape. Receives the original user input + the candidate output and returns the structured outcome. |
| GeneratorCallable | Generator callable shape. Receives the original user input plus the previous iteration's critique (or undefined on the first iteration) and returns the new candidate output. |
| Rubric | Rubric discriminator. Pick the variant that matches your Evaluator's contract. |
Functions
| Function | Description |
|---|---|
| evaluatorOptimizer | Run the Generator → Evaluator iteration loop. |