Skip to content

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

IRChatStream

Source IR stream

StreamConversionOptions = {}

Conversion options

IRChatStream

Converted IR stream

// Convert to accumulated mode
const accumulated = convertStreamMode(deltaStream, { mode: 'accumulated' });
// Convert to delta mode
const delta = convertStreamMode(accumulatedStream, { mode: 'delta' });