Skip to content

@ralphschuler.ai function caller.index.<internal>.AbstractChatCompletionRunner

github-actions edited this page Nov 26, 2023 · 1 revision

Class: AbstractChatCompletionRunner<Events>

index.<internal>.AbstractChatCompletionRunner

Type parameters

Name Type
Events extends CustomEvents<any> = AbstractChatCompletionRunnerEvents

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new AbstractChatCompletionRunner<Events>(): AbstractChatCompletionRunner<Events>

Type parameters

Name Type
Events extends CustomEvents<any> = AbstractChatCompletionRunnerEvents

Returns

AbstractChatCompletionRunner<Events>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:18

Properties

#private

Private #private: any

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:14


_chatCompletions

Protected _chatCompletions: ChatCompletion[]

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:16


controller

controller: AbortController

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:15


messages

messages: ChatCompletionMessageParam[]

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:17

Accessors

aborted

get aborted(): boolean

Returns

boolean

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:25


ended

get ended(): boolean

Returns

boolean

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:23


errored

get errored(): boolean

Returns

boolean

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:24

Methods

_addChatCompletion

_addChatCompletion(chatCompletion): ChatCompletion

Parameters

Name Type
chatCompletion ChatCompletion

Returns

ChatCompletion

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:20


_addMessage

_addMessage(message, emit?): void

Parameters

Name Type
message ChatCompletionMessageParam
emit? boolean

Returns

void

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:21


_connected

_connected(): void

Returns

void

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:22


_createChatCompletion

_createChatCompletion(completions, params, options?): Promise<ChatCompletion>

Parameters

Name Type
completions Completions
params ChatCompletionCreateParams
options? RequestOptions<Readable | Record<string, unknown>>

Returns

Promise<ChatCompletion>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:87


_emit

_emit<Event>(event, ...args): void

Type parameters

Name Type
Event extends string | number | symbol

Parameters

Name Type
event Event
...args Parameters<ListenerForEvent<Events, Event>>

Returns

void

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:85


_emitFinal

_emitFinal(): void

Returns

void

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:86


_run

_run(executor): void

Parameters

Name Type
executor () => Promise<any>

Returns

void

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:19


_runChatCompletion

_runChatCompletion(completions, params, options?): Promise<ChatCompletion>

Parameters

Name Type
completions Completions
params ChatCompletionCreateParams
options? RequestOptions<Readable | Record<string, unknown>>

Returns

Promise<ChatCompletion>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:88


_runFunctions

_runFunctions<FunctionsArgs>(completions, params, options?): Promise<void>

Type parameters

Name Type
FunctionsArgs extends BaseFunctionsArgs

Parameters

Name Type
completions Completions
params ChatCompletionFunctionRunnerParams<FunctionsArgs> | ChatCompletionStreamingFunctionRunnerParams<FunctionsArgs>
options? RunnerOptions

Returns

Promise<void>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:89


_runTools

_runTools<FunctionsArgs>(completions, params, options?): Promise<void>

Type parameters

Name Type
FunctionsArgs extends BaseFunctionsArgs

Parameters

Name Type
completions Completions
params ChatCompletionToolRunnerParams<FunctionsArgs> | ChatCompletionStreamingToolRunnerParams<FunctionsArgs>
options? RunnerOptions

Returns

Promise<void>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:90


abort

abort(): void

Returns

void

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:26


allChatCompletions

allChatCompletions(): ChatCompletion[]

Returns

ChatCompletion[]

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:84


done

done(): Promise<void>

Returns

Promise<void>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:61


emitted

emitted<Event>(event): Promise<Parameters<ListenerForEvent<Events, Event>> extends [Param] ? Param : Parameters<ListenerForEvent<Events, Event>> extends [] ? void : Parameters<ListenerForEvent<Events, Event>>>

This is similar to .once(), but returns a Promise that resolves the next time the event is triggered, instead of calling a listener callback.

Type parameters

Name Type
Event extends string | number | symbol

Parameters

Name Type
event Event

Returns

Promise<Parameters<ListenerForEvent<Events, Event>> extends [Param] ? Param : Parameters<ListenerForEvent<Events, Event>> extends [] ? void : Parameters<ListenerForEvent<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

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:60


finalChatCompletion

finalChatCompletion(): Promise<ChatCompletion>

Returns

Promise<ChatCompletion>

a promise that resolves with the final ChatCompletion, or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletion.

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:66


finalContent

finalContent(): Promise<null | string>

Returns

Promise<null | string>

a promise that resolves with the content of the final ChatCompletionMessage, or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:71


finalFunctionCall

finalFunctionCall(): Promise<undefined | FunctionCall>

Returns

Promise<undefined | FunctionCall>

a promise that resolves with the content of the final FunctionCall, or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:81


finalFunctionCallResult

finalFunctionCallResult(): Promise<undefined | string>

Returns

Promise<undefined | string>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:82


finalMessage

finalMessage(): Promise<ChatCompletionMessage>

Returns

Promise<ChatCompletionMessage>

a promise that resolves with the the final assistant ChatCompletionMessage response, or rejects if an error occurred or the stream ended prematurely without producing a ChatCompletionMessage.

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:76


off

off<Event>(event, listener): AbstractChatCompletionRunner<Events>

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.

Type parameters

Name Type
Event extends string | number | symbol

Parameters

Name Type
event Event
listener ListenerForEvent<Events, Event>

Returns

AbstractChatCompletionRunner<Events>

this ChatCompletionStream, so that calls can be chained

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:42


on

on<Event>(event, listener): AbstractChatCompletionRunner<Events>

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

Name Type
Event extends string | number | symbol

Parameters

Name Type
event Event
listener ListenerForEvent<Events, Event>

Returns

AbstractChatCompletionRunner<Events>

this ChatCompletionStream, so that calls can be chained

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:34


once

once<Event>(event, listener): AbstractChatCompletionRunner<Events>

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

Name Type
Event extends string | number | symbol

Parameters

Name Type
event Event
listener ListenerForEvent<Events, Event>

Returns

AbstractChatCompletionRunner<Events>

this ChatCompletionStream, so that calls can be chained

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:48


totalUsage

totalUsage(): Promise<CompletionUsage>

Returns

Promise<CompletionUsage>

Defined in

node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:83

Typescript Libraries

Modules

Namespaces

Clone this wiki locally