import type { ProviderResponse } from "../types.ts"; interface ProviderRetryOptions { maxRetries?: number; maxRetryDelayMs?: number; signal?: AbortSignal; /** HTTP statuses that fail at once although the default policy would retry them. */ noRetryStatuses?: readonly number[]; /** * Called for each attempt that failed with an HTTP status, before the retry decision. SDKs reject non-2xx * responses, so this is the only place their status and headers reach the caller's `onResponse`. */ onErrorResponse?: (response: ProviderResponse) => void | Promise; } /** * Reproduce the retry behavior used by the OpenAI and Anthropic SDKs while making * their backoff sleep interruptible. Their built-in retry timers ignore the * request AbortSignal, so callers must invoke the SDK with `maxRetries: 0` and * wrap the request with this helper. Provider-requested delays above * `maxRetryDelayMs` fail immediately (60 seconds by default); set it to zero to * disable the limit. */ export declare function retryProviderRequest(request: () => Promise, options?: ProviderRetryOptions): Promise; export {}; //# sourceMappingURL=provider-retry.d.ts.map