# `Nous.DecisionModel.Result`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/nous/decision_model/result.ex#L1)

The result of `Nous.DecisionModel.decide/4`.

## Fields

  * `:answers` - `[{question_id, Nous.DecisionModel.Answer.t()}]`, in the
    order the questions were given, keyed by the ids exactly as declared.
  * `:usage` - `%{input_tokens: integer | nil, output_tokens: integer | nil}`
    as the backend reports it.
  * `:backend` - the `Nous.DecisionModel.Backend` module that answered.
  * `:model` - the model reference of the `Nous.DecisionModel`.

# `t`

```elixir
@type t() :: %Nous.DecisionModel.Result{
  answers: [{Nous.DecisionModel.Question.id(), Nous.DecisionModel.Answer.t()}],
  backend: module() | nil,
  model: String.t() | nil,
  usage: usage()
}
```

# `usage`

```elixir
@type usage() :: %{
  input_tokens: non_neg_integer() | nil,
  output_tokens: non_neg_integer() | nil
}
```

# `fetch`

```elixir
@spec fetch(t(), Nous.DecisionModel.Question.id()) ::
  {:ok, Nous.DecisionModel.Answer.t()} | :error
```

Fetches the answer for `id`, compared exactly as declared (`:a` is not `"a"`).

---

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