Skip to content

LLMStreamChunk

Discriminated union for streaming chunks from tool-aware generation.

type LLMStreamChunk = 
  | {
  text: string;
  type: "text";
}
  | {
  toolCall: {
     id: string;
     name: string;
  };
  type: "tool_call_start";
}
  | {
  argumentsDelta: string;
  toolCallId: string;
  type: "tool_call_delta";
}
  | {
  toolCallId: string;
  type: "tool_call_end";
}
  | {
  stopReason: "end_turn" | "tool_use" | "stop_sequence" | "max_tokens";
  type: "done";
};

Defined in: src/core/types/providers.ts:910

Discriminated union for streaming chunks from tool-aware generation.

Remarks

text chunks go to TTS; tool_call_* chunks go to the tool executor. The done chunk signals the end of the response with a stop reason.

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency