import { EventStream } from "https://deno.land/x/openai@v4.61.1/lib/EventStream.ts";
Type Parameters
Methods
This is similar to .once()
, but returns a Promise that resolves the next time
the event is triggered, instead of calling a listener callback.
Removes the specified listener from the listener array for the event. off() will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified event, then off() must be called multiple times to remove each instance.
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.
Adds a one-time listener function for the event. The next time the event is triggered, this listener is removed and then invoked.