StreamChunk
A chunk of data from a streaming LLM response. Stream chunks are
discriminated on the kind field.
Class Diagram
Section titled “Class Diagram”---
title: StreamChunk
config:
look: handDrawn
theme: colorful
class:
hideEmptyMembersBox: true
---
classDiagram
class StreamChunk {
<<abstract>>
+string kind
}
class TextChunk {
+string kind
+string value
}
StreamChunk <|-- TextChunk
class ThinkingChunk {
+string kind
+string value
}
StreamChunk <|-- ThinkingChunk
class ToolChunk {
+string kind
+ToolCall toolCall
}
StreamChunk <|-- ToolChunk
class ErrorChunk {
+string kind
+string message
}
StreamChunk <|-- ErrorChunk
Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
| kind | string | The kind of stream chunk |
Child Types
Section titled “Child Types”The following types extend StreamChunk: