# `AshAi.Evaluate.Judgments`
[🔗](https://github.com/ash-project/ash_ai/blob/v1.1.0/lib/ash_ai/evaluate/judgments.ex#L5)

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 `:atom` with `one_of`, becomes `AshAi.Evaluate.Choice`
- `:boolean` becomes `AshAi.Evaluate.Noul`
- an answer type such as `AshAi.Evaluate.Score` is 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")
    end

The 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", ...}
    }

# `handle_change?`

# `prepare_change?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
