Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/openai/lib/ChatCompletionStream.ts>ChatCompletionStream

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
class ChatCompletionStream
import { ChatCompletionStream } from "https://deno.land/x/openai@v4.52.0/lib/ChatCompletionStream.ts";

Properties

readonly
currentChatCompletionSnapshot: ChatCompletionSnapshot | undefined

Methods

protected
_createChatCompletion(
completions: Completions,
options?: Core.RequestOptions,
): Promise<ChatCompletion>
protected
_fromReadableStream(readableStream: ReadableStream, options?: Core.RequestOptions): Promise<ChatCompletion>

Static Methods

createChatCompletion(
completions: Completions,
options?: Core.RequestOptions,
): 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.