# `Tune.Prediction`
[🔗](https://github.com/mikehostetler/tune/blob/v0.5.0/lib/tune/prediction.ex#L1)

The outcome of one target execution.

A failed execution keeps its partial prediction in
`Tune.Error.Execution.Failed`.

# `failure`

```elixir
@type failure() :: %{name: String.t(), role: atom(), error: term()}
```

# `t`

```elixir
@type t() :: %Tune.Prediction{
  calls: %{optional(atom()) =&gt; non_neg_integer()},
  failures: [failure()],
  metadata: map(),
  output: term(),
  steps: [Tune.Step.t()],
  usage: %{
    input: non_neg_integer(),
    output: non_neg_integer(),
    total: non_neg_integer()
  }
}
```

# `step_usage`

```elixir
@spec step_usage(t()) :: [map() | nil]
```

Returns provider-reported usage for each step, in call order.

# `token_totals`

```elixir
@spec token_totals(t()) :: %{
  input: non_neg_integer(),
  output: non_neg_integer(),
  total: non_neg_integer()
}
```

Sums provider-reported token use across all steps.

# `total_calls`

```elixir
@spec total_calls(t()) :: non_neg_integer()
```

Returns the total attempted managed model calls.

---

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