Skip to main content

Namespace: api

Functions

retryNever

retryNever(): <OUTPUT>(f: () => PromiseLike<OUTPUT>) => Promise<OUTPUT>

The retryNever strategy never retries a failed API call.

Returns

fn

▸ <OUTPUT>(f): Promise<OUTPUT>

Type parameters
Name
OUTPUT
Parameters
NameType
f() => PromiseLike<OUTPUT>
Returns

Promise<OUTPUT>

Defined in

packages/modelfusion/src/core/api/retryNever.ts:5


retryWithExponentialBackoff

retryWithExponentialBackoff(«destructured»?): RetryFunction

The retryWithExponentialBackoff strategy retries a failed API call with an exponential backoff. You can configure the maximum number of tries, the initial delay, and the backoff factor.

Parameters

NameTypeDefault value
«destructured»Object{}
› backoffFactorundefined | number2
› initialDelayInMsundefined | number2000
› maxTriesundefined | number3

Returns

RetryFunction

Defined in

packages/modelfusion/src/core/api/retryWithExponentialBackoff.ts:12


throttleMaxConcurrency

throttleMaxConcurrency(«destructured»): ThrottleFunction

The throttleMaxConcurrency strategy limits the number of parallel API calls.

Parameters

NameType
«destructured»Object
› maxConcurrentCallsnumber

Returns

ThrottleFunction

Defined in

packages/modelfusion/src/core/api/throttleMaxConcurrency.ts:48


throttleOff

throttleOff(): ThrottleFunction

The throttleOff strategy does not limit parallel API calls.

Returns

ThrottleFunction

Defined in

packages/modelfusion/src/core/api/throttleOff.ts:6