-
Notifications
You must be signed in to change notification settings - Fork 0
@ralphschuler.ai function caller.index.<internal>.ChatCompletionRunner
index.<internal>.ChatCompletionRunner
-
AbstractChatCompletionRunner
<ChatCompletionRunnerEvents
>↳
ChatCompletionRunner
- _addChatCompletion
- _addMessage
- _connected
- _createChatCompletion
- _emit
- _emitFinal
- _run
- _runChatCompletion
- _runFunctions
- _runTools
- abort
- allChatCompletions
- done
- emitted
- finalChatCompletion
- finalContent
- finalFunctionCall
- finalFunctionCallResult
- finalMessage
- off
- on
- once
- totalUsage
- runFunctions
- runTools
• new ChatCompletionRunner(): ChatCompletionRunner
AbstractChatCompletionRunner.constructor
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:18
• Private
#private: any
AbstractChatCompletionRunner.#private
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:14
• Protected
_chatCompletions: ChatCompletion
[]
AbstractChatCompletionRunner._chatCompletions
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:16
• controller: AbortController
AbstractChatCompletionRunner.controller
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:15
• messages: ChatCompletionMessageParam
[]
AbstractChatCompletionRunner.messages
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:17
• get
aborted(): boolean
boolean
AbstractChatCompletionRunner.aborted
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:25
• get
ended(): boolean
boolean
AbstractChatCompletionRunner.ended
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:23
• get
errored(): boolean
boolean
AbstractChatCompletionRunner.errored
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:24
▸ _addChatCompletion(chatCompletion
): ChatCompletion
Name | Type |
---|---|
chatCompletion |
ChatCompletion |
AbstractChatCompletionRunner._addChatCompletion
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:20
▸ _addMessage(message
): void
Name | Type |
---|---|
message |
ChatCompletionMessageParam |
void
AbstractChatCompletionRunner._addMessage
node_modules/openai/lib/ChatCompletionRunner.d.ts:16
▸ _connected(): void
void
AbstractChatCompletionRunner._connected
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:22
▸ _createChatCompletion(completions
, params
, options?
): Promise
<ChatCompletion
>
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionCreateParams |
options? |
RequestOptions <Readable | Record <string , unknown >> |
Promise
<ChatCompletion
>
AbstractChatCompletionRunner._createChatCompletion
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:87
▸ _emit<Event
>(event
, ...args
): void
Name | Type |
---|---|
Event |
extends keyof ChatCompletionRunnerEvents
|
Name | Type |
---|---|
event |
Event |
...args |
Parameters <ListenerForEvent <ChatCompletionRunnerEvents , Event >> |
void
AbstractChatCompletionRunner._emit
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:85
▸ _emitFinal(): void
void
AbstractChatCompletionRunner._emitFinal
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:86
▸ _run(executor
): void
Name | Type |
---|---|
executor |
() => Promise <any > |
void
AbstractChatCompletionRunner._run
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:19
▸ _runChatCompletion(completions
, params
, options?
): Promise
<ChatCompletion
>
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionCreateParams |
options? |
RequestOptions <Readable | Record <string , unknown >> |
Promise
<ChatCompletion
>
AbstractChatCompletionRunner._runChatCompletion
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:88
▸ _runFunctions<FunctionsArgs
>(completions
, params
, options?
): Promise
<void
>
Name | Type |
---|---|
FunctionsArgs |
extends BaseFunctionsArgs
|
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionFunctionRunnerParams <FunctionsArgs > | ChatCompletionStreamingFunctionRunnerParams <FunctionsArgs > |
options? |
RunnerOptions |
Promise
<void
>
AbstractChatCompletionRunner._runFunctions
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:89
▸ _runTools<FunctionsArgs
>(completions
, params
, options?
): Promise
<void
>
Name | Type |
---|---|
FunctionsArgs |
extends BaseFunctionsArgs
|
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionToolRunnerParams <FunctionsArgs > | ChatCompletionStreamingToolRunnerParams <FunctionsArgs > |
options? |
RunnerOptions |
Promise
<void
>
AbstractChatCompletionRunner._runTools
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:90
▸ abort(): void
void
AbstractChatCompletionRunner.abort
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:26
▸ allChatCompletions(): ChatCompletion
[]
AbstractChatCompletionRunner.allChatCompletions
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:84
▸ done(): Promise
<void
>
Promise
<void
>
AbstractChatCompletionRunner.done
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:61
▸ 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.
Name | Type |
---|---|
Event |
extends keyof ChatCompletionRunnerEvents
|
Name | Type |
---|---|
event |
Event |
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
AbstractChatCompletionRunner.emitted
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:60
▸ finalChatCompletion(): Promise
<ChatCompletion
>
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.
AbstractChatCompletionRunner.finalChatCompletion
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:66
▸ finalContent(): Promise
<null
| string
>
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.
AbstractChatCompletionRunner.finalContent
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:71
▸ finalFunctionCall(): Promise
<undefined
| FunctionCall
>
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.
AbstractChatCompletionRunner.finalFunctionCall
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:81
▸ finalFunctionCallResult(): Promise
<undefined
| string
>
Promise
<undefined
| string
>
AbstractChatCompletionRunner.finalFunctionCallResult
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:82
▸ finalMessage(): Promise
<ChatCompletionMessage
>
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.
AbstractChatCompletionRunner.finalMessage
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:76
▸ 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.
Name | Type |
---|---|
Event |
extends keyof ChatCompletionRunnerEvents
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <ChatCompletionRunnerEvents , Event > |
this ChatCompletionStream, so that calls can be chained
AbstractChatCompletionRunner.off
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:42
▸ 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.
Name | Type |
---|---|
Event |
extends keyof ChatCompletionRunnerEvents
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <ChatCompletionRunnerEvents , Event > |
this ChatCompletionStream, so that calls can be chained
AbstractChatCompletionRunner.on
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:34
▸ 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.
Name | Type |
---|---|
Event |
extends keyof ChatCompletionRunnerEvents
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <ChatCompletionRunnerEvents , Event > |
this ChatCompletionStream, so that calls can be chained
AbstractChatCompletionRunner.once
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:48
▸ totalUsage(): Promise
<CompletionUsage
>
Promise
<CompletionUsage
>
AbstractChatCompletionRunner.totalUsage
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:83
▸ runFunctions(completions
, params
, options?
): ChatCompletionRunner
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionFunctionRunnerParams <any []> |
options? |
RunnerOptions |
node_modules/openai/lib/ChatCompletionRunner.d.ts:14
▸ runTools(completions
, params
, options?
): ChatCompletionRunner
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionToolRunnerParams <any []> |
options? |
RunnerOptions |
node_modules/openai/lib/ChatCompletionRunner.d.ts:15
- @ralphschuler/ai-function-caller
- index
- types/AIFunction
- types/Message
- @ralphschuler/assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- error
- index
- util
- @ralphschuler/better-map
- @ralphschuler/better-set
- @ralphschuler/binary-serializer
- @ralphschuler/bit-mask
- @ralphschuler/complex-compare
- @ralphschuler/i811n
- @ralphschuler/logger
- Color
- ColorMap
- Logger
- animations/BallonAnimation
- animations/BaseAnimation
- animations/BombAnimation
- animations/BouncingBallAnimation
- animations/ClockAnimation
- animations/DotsAnimation
- animations/HorizontalBarAnimation
- animations/PongAnimation
- animations/ProgressAnimation
- animations/ProgressBarAnimation
- animations/SpinnerAnimation
- animations/VerticalBarAnimation
- enums/LogLevel
- index
- interfaces/IColor
- interfaces/IMessage
- types/ColorName
- types/Colors
- @ralphschuler/lsystem
- @ralphschuler/mixin-class-factory
- @ralphschuler/neuronal-network
- @ralphschuler/parser-combinator
- index
- inputTypes
- parser
- unicode
- @ralphschuler/prom-metrics-decorator
- @ralphschuler/prom-metrics-parser
- @ralphschuler/random
- PseudoRandomItemSelector
- PseudoRandomNumberGenerator
- Seed
- index
- strategies
- strategy
- strategy
- strategy
- strategy
- strategy
- strategy
- types
- type
- type
- type
- @ralphschuler/safe-array
- @ralphschuler/slot-mashine
- @ralphschuler/state-store
- StateStore
- index
- type
- type
- type
- type
- type
- type
- type
- type
- util
- @ralphschuler/stats-tracker
- @ralphschuler/ts-error
- error
- index
- type
- util
- util
- util
- util
- @ralphschuler/webgl-sand-engine
- index
- pixel-renderer
- @ralphschuler/webgl-shader-factory
- "node:stream/consumers"
- "node:stream/promises"
- ChatCompletionSnapshot
- Choice
- Message
- ToolCall
- EventEmitter
- FormData
- OpenAI
- OpenAI
- Audio
- Speech
- Transcriptions
- Translations
- Beta
- Assistants
- Assistant
- AssistantCreateParams
- AssistantUpdateParams
- Files
- Chat
- Threads
- Messages
- Files
- MessageContentImageFile
- MessageContentText
- Text
- FileCitation
- FilePath
- Runs
- RequiredActionFunctionToolCall
- Run
- RequiredAction
- RunCreateParams
- RunSubmitToolOutputsParams
- Steps
- CodeToolCall
- CodeInterpreter
- Image
- FunctionToolCall
- MessageCreationStepDetails
- RunStep
- ThreadCreateAndRunParams
- Thread
- ThreadCreateParams
- Chat
- Completions
- ChatCompletion
- ChatCompletionAssistantMessageParam
- ChatCompletionChunk
- Choice
- Delta
- ToolCall
- ChatCompletionContentPartImage
- ChatCompletionCreateParams
- ChatCompletionMessage
- ChatCompletionMessageToolCall
- ChatCompletionNamedToolChoice
- Completions
- CompletionChoice
- CompletionCreateParams
- Edits
- Edit
- Embeddings
- CreateEmbeddingResponse
- Files
- FineTunes
- FineTune
- FineTuneCreateParams
- FineTuneListEventsParams
- FineTuning
- Jobs
- FineTuningJob
- JobCreateParams
- Images
- Models
- Moderations
- Moderation
- internal
- finished
- pipeline
- "node:stream/consumers"
- "node:stream/promises"
- EventEmitter
- internal
- finished
- pipeline
- Counter
- Gauge
- Histogram
- Summary