# `LlamaCppEx.ChatCompletionChunk`
[🔗](https://github.com/nyo16/llama_cpp_ex/blob/main/lib/llama_cpp_ex/chat_completion_chunk.ex#L1)

OpenAI-compatible streaming chat completion chunk struct.

Mirrors the shape of server-sent events from `POST /v1/chat/completions` with `stream: true`.

# `chunk_choice`

```elixir
@type chunk_choice() :: %{
  index: integer(),
  delta: %{
    optional(:role) =&gt; String.t(),
    optional(:content) =&gt; String.t(),
    optional(:reasoning_content) =&gt; String.t()
  },
  finish_reason: String.t() | nil
}
```

# `t`

```elixir
@type t() :: %LlamaCppEx.ChatCompletionChunk{
  choices: [chunk_choice()],
  created: integer(),
  id: String.t(),
  model: String.t(),
  object: String.t()
}
```

---

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