StreamContentChunk
Defined in: packages/ai.matey.types/src/ir.ts:876
Content chunk with flexible streaming support.
Supports both delta (incremental) and accumulated (full text) streaming modes:
Delta Mode (default):
deltacontains only the new text generated in this chunk- Consumers must accumulate deltas to get full text
- Most efficient for network and memory
Accumulated Mode (optional):
accumulatedcontains all text generated so far- Each chunk has the complete text up to that point
- Useful for UIs that want to replace text (Chrome AI style)
Backward Compatibility:
deltais ALWAYS present (universal standard)accumulatedis optional (provided when backend configured for it)
Example
Section titled “Example”// Delta-only chunk (standard){ type: 'content', delta: ' world', sequence: 2 }
// With both formats (configured backend){ type: 'content', delta: ' world', accumulated: 'Hello world', sequence: 2 }Extends
Section titled “Extends”Properties
Section titled “Properties”accumulated?
Section titled “accumulated?”
readonlyoptionalaccumulated:string
Defined in: packages/ai.matey.types/src/ir.ts:891
Accumulated text (full content so far). Optional - provided when backend is configured for accumulated mode. Contains all text generated from the start up to and including this chunk.
readonlydelta:string
Defined in: packages/ai.matey.types/src/ir.ts:884
Incremental text delta (new content only). ALWAYS present for maximum compatibility. Contains only the text generated in this chunk.
readonlyoptionalrole:"assistant"
Defined in: packages/ai.matey.types/src/ir.ts:893
sequence
Section titled “sequence”
readonlysequence:number
Defined in: packages/ai.matey.types/src/ir.ts:837
Inherited from
Section titled “Inherited from”
readonlytype:"content"
Defined in: packages/ai.matey.types/src/ir.ts:877