CompletionChunk Type
One incremental piece of a streamed completion. A provider that supports streaming emits a sequence of these as the model generates: non-terminal chunks carry a text `Delta`, and the terminal chunk reports how generation finished plus token usage when the backend provides it.
Record fields
| Record Field |
Description
|
Full Usage:
Delta
Field type: string
|
Text produced since the previous chunk ("" for a terminal/usage-only chunk).
|
Full Usage:
FinishReason
Field type: string option
|
Why generation stopped; set only on the terminal chunk (e.g. "stop", "length").
|
Full Usage:
TokensUsed
Field type: int option
|
Total tokens used; set only on the terminal chunk when the provider reports it.
|
Nao