Called after each interactive episode converges within a conversation. Returns whether the conversation should continue, resolve, or abandon.
The goal's completion_criteria.mode picks the evaluator:
- absent, or
"strategy_decides"(the default) — the strategy/model signals resolution itself (Cyclium.Intent.GoalEvaluator.StrategyDecides); "required_fields"— resolved once the listed fields are collected (Cyclium.Intent.GoalEvaluator.RequiredFields);"evaluator_callback"— the module the expectation declares withgoal_evaluator: MyApp.Evaluatorin the Actor DSL (registered at boot).
Nothing has to be configured for the default. A custom evaluator is declared
on the expectation, in code; a module name inside the goal JSON is never
resolved. When the goal asks for a callback and the expectation declares
none, the conversation stays open (:continue) and a warning is logged.
Summary
Functions
The evaluator module an expectation declared (goal_evaluator: in the Actor
DSL), or nil. Looks up the exact {actor, expectation} pair first, then any
expectation of the actor (a conversation may not record its expectation).
Dispatches to the evaluator the goal's completion_criteria selects.
Callbacks
@callback evaluate( goal :: Cyclium.Intent.GoalSpec.t(), conversation_state :: map(), latest_result :: Cyclium.ConvergeResult.t() ) :: :continue | {:resolved, outcome :: binary(), result :: map()} | {:abandoned, reason :: binary()}
Functions
The evaluator module an expectation declared (goal_evaluator: in the Actor
DSL), or nil. Looks up the exact {actor, expectation} pair first, then any
expectation of the actor (a conversation may not record its expectation).
@spec evaluate( Cyclium.Intent.GoalSpec.t(), map(), Cyclium.ConvergeResult.t(), keyword() ) :: :continue | {:resolved, binary(), map()} | {:abandoned, binary()}
Dispatches to the evaluator the goal's completion_criteria selects.
opts[:evaluator] is the module the expectation declared (see
declared_for/2); it is used for evaluator_callback goals and for goals
with no mode at all.