An evaluation answer rating the state along ordered, described levels.
The levels constraint is an ordered list of at least two level descriptions.
Each level should describe a concrete situation and stand on its own. Levels
can instead be supplied per question through the questions option of
AshAi.Actions.Evaluate.
Fields
value- the probability-weighted position across the levels; may fall between two levelslevel- the description of the level nearest tovalueprobabilities- each level index mapped to its probabilityconfidence- how concentrated the distribution is, from 0 to 1
Example
action :frustration, AshAi.Evaluate.Score do
description "How frustrated is the customer in `ticket`?"
constraints levels: ["Calm", "Frustrated but civil", "Very angry"]
argument :ticket, :string, allow_nil?: false
run evaluate("typesafe:jev-latest")
end
Summary
Types
@type t() :: %AshAi.Evaluate.Score{ confidence: float(), level: String.t(), probabilities: %{required(non_neg_integer()) => float()}, value: float() }