langchain.js
    Preparing search index...
    • Converts a ReadableStream into a callback pattern.

      Parameters

      • stream: ReadableStream<Uint8Array<ArrayBufferLike>> | AsyncIterable<any, any, any>

        The input ReadableStream.

      • onChunk: (arr: Uint8Array, flush?: boolean) => void

        A function that will be called on each new byte chunk in the stream.

      Returns Promise<void>

      A promise that will be resolved when the stream closes.