import { Stream } from "https://deno.land/x/openai@v4.38.3/streaming.ts";
Constructors
new
Stream(iterator: () => AsyncIterator<Item>, controller: AbortController)Properties
controller: AbortController
Methods
Splits the stream into two streams which can be independently read from at different speeds.
Converts this stream to a newline-separated ReadableStream of
JSON stringified values in the stream
which can be turned back into a Stream with Stream.fromReadableStream()
.
[Symbol.asyncIterator](): AsyncIterator<Item>
Static Methods
fromReadableStream<Item>(readableStream: ReadableStream, controller: AbortController)
Generates a Stream from a newline-separated ReadableStream where each item is a JSON value.
fromSSEResponse<Item>(response: Response, controller: AbortController)