Package akka.javasdk.evaluation
Class Evaluator
Object
akka.javasdk.evaluation.Evaluator
An Evaluator is a stateless component that evaluates agent interactions.
An Evaluator is bound to one or more agents through configuration under
akka.javasdk.evaluation.evaluators, keyed by the evaluator's component id. The runtime invokes
evaluate(EvaluationContext) for each interaction of a bound agent, passing an EvaluationContext that identifies the interaction to evaluate. The handler returns an Evaluator.Effect describing the outcome: the recorded evaluation or an inconclusive result. An exception
thrown from the handler records a failed evaluation.
Blocking calls made from evaluate(EvaluationContext) run on virtual threads. For an
evaluation that runs in several steps and must survive restarts, extend DurableEvaluator
instead.
Concrete class must be annotated with Component.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn Effect is a description of what the runtime needs to do after the evaluation is handled. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final Evaluator.Effect.Buildereffects()Returns a builder for theEvaluator.Effectto be returned byevaluate(akka.javasdk.evaluation.EvaluationContext).abstract Evaluator.Effectevaluate(EvaluationContext context) Evaluate the interaction identified by the given context.
-
Constructor Details
-
Evaluator
public Evaluator()
-
-
Method Details
-
evaluate
Evaluate the interaction identified by the given context.- Parameters:
context- identifies the interaction to evaluate- Returns:
- an
Evaluator.Effectdescribing the outcome of the evaluation
-
effects
Returns a builder for theEvaluator.Effectto be returned byevaluate(akka.javasdk.evaluation.EvaluationContext).
-