# `Imp.LM.Result`
[🔗](https://github.com/deepfates/imp/blob/v0.18.1/lib/imp/lm/result.ex#L1)

Canonical boundary between LM output and provider metadata.

Most language models return their output value directly. Provider-backed
clients may retain transport metadata in a reserved envelope. This module is
the only place where that envelope is interpreted.

# `metadata`

```elixir
@type metadata() :: map()
```

# `output`

```elixir
@type output() :: binary() | map() | Imp.Prediction.t()
```

# `metadata`

```elixir
@spec metadata(output()) :: {:ok, metadata()} | {:error, term()}
```

# `output`

```elixir
@spec output(output()) :: {:ok, output()} | {:error, term()}
```

# `split`

```elixir
@spec split(output()) :: {:ok, output(), metadata()} | {:error, term()}
```

# `unwrap`

```elixir
@spec unwrap({:ok, output()} | {:error, term()}) :: {:ok, output()} | {:error, term()}
```

---

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