Create the stream accumulator for one provider dialect.
Dialect whose streaming events will be pushed.
Accumulator yielding block events per payload and the final generation.
const stream = createLlmStreamAccumulator('openai-chat');for await (const data of readLlmSseData(response.body!)) if (data !== '[DONE]') for (const event of stream.push(JSON.parse(data))) onDelta(event);const generation = stream.finish(); Copy
const stream = createLlmStreamAccumulator('openai-chat');for await (const data of readLlmSseData(response.body!)) if (data !== '[DONE]') for (const event of stream.push(JSON.parse(data))) onDelta(event);const generation = stream.finish();
Create the stream accumulator for one provider dialect.