-
Notifications
You must be signed in to change notification settings - Fork 0
@ralphschuler.ai function caller.index.<internal>.ChatCompletionStreamingRunner
index.<internal>.ChatCompletionStreamingRunner
-
↳
ChatCompletionStreamingRunner
- [asyncIterator]
- _addChatCompletion
- _addMessage
- _connected
- _createChatCompletion
- _emit
- _emitFinal
- _fromReadableStream
- _run
- _runChatCompletion
- _runFunctions
- _runTools
- abort
- allChatCompletions
- done
- emitted
- finalChatCompletion
- finalContent
- finalFunctionCall
- finalFunctionCallResult
- finalMessage
- off
- on
- once
- toReadableStream
- totalUsage
- createChatCompletion
- fromReadableStream
- runFunctions
- runTools
• new ChatCompletionStreamingRunner(): ChatCompletionStreamingRunner
ChatCompletionStream.constructor
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:18
• Private
#private: any
node_modules/openai/lib/ChatCompletionStream.d.ts:13
• Private
#private: any
ChatCompletionStream.#private
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:14
• Protected
_chatCompletions: ChatCompletion
[]
ChatCompletionStream._chatCompletions
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:16
• controller: AbortController
ChatCompletionStream.controller
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:15
• messages: ChatCompletionMessageParam
[]
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:17
• get
aborted(): boolean
boolean
ChatCompletionStream.aborted
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:25
• get
currentChatCompletionSnapshot(): undefined
| ChatCompletionSnapshot
undefined
| ChatCompletionSnapshot
ChatCompletionStream.currentChatCompletionSnapshot
node_modules/openai/lib/ChatCompletionStream.d.ts:14
• get
ended(): boolean
boolean
ChatCompletionStream.ended
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:23
• get
errored(): boolean
boolean
ChatCompletionStream.errored
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:24
▸ [asyncIterator](): AsyncIterator
<ChatCompletionChunk
, any
, undefined
>
AsyncIterator
<ChatCompletionChunk
, any
, undefined
>
ChatCompletionStream.[asyncIterator]
node_modules/openai/lib/ChatCompletionStream.d.ts:26
▸ _addChatCompletion(chatCompletion
): ChatCompletion
Name | Type |
---|---|
chatCompletion |
ChatCompletion |
ChatCompletionStream._addChatCompletion
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:20
▸ _addMessage(message
, emit?
): void
Name | Type |
---|---|
message |
ChatCompletionMessageParam |
emit? |
boolean |
void
ChatCompletionStream._addMessage
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:21
▸ _connected(): void
void
ChatCompletionStream._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
>
ChatCompletionStream._createChatCompletion
node_modules/openai/lib/ChatCompletionStream.d.ts:24
▸ _emit<Event
>(event
, ...args
): void
Name | Type |
---|---|
Event |
extends keyof ChatCompletionStreamEvents
|
Name | Type |
---|---|
event |
Event |
...args |
Parameters <ListenerForEvent <ChatCompletionStreamEvents , Event >> |
void
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:85
▸ _emitFinal(): void
void
ChatCompletionStream._emitFinal
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:86
▸ _fromReadableStream(readableStream
, options?
): Promise
<ChatCompletion
>
Name | Type |
---|---|
readableStream |
ReadableStream <any > |
options? |
RequestOptions <Readable | Record <string , unknown >> |
Promise
<ChatCompletion
>
ChatCompletionStream._fromReadableStream
node_modules/openai/lib/ChatCompletionStream.d.ts:25
▸ _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
>
ChatCompletionStream._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
>
ChatCompletionStream._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
>
ChatCompletionStream._runTools
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:90
▸ abort(): void
void
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:26
▸ allChatCompletions(): ChatCompletion
[]
ChatCompletionStream.allChatCompletions
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
<ChatCompletionStreamEvents
, Event
>> extends [Param
] ? Param
: Parameters
<ListenerForEvent
<ChatCompletionStreamEvents
, Event
>> extends [] ? void
: Parameters
<ListenerForEvent
<ChatCompletionStreamEvents
, 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 ChatCompletionStreamEvents
|
Name | Type |
---|---|
event |
Event |
Promise
<Parameters
<ListenerForEvent
<ChatCompletionStreamEvents
, Event
>> extends [Param
] ? Param
: Parameters
<ListenerForEvent
<ChatCompletionStreamEvents
, Event
>> extends [] ? void
: Parameters
<ListenerForEvent
<ChatCompletionStreamEvents
, 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.
ChatCompletionStream.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.
ChatCompletionStream.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.
ChatCompletionStream.finalFunctionCall
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:81
▸ finalFunctionCallResult(): Promise
<undefined
| string
>
Promise
<undefined
| string
>
ChatCompletionStream.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.
ChatCompletionStream.finalMessage
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:76
▸ off<Event
>(event
, listener
): ChatCompletionStreamingRunner
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 ChatCompletionStreamEvents
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <ChatCompletionStreamEvents , Event > |
this ChatCompletionStream, so that calls can be chained
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:42
▸ on<Event
>(event
, listener
): ChatCompletionStreamingRunner
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 ChatCompletionStreamEvents
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <ChatCompletionStreamEvents , Event > |
this ChatCompletionStream, so that calls can be chained
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:34
▸ once<Event
>(event
, listener
): ChatCompletionStreamingRunner
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 ChatCompletionStreamEvents
|
Name | Type |
---|---|
event |
Event |
listener |
ListenerForEvent <ChatCompletionStreamEvents , Event > |
this ChatCompletionStream, so that calls can be chained
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:48
▸ toReadableStream(): ReadableStream
<any
>
ReadableStream
<any
>
ChatCompletionStream.toReadableStream
node_modules/openai/lib/ChatCompletionStream.d.ts:27
▸ totalUsage(): Promise
<CompletionUsage
>
Promise
<CompletionUsage
>
ChatCompletionStream.totalUsage
node_modules/openai/lib/AbstractChatCompletionRunner.d.ts:83
▸ createChatCompletion(completions
, params
, options?
): ChatCompletionStream
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionStreamParams |
options? |
RequestOptions <Readable | Record <string , unknown >> |
ChatCompletionStream.createChatCompletion
node_modules/openai/lib/ChatCompletionStream.d.ts:23
▸ fromReadableStream(stream
): ChatCompletionStreamingRunner
Intended for use on the frontend, consuming a stream produced with
.toReadableStream()
on the backend.
Note that messages sent to the model do not appear in .on('message')
in this context.
Name | Type |
---|---|
stream |
ReadableStream <any > |
ChatCompletionStream.fromReadableStream
node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts:17
▸ runFunctions<T
>(completions
, params
, options?
): ChatCompletionStreamingRunner
Name | Type |
---|---|
T |
extends (string | object )[] |
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionStreamingFunctionRunnerParams <T > |
options? |
RunnerOptions |
node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts:18
▸ runTools<T
>(completions
, params
, options?
): ChatCompletionStreamingRunner
Name | Type |
---|---|
T |
extends (string | object )[] |
Name | Type |
---|---|
completions |
Completions |
params |
ChatCompletionStreamingToolRunnerParams <T > |
options? |
RunnerOptions |
node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts:19
- @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