Package akka.javasdk.testkit.eval
Class Gate
Object
akka.javasdk.testkit.eval.Gate
What a batch run must satisfy, checked over all attempts. An attempt is one case in one run, so
with
Experiment.repeat(int) every gate counts each case once per run.
A real model is not deterministic, so a batch asserts on rates rather than on every case. With a mocked model leave the gate out: without one every case must pass.
An attempt passes only when every result passed. An attempt with an inconclusive result, or
with no result, is inconclusive. It never passes: it fails allCasesShouldPass() and counts
against the rate of passRateShouldBeAtLeast(double).
-
Method Summary
Modifier and TypeMethodDescriptionstatic GateEvery case must pass in every run, with every result passed.Both must hold.static GatepassRateShouldBeAtLeast(double minimumRate) The share of attempts that passed must be at leastminimumRate.static GatepassRateShouldBeAtLeast(Class<? extends Evaluator> evaluator, double minimumRate) The pass rate of one evaluator, over the attempts where it was conclusive, must be at leastminimumRate.static GateNo attempt may fail while its recorded calls are loaded or in the agent call.
-
Method Details
-
allCasesShouldPass
Every case must pass in every run, with every result passed. An inconclusive attempt fails the gate. The gate that applies when none is given. -
passRateShouldBeAtLeast
The share of attempts that passed must be at leastminimumRate. An inconclusive attempt counts against the rate. -
passRateShouldBeAtLeast
public static Gate passRateShouldBeAtLeast(Class<? extends Evaluator> evaluator, double minimumRate) The pass rate of one evaluator, over the attempts where it was conclusive, must be at leastminimumRate. Fails when the evaluator judged no attempt.- Parameters:
evaluator- the evaluator's class. The built-ins are nested inEvaluators, for exampleEvaluators.ToolArgument.class- Throws:
IllegalArgumentException- when the class does not carry a validEvalLabel
-
targetShouldNotFail
No attempt may fail while its recorded calls are loaded or in the agent call. -
and
Both must hold.
-