Interface: StreamChunk

Defined in: providers/types.ts:112

Streaming chunk types

Properties

model?

optional model?: string;

Defined in: providers/types.ts:147

Model that generated this response (only present on ‘done’ chunks)

stopReason?

optional stopReason?: string;

Defined in: providers/types.ts:156

Stop reason (only present on ‘done’ chunks).

  • ‘end_turn’: Normal completion
  • ‘max_tokens’: Hit max_tokens limit
  • ‘refusal’: Model refused the request (Claude 4.5+)
  • ‘context_window_exceeded’: Hit context window limit (Claude 4.5+)
  • ‘tool_use’: Model wants to call a tool

text?

optional text?: string;

Defined in: providers/types.ts:122

thinking?

optional thinking?: {
  signature?: string;
  thinking?: string;
};

Defined in: providers/types.ts:136

Thinking block data (for thinking_start/thinking_end)

signature?

optional signature?: string;

thinking?

optional thinking?: string;

toolUse?

optional toolUse?: {
  id: string;
  input?: Record<string, unknown>;
  name: string;
  signature?: string;
};

Defined in: providers/types.ts:123

id

id: string;

input?

optional input?: Record<string, unknown>;

name

name: string;

signature?

optional signature?: string;

Thought signature for Gemini 3 function calls. Only present on first function call in each step.

type

type: 
  | "text"
  | "tool_use_start"
  | "tool_use_delta"
  | "tool_use_end"
  | "thinking_start"
  | "thinking_delta"
  | "thinking_end"
  | "done";

Defined in: providers/types.ts:113

usage?

optional usage?: LLMUsage;

Defined in: providers/types.ts:143

Token usage (only present on ‘done’ chunks)