import { AbstractChatCompletionRunner } from "https://deno.land/x/openai@v4.21.0/lib/AbstractChatCompletionRunner.ts";
This is similar to .once()
, but returns a Promise that resolves the next time
the event is triggered, instead of calling a listener callback.
Parameters
event: Event
Returns
Promise<EventParameters<Events, Event> extends [infer Param] ? Param : EventParameters<Events, Event> extends [] ? void : EventParameters<Events, Event>>
a Promise that resolves the next time given event is triggered, or rejects if an error is emitted. (If you request the 'error' event, returns a promise that resolves with the error).
Example:
const message = await stream.emitted('message') // rejects if the stream errors