Skip to content

RetryOptions

Namespace: Vercel.AI.Util

public sealed class RetryOptions

Options for RetryWithExponentialBackoffRespectingRetryHeaders.

Inheritance: object

View source

public CancellationToken AbortSignal { get; set; }

Aborts the wait between attempts.

Value: CancellationToken

View source

public Func<object, Task<bool>>? AdditionalRetryableError { get; set; }

Extra predicate consulted when the error is not an API or gateway retry.

Value: Func<object, Task<bool>>

View source

public double BackoffFactor { get; set; }

Multiplier applied after each retry. Default is 2.

Value: double

View source

public Func<int, CancellationToken, Task>? Delay { get; set; }

Waits milliseconds before the next attempt. The default is CancellationToken).

Value: Func<int, CancellationToken, Task>

View source

public int InitialDelayInMs { get; set; }

Delay before the first retry, in milliseconds. Default is 2000.

Value: int

View source

public int MaxRetries { get; set; }

Maximum retries after the first attempt. Default is 2.

Value: int

View source

public Func<DateTimeOffset>? UtcNow { get; set; }

Clock used to parse HTTP-date Retry-After values. Default is UTC now.

Value: Func<DateTimeOffset>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product