-
Notifications
You must be signed in to change notification settings - Fork 0
@ralphschuler.ai function caller.index.<internal>.APIPromise
index.<internal>.APIPromise
A subclass of Promise
providing additional helper methods
for interacting with the SDK.
Name |
---|
T |
-
Promise
<T
>↳
APIPromise
↳↳
PagePromise
• new APIPromise<T
>(responsePromise
, parseResponse?
): APIPromise
<T
>
Name |
---|
T |
Name | Type |
---|---|
responsePromise |
Promise <APIResponseProps > |
parseResponse? |
(props : APIResponseProps ) => PromiseOrValue <T > |
APIPromise
<T
>
Promise<T>.constructor
node_modules/openai/core.d.ts:23
• Readonly
[toStringTag]: string
Promise.[toStringTag]
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:176
• Private
parse: any
node_modules/openai/core.d.ts:56
• Private
parseResponse: any
node_modules/openai/core.d.ts:21
• Private
parsedPromise: any
node_modules/openai/core.d.ts:22
• Private
responsePromise: any
node_modules/openai/core.d.ts:20
▪ Static
Readonly
[species]: PromiseConstructor
Promise.[species]
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:180
▸ _thenUnwrap<U
>(transform
): APIPromise
<U
>
Name |
---|
U |
Name | Type |
---|---|
transform |
(data : T ) => U
|
APIPromise
<U
>
node_modules/openai/core.d.ts:24
▸ asResponse(): Promise
<Response
>
Gets the raw Response
instance instead of parsing the response
data.
If you want to parse the response body but still get the Response
instance, you can use ().
👋 Getting the wrong TypeScript type for Response
?
Try setting "moduleResolution": "NodeNext"
if you can,
or add one of these imports before your first import … from 'openai'
:
-
import 'openai/shims/node'
(if you're running on Node) -
import 'openai/shims/web'
(otherwise)
Promise
<Response
>
node_modules/openai/core.d.ts:38
▸ catch<TResult
>(onrejected?
): Promise
<T
| TResult
>
Name | Type |
---|---|
TResult |
never |
Name | Type |
---|---|
onrejected? |
null | (reason : any ) => TResult | PromiseLike <TResult > |
Promise
<T
| TResult
>
Promise.catch
node_modules/openai/core.d.ts:58
▸ finally(onfinally?
): Promise
<T
>
Name | Type |
---|---|
onfinally? |
null | () => void
|
Promise
<T
>
Promise.finally
node_modules/openai/core.d.ts:59
▸ then<TResult1
, TResult2
>(onfulfilled?
, onrejected?
): Promise
<TResult1
| TResult2
>
Name | Type |
---|---|
TResult1 |
T |
TResult2 |
never |
Name | Type |
---|---|
onfulfilled? |
null | (value : T ) => TResult1 | PromiseLike <TResult1 > |
onrejected? |
null | (reason : any ) => TResult2 | PromiseLike <TResult2 > |
Promise
<TResult1
| TResult2
>
Promise.then
node_modules/openai/core.d.ts:57
▸ withResponse(): Promise
<{ data
: T
; response
: Response
}>
Gets the parsed response data and the raw Response
instance.
If you just want to get the raw Response
instance without parsing it,
you can use ().
👋 Getting the wrong TypeScript type for Response
?
Try setting "moduleResolution": "NodeNext"
if you can,
or add one of these imports before your first import … from 'openai'
:
-
import 'openai/shims/node'
(if you're running on Node) -
import 'openai/shims/web'
(otherwise)
Promise
<{ data
: T
; response
: Response
}>
node_modules/openai/core.d.ts:52
▸ all<T
>(values
): Promise
<Awaited
<T
>[]>
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
Name |
---|
T |
Name | Type | Description |
---|---|---|
values |
Iterable <T | PromiseLike <T >> |
An iterable of Promises. |
Promise
<Awaited
<T
>[]>
A new Promise.
Promise.all
node_modules/typescript/lib/lib.es2015.iterable.d.ts:225
▸ all<T
>(values
): Promise
<{ -readonly [P in string | number | symbol]: Awaited<T[P]> }>
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
Name | Type |
---|---|
T |
extends [] | readonly unknown [] |
Name | Type | Description |
---|---|---|
values |
T |
An array of Promises. |
Promise
<{ -readonly [P in string | number | symbol]: Awaited<T[P]> }>
A new Promise.
Promise.all
node_modules/typescript/lib/lib.es2015.promise.d.ts:39
▸ allSettled<T
>(values
): Promise
<{ -readonly [P in string | number | symbol]: PromiseSettledResult<Awaited<T[P]>> }>
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
Name | Type |
---|---|
T |
extends [] | readonly unknown [] |
Name | Type | Description |
---|---|---|
values |
T |
An array of Promises. |
Promise
<{ -readonly [P in string | number | symbol]: PromiseSettledResult<Awaited<T[P]>> }>
A new Promise.
Promise.allSettled
node_modules/typescript/lib/lib.es2020.promise.d.ts:38
▸ allSettled<T
>(values
): Promise
<PromiseSettledResult
<Awaited
<T
>>[]>
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
Name |
---|
T |
Name | Type | Description |
---|---|---|
values |
Iterable <T | PromiseLike <T >> |
An array of Promises. |
Promise
<PromiseSettledResult
<Awaited
<T
>>[]>
A new Promise.
Promise.allSettled
node_modules/typescript/lib/lib.es2020.promise.d.ts:46
▸ any<T
>(values
): Promise
<Awaited
<T
[number
]>>
The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
Name | Type |
---|---|
T |
extends [] | readonly unknown [] |
Name | Type | Description |
---|---|---|
values |
T |
An array or iterable of Promises. |
Promise
<Awaited
<T
[number
]>>
A new Promise.
Promise.any
node_modules/typescript/lib/lib.es2021.promise.d.ts:40
▸ any<T
>(values
): Promise
<Awaited
<T
>>
The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
Name |
---|
T |
Name | Type | Description |
---|---|---|
values |
Iterable <T | PromiseLike <T >> |
An array or iterable of Promises. |
Promise
<Awaited
<T
>>
A new Promise.
Promise.any
node_modules/typescript/lib/lib.es2021.promise.d.ts:47
▸ race<T
>(values
): Promise
<Awaited
<T
>>
Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.
Name |
---|
T |
Name | Type | Description |
---|---|---|
values |
Iterable <T | PromiseLike <T >> |
An iterable of Promises. |
Promise
<Awaited
<T
>>
A new Promise.
Promise.race
node_modules/typescript/lib/lib.es2015.iterable.d.ts:233
▸ race<T
>(values
): Promise
<Awaited
<T
[number
]>>
Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.
Name | Type |
---|---|
T |
extends [] | readonly unknown [] |
Name | Type | Description |
---|---|---|
values |
T |
An array of Promises. |
Promise
<Awaited
<T
[number
]>>
A new Promise.
Promise.race
node_modules/typescript/lib/lib.es2015.promise.d.ts:50
▸ reject<T
>(reason?
): Promise
<T
>
Creates a new rejected promise for the provided reason.
Name | Type |
---|---|
T |
never |
Name | Type | Description |
---|---|---|
reason? |
any |
The reason the promise was rejected. |
Promise
<T
>
A new rejected Promise.
Promise.reject
node_modules/typescript/lib/lib.es2015.promise.d.ts:60
▸ resolve(): Promise
<void
>
Creates a new resolved promise.
Promise
<void
>
A resolved promise.
Promise.resolve
node_modules/typescript/lib/lib.es2015.promise.d.ts:66
▸ resolve<T
>(value
): Promise
<Awaited
<T
>>
Creates a new resolved promise for the provided value.
Name |
---|
T |
Name | Type | Description |
---|---|---|
value |
T |
A promise. |
Promise
<Awaited
<T
>>
A promise whose internal state matches the provided promise.
Promise.resolve
node_modules/typescript/lib/lib.es2015.promise.d.ts:72
▸ resolve<T
>(value
): Promise
<Awaited
<T
>>
Creates a new resolved promise for the provided value.
Name |
---|
T |
Name | Type | Description |
---|---|---|
value |
T | PromiseLike <T > |
A promise. |
Promise
<Awaited
<T
>>
A promise whose internal state matches the provided promise.
Promise.resolve
node_modules/typescript/lib/lib.es2015.promise.d.ts:78
- @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