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

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 levels
- `level` - the description of the level nearest to `value`
- `probabilities` - each level index mapped to its probability
- `confidence` - 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

# `t`

```elixir
@type t() :: %AshAi.Evaluate.Score{
  confidence: float(),
  level: String.t(),
  probabilities: %{required(non_neg_integer()) =&gt; float()},
  value: float()
}
```

# `handle_change?`

# `prepare_change?`

---

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