Skip to content

BackupModelOptions

Defined in: core/src/retry.ts:211

models: string[];

Defined in: core/src/retry.ts:213

Tried in order: [primary, ...backups]. The first success wins.


optional onFallback?: (info) => void;

Defined in: core/src/retry.ts:227

Parameter Type
info { model: string; position: number; total: number; }
info.model string
info.position number
info.total number

void


optional onModelFailed?: (info) => void;

Defined in: core/src/retry.ts:221

Parameter Type
info { error: unknown; model: string; position: number; total: number; }
info.error unknown
info.model string
info.position number
info.total number

void


optional shouldTryNext?: (err) => boolean;

Defined in: core/src/retry.ts:220

Whether a failure may fall through to the remaining models. Default: overload and rate limits only. Those are per-model-endpoint, and nothing else on the list is. An auth failure or an invalid request would land identically on every backup.

Parameter Type
err unknown

boolean