Package akka.javasdk.evaluation
Class Evaluation
Object
akka.javasdk.evaluation.Evaluation
The outcome of an evaluation, recorded by an
Evaluator.
An Evaluation captures whether the evaluated interaction passed, an explanation for
the verdict, and optional quantitative (score) and categorical (label) results.
Arbitrary additional attributes can be attached for downstream analysis.
Create instances with the fluent factory methods and with* builders, for example:
Evaluation.passed("Response was accurate and helpful")
.withScore(0.92)
.withLabel("excellent");
-
Method Summary
Modifier and TypeMethodDescriptionstatic EvaluationCreate an evaluation that failed, with the given explanation.label()static EvaluationCreate an evaluation with the given pass/fail verdict and explanation.booleanpassed()static EvaluationCreate an evaluation that passed, with the given explanation.score()toString()withAttribute(String key, String value) Return a copy of this evaluation with the given attribute added.withAttributes(Map<String, String> attributes) Return a copy of this evaluation with all the given attributes added.Return a copy of this evaluation with the given categorical label.withScore(double score) Return a copy of this evaluation with the given numeric score.
-
Method Details
-
passed
Create an evaluation that passed, with the given explanation. -
failed
Create an evaluation that failed, with the given explanation. -
of
Create an evaluation with the given pass/fail verdict and explanation.- Parameters:
passed- whether the evaluated interaction passedexplanation- the reason for the verdict
-
withScore
Return a copy of this evaluation with the given numeric score. -
withLabel
Return a copy of this evaluation with the given categorical label. -
withAttribute
Return a copy of this evaluation with the given attribute added. -
withAttributes
Return a copy of this evaluation with all the given attributes added. -
passed
public boolean passed()- Returns:
- whether the evaluated interaction passed
-
explanation
- Returns:
- the reason for the verdict
-
score
- Returns:
- the numeric score, if one was set
-
label
- Returns:
- the categorical label, if one was set
-
attributes
- Returns:
- additional attributes attached to this evaluation
-
toString
-