Documentation
Framework
Version
Class References
Function References
Interface References
Type Alias References
Variable References

ChunkStrategy

Interface: ChunkStrategy

Defined in: stream/types.ts:43

Strategy for determining when to emit text updates

Properties

reset()?

ts
optional reset: () => void;
optional reset: () => void;

Defined in: stream/types.ts:55

Optional: Reset strategy state (called when streaming starts)

Returns

void


shouldEmit()

ts
shouldEmit: (chunk, accumulated) => boolean;
shouldEmit: (chunk, accumulated) => boolean;

Defined in: stream/types.ts:50

Called for each text chunk received

Parameters

chunk

string

The new chunk of text (delta)

accumulated

string

All text accumulated so far

Returns

boolean

true if an update should be emitted now