convertStreamMode
convertStreamMode(
stream,options):IRChatStream
Defined in: streaming-modes.ts:145
Convert IR stream to target streaming mode.
This function transforms an IR stream to use the specified streaming mode:
- Delta mode: Only incremental deltas
- Accumulated mode: Full text in each chunk
Parameters
Section titled “Parameters”stream
Section titled “stream”Source IR stream
options
Section titled “options”Conversion options
Returns
Section titled “Returns”Converted IR stream
Example
Section titled “Example”// Convert to accumulated modeconst accumulated = convertStreamMode(deltaStream, { mode: 'accumulated' });
// Convert to delta modeconst delta = convertStreamMode(accumulatedStream, { mode: 'delta' });