Skip to content

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

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

Class: ChatCompletionRunner

index.<internal>.ChatCompletionRunner

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ChatCompletionRunner(): ChatCompletionRunner

Returns

ChatCompletionRunner

Inherited from

AbstractChatCompletionRunner.constructor

Defined in

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

Properties

#private

Private #private: any

Inherited from

AbstractChatCompletionRunner.#private

Defined in

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


_chatCompletions

Protected _chatCompletions: ChatCompletion[]

Inherited from

AbstractChatCompletionRunner._chatCompletions

Defined in

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


controller

controller: AbortController

Inherited from

AbstractChatCompletionRunner.controller

Defined in

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


messages

messages: ChatCompletionMessageParam[]

Inherited from

AbstractChatCompletionRunner.messages

Defined in

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

Accessors

aborted

get aborted(): boolean

Returns

boolean

Inherited from

AbstractChatCompletionRunner.aborted

Defined in

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


ended

get ended(): boolean

Returns

boolean

Inherited from

AbstractChatCompletionRunner.ended

Defined in

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


errored

get errored(): boolean

Returns

boolean

Inherited from

AbstractChatCompletionRunner.errored

Defined in

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

Methods

_addChatCompletion

_addChatCompletion(chatCompletion): ChatCompletion

Parameters

Name Type
chatCompletion ChatCompletion

Returns

ChatCompletion

Inherited from

AbstractChatCompletionRunner._addChatCompletion

Defined in

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


_addMessage

_addMessage(message): void

Parameters

Name Type
message ChatCompletionMessageParam

Returns

void

Overrides

AbstractChatCompletionRunner._addMessage

Defined in

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


_connected

_connected(): void

Returns

void

Inherited from

AbstractChatCompletionRunner._connected

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>

Inherited from

AbstractChatCompletionRunner._createChatCompletion

Defined in

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


_emit

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

Type parameters

Name Type
Event extends keyof ChatCompletionRunnerEvents

Parameters

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

Returns

void

Inherited from

AbstractChatCompletionRunner._emit

Defined in

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


_emitFinal

_emitFinal(): void

Returns

void

Inherited from

AbstractChatCompletionRunner._emitFinal

Defined in

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


_run

_run(executor): void

Parameters

Name Type
executor () => Promise<any>

Returns

void

Inherited from

AbstractChatCompletionRunner._run

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>

Inherited from

AbstractChatCompletionRunner._runChatCompletion

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>

Inherited from

AbstractChatCompletionRunner._runFunctions

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>

Inherited from

AbstractChatCompletionRunner._runTools

Defined in

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


abort

abort(): void

Returns

void

Inherited from

AbstractChatCompletionRunner.abort

Defined in

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


allChatCompletions

allChatCompletions(): ChatCompletion[]

Returns

ChatCompletion[]

Inherited from

AbstractChatCompletionRunner.allChatCompletions

Defined in

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


done

done(): Promise<void>

Returns

Promise<void>

Inherited from

AbstractChatCompletionRunner.done

Defined in

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


emitted

emitted<Event>(event): Promise<Parameters<ListenerForEvent<ChatCompletionRunnerEvents, Event>> extends [Param] ? Param : Parameters<ListenerForEvent<ChatCompletionRunnerEvents, Event>> extends [] ? void : Parameters<ListenerForEvent<ChatCompletionRunnerEvents, 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 keyof ChatCompletionRunnerEvents

Parameters

Name Type
event Event

Returns

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

Inherited from

AbstractChatCompletionRunner.emitted

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.

Inherited from

AbstractChatCompletionRunner.finalChatCompletion

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.

Inherited from

AbstractChatCompletionRunner.finalContent

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.

Inherited from

AbstractChatCompletionRunner.finalFunctionCall

Defined in

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


finalFunctionCallResult

finalFunctionCallResult(): Promise<undefined | string>

Returns

Promise<undefined | string>

Inherited from

AbstractChatCompletionRunner.finalFunctionCallResult

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.

Inherited from

AbstractChatCompletionRunner.finalMessage

Defined in

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


off

off<Event>(event, listener): ChatCompletionRunner

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 keyof ChatCompletionRunnerEvents

Parameters

Name Type
event Event
listener ListenerForEvent<ChatCompletionRunnerEvents, Event>

Returns

ChatCompletionRunner

this ChatCompletionStream, so that calls can be chained

Inherited from

AbstractChatCompletionRunner.off

Defined in

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


on

on<Event>(event, listener): ChatCompletionRunner

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 keyof ChatCompletionRunnerEvents

Parameters

Name Type
event Event
listener ListenerForEvent<ChatCompletionRunnerEvents, Event>

Returns

ChatCompletionRunner

this ChatCompletionStream, so that calls can be chained

Inherited from

AbstractChatCompletionRunner.on

Defined in

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


once

once<Event>(event, listener): ChatCompletionRunner

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 keyof ChatCompletionRunnerEvents

Parameters

Name Type
event Event
listener ListenerForEvent<ChatCompletionRunnerEvents, Event>

Returns

ChatCompletionRunner

this ChatCompletionStream, so that calls can be chained

Inherited from

AbstractChatCompletionRunner.once

Defined in

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


totalUsage

totalUsage(): Promise<CompletionUsage>

Returns

Promise<CompletionUsage>

Inherited from

AbstractChatCompletionRunner.totalUsage

Defined in

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


runFunctions

runFunctions(completions, params, options?): ChatCompletionRunner

Parameters

Name Type
completions Completions
params ChatCompletionFunctionRunnerParams<any[]>
options? RunnerOptions

Returns

ChatCompletionRunner

Defined in

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


runTools

runTools(completions, params, options?): ChatCompletionRunner

Parameters

Name Type
completions Completions
params ChatCompletionToolRunnerParams<any[]>
options? RunnerOptions

Returns

ChatCompletionRunner

Defined in

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

Typescript Libraries

Modules

Namespaces

Clone this wiki locally