teeStream
teeStream(
stream,count):IRChatStream[]
Defined in: streaming.ts:1076
Split a stream into multiple streams that can be consumed independently. Each returned stream receives all chunks from the source. Alias for splitStream with a simpler interface.
Parameters
Section titled “Parameters”stream
Section titled “stream”The source stream
number = 2
Number of streams to create
Returns
Section titled “Returns”Example
Section titled “Example”const [stream1, stream2] = teeStream(originalStream, 2);
// Consume independentlyconst [result1, result2] = await Promise.all([ collectStreamFull(stream1), processStream(stream2, { onContent: console.log }),]);