# `Agentic.LLM.Response`

Normalized chat response shape produced by every transport.

## Fields

  * `:content` — list of content blocks. Each block is a map of one of:
      - `%{type: :text, text: String.t()}`
      - `%{type: :tool_use, id: String.t(), name: String.t(), input: map()}`
  * `:stop_reason` — one of `:end_turn | :tool_use | :max_tokens | :error`
  * `:usage` — `%{input_tokens, output_tokens, cache_read, cache_write}`
    (cache fields default to `0`)
  * `:cost` — computed USD cost for this call (set by LLMCall stage)
  * `:model_id` — provider-local model id (when known)
  * `:raw` — the unmodified decoded response body, kept for debugging

Transports translate their wire format into this shape. The host
application and all loop stages consume this struct directly.

# `content_block`

```elixir
@type content_block() ::
  %{type: :text, text: String.t()}
  | %{type: :tool_use, id: String.t(), name: String.t(), input: map()}
```

# `stop_reason`

```elixir
@type stop_reason() :: :end_turn | :tool_use | :max_tokens | :error
```

# `t`

```elixir
@type t() :: %Agentic.LLM.Response{
  content: [content_block()],
  cost: float(),
  model_id: String.t() | nil,
  raw: term(),
  stop_reason: stop_reason(),
  usage: usage()
}
```

# `usage`

```elixir
@type usage() :: %{
  input_tokens: non_neg_integer(),
  output_tokens: non_neg_integer(),
  cache_read: non_neg_integer(),
  cache_write: non_neg_integer()
}
```

---

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