Documentation
    Preparing search index...

    Function createLlmStreamAccumulator

    • Create the stream accumulator for one provider dialect.

      Parameters

      Returns LlmStreamAccumulator

      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();