A map of evaluation answers, one per field, asked together in a single request.
Declare the collapsed type you care about for each field and it is expanded into the matching answer type at compile time, so the result keeps probabilities and confidence for every judgment:
- an
Ash.Type.Enum, or:atomwithone_of, becomesAshAi.Evaluate.Choice :booleanbecomesAshAi.Evaluate.Noul- an answer type such as
AshAi.Evaluate.Scoreis kept as is
Each field's description is the question's instructions.
Example
action :triage, AshAi.Evaluate.Judgments do
argument :ticket, :string, allow_nil?: false
constraints fields: [
department: [type: MyApp.Department, description: "Which team should handle `ticket`?"],
urgent: [type: :boolean, description: "Does `ticket` convey urgency?"],
frustration: [
type: AshAi.Evaluate.Score,
constraints: [levels: ["Calm", "Frustrated but civil", "Very angry"]],
description: "How frustrated is the customer in `ticket`?"
]
]
run evaluate("typesafe:jev-latest")
endThe result is a map of answer structs:
%{
department: %AshAi.Evaluate.Choice{value: :technical, confidence: 0.82, probabilities: %{...}},
urgent: %AshAi.Evaluate.Noul{probability: 0.92},
frustration: %AshAi.Evaluate.Score{value: 1.6, level: "Frustrated but civil", ...}
}