An evaluation answer selecting one option from a defined set.
The options come from one of two places:
- the
ofconstraint: anAsh.Type.Enum, or:atomwith aone_ofconstraint.valueis cast to that type and enum value descriptions become the criteria sent to the model. - criteria supplied per question through the
questionsoption ofAshAi.Actions.Evaluate. Withoutof,valueis a string. Withof, the runtime criteria must be a subset of its options, which is how options can depend on earlier answers (for example, the children of a taxonomy node).
Fields
value- the selected optionprobabilities- every option mapped to its probabilityconfidence- how concentrated the distribution is, from 0 to 1
Example
action :department, AshAi.Evaluate.Choice do
description "Which team should handle `ticket`?"
constraints of: MyApp.Department
argument :ticket, :string, allow_nil?: false
run evaluate("typesafe:jev-latest")
end