-
Notifications
You must be signed in to change notification settings - Fork 0
@ralphschuler.ai function caller.index.<internal>.AbstractChatCompletionRunner
index.<internal>.AbstractChatCompletionRunner
Name | Type |
---|---|
Events |
extends CustomEvents <any > = AbstractChatCompletionRunnerEvents
|
-
AbstractChatCompletionRunner
- _addChatCompletion
- _addMessage
- _connected
- _createChatCompletion
- _emit
- _emitFinal
- _run
- _runChatCompletion
- _runFunctions
- _runTools
- abort
- allChatCompletions
- done
- emitted
- finalChatCompletion
- finalContent
- finalFunctionCall
- finalFunctionCallResult
- finalMessage
- off
- on
- once
- totalUsage
• new AbstractChatCompletionRunner<Events
>(): AbstractChatCompletionRunner
<Events
>
Name | Type |
---|---|
Events |
extends CustomEvents <any > = AbstractChatCompletionRunnerEvents
|
AbstractChatCompletionRunner
<Events
>
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:18
• Private
#private: any
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:14
• Protected
_chatCompletions: ChatCompletion
[]
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:16
• controller: AbortController
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:15
• messages: ChatCompletionMessageParam
[]
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:17
• get
aborted(): boolean
boolean
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:25
• get
ended(): boolean
boolean
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:23
• get
errored(): boolean
boolean
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:24
▸ _addChatCompletion(chatCompletion
): ChatCompletion
Name | Type |
---|---|
chatCompletion |
ChatCompletion |
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:20
▸ _addMessage(message
, emit?
): void
Name | Type |
---|---|
message |
ChatCompletionMessageParam |
emit? |
boolean |
void
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:21
▸ _connected(): void
void
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
>
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:87
▸ _emit<Event
>(event
, ...args
): void
Name | Type |
---|---|
Event |
extends string | number | symbol
|
Name | Type |
---|---|
event |
Event |
...args |
Parameters <ListenerForEvent <Events , Event >> |
void
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:85
▸ _emitFinal(): void
void
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:86
▸ _run(executor
): void
Name | Type |
---|---|
executor |
() => Promise <any > |
void
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
>
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
>
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
>
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:90
▸ abort(): void
void
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:26
▸ allChatCompletions(): ChatCompletion
[]
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:84
▸ done(): Promise
<void
>
Promise
<void
>
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:61
▸ 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.
Name | Type |
---|---|
Event |
extends string | number | symbol
|
Name | Type |
---|---|
event |
Event |
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
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.
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.
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.
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:81
▸ finalFunctionCallResult(): Promise
<undefined
| string
>
Promise
<undefined
| string
>
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.
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:76
▸ 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.
Name | Type |
---|---|
Event |
extends string | number | symbol
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <Events , Event > |
AbstractChatCompletionRunner
<Events
>
this ChatCompletionStream, so that calls can be chained
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:42
▸ 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.
Name | Type |
---|---|
Event |
extends string | number | symbol
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <Events , Event > |
AbstractChatCompletionRunner
<Events
>
this ChatCompletionStream, so that calls can be chained
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:34
▸ 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.
Name | Type |
---|---|
Event |
extends string | number | symbol
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <Events , Event > |
AbstractChatCompletionRunner
<Events
>
this ChatCompletionStream, so that calls can be chained
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:48
▸ totalUsage(): Promise
<CompletionUsage
>
Promise
<CompletionUsage
>
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:83
- @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