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

x/openai/lib/AbstractChatCompletionRunner.ts>AbstractChatCompletionRunner#once

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

Adds a one-time listener function for the event. The next time the event is triggered, this listener is removed and then invoked.

Type Parameters

Event extends keyof Events

Parameters

event: Event
listener: ListenerForEvent<Events, Event>

Returns

this

this ChatCompletionStream, so that calls can be chained