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#on

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

Adds the listener function to the end of the listeners array for the event. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of event and listener will result in the listener being added, and called, multiple times.

Type Parameters

Event extends keyof Events

Parameters

event: Event
listener: ListenerForEvent<Events, Event>

Returns

this

this ChatCompletionStream, so that calls can be chained