# `Omni.Answer.Choice`
[🔗](https://github.com/aaronrussell/omni/blob/v2.0.0/lib/omni/answer/choice.ex#L1)

The answer to an `Omni.Question.Choice`.

```elixir
%Omni.Answer.Choice{
  choice: :infra,
  probabilities: [billing: 0.02, infra: 0.95, other: 0.03],
  confidence: 0.93
}
```

## Struct fields

- `:choice` - the most likely choice, by the question's key
- `:probabilities` - `{key, probability}` for every choice, in the
  question's order and with its keys
- `:confidence` - the provider's confidence in the choice, or `nil` when
  it gives none. Hosts compute it differently, so compare it only within
  one provider; the probabilities are the portable result

# `t`

```elixir
@type t() :: %Omni.Answer.Choice{
  choice: Omni.Question.key(),
  confidence: float() | nil,
  probabilities: [{Omni.Question.key(), float()}]
}
```

The answer to a choice question.

# `new`

```elixir
@spec new(Enumerable.t()) :: t()
```

Creates a choice answer from a keyword list or map of fields.

---

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