Skip to content
providerkit
GitHub

ProviderChunk

Defined in: core/src/types.ts:242

Normalized streaming chunk. Every provider’s shape maps to this.

optional citations?: Citation[];

Defined in: core/src/types.ts:259

Citations, appended in order. Their spans index the turn’s content.


optional content?: string;

Defined in: core/src/types.ts:247


optional finishReason?: FinishReason;

Defined in: core/src/types.ts:263


optional hosted?: HostedCallDelta[];

Defined in: core/src/types.ts:257

Hosted call fragments, assembled by index. One commits the stream: past it, a retry would rerun and rebill the vendor’s tool.


optional hostedItems?: HostedItems;

Defined in: core/src/types.ts:261

Once per turn, where a provider replays its hosted tools. See ChatMessage.hostedItems.


optional reasoning?: string;

Defined in: core/src/types.ts:248


optional reasoningDetails?: unknown[];

Defined in: core/src/types.ts:251

OpenRouter’s normalized reasoning payload. Hand it back on the next turn’s assistant message verbatim. See ChatMessage.reasoningDetails.


optional reasoningItems?: ReasoningItems;

Defined in: core/src/types.ts:253

Once per turn, where a provider replays its reasoning. See ChatMessage.reasoningItems.


optional source?: object;

Defined in: core/src/types.ts:246

The selected endpoint and model when a fallback provider emits this chunk. Per-call metadata, never shared mutable state on the provider object.

model: string;
provider: string;

optional toolCalls?: ToolCallDelta[];

Defined in: core/src/types.ts:254


type: "delta" | "usage" | "finish";

Defined in: core/src/types.ts:243


optional usage?: TokenUsage;

Defined in: core/src/types.ts:262