# `LlmCall.Operation`
[🔗](https://github.com/gilbertwong96/llm_call/blob/main/lib/llm_call/operation.ex#L1)

A long-running media generation job.

`next` is the encoded request the caller's transport executes next, built by the
codec so the transport needs no knowledge of the protocol's job URL.

- `next_kind: :poll` decodes the response body with
  `LlmCall.decode_operation/3`.
- `next_kind: :asset` means the response body is media bytes; the core never
  touches them and the caller stores them using `next_media_type`.

`status: :completed` is never paired with `next_kind: :poll`: a codec that knows
the asset needs another request says so in the same result.

The core never polls, waits, retries, or downloads.

# `status`

```elixir
@type status() :: :queued | :in_progress | :completed | :failed
```

# `t`

```elixir
@type t() :: %LlmCall.Operation{
  error: LlmCall.Error.t() | nil,
  id: String.t() | nil,
  next: LlmCall.EncodedRequest.t() | nil,
  next_kind: :poll | :asset | nil,
  next_media_type: String.t() | nil,
  progress: 0..100 | nil,
  raw: map() | nil,
  result: LlmCall.Media.Response.t() | nil,
  status: status()
}
```

---

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