class ChatCompletionStream
implements AsyncIterable<ChatCompletionChunk>
extends AbstractChatCompletionRunner<ChatCompletionStreamEvents>
import { ChatCompletionStream } from "https://deno.land/x/openai@v4.27.1/lib/ChatCompletionStream.ts";
Methods
protected
_createChatCompletion(completions: Completions,
params: ChatCompletionCreateParams,
options?: Core.RequestOptions,
protected
_fromReadableStream(readableStream: ReadableStream, options?: Core.RequestOptions): Promise<ChatCompletion>[Symbol.asyncIterator](): AsyncIterator<ChatCompletionChunk>
Static Methods
createChatCompletion(): ChatCompletionStream
completions: Completions,
params: ChatCompletionStreamParams,
options?: Core.RequestOptions,
fromReadableStream(stream: ReadableStream): ChatCompletionStream
Intended for use on the frontend, consuming a stream produced with
.toReadableStream()
on the backend.
Note that messages sent to the model do not appear in .on('message')
in this context.