Skip to content

RetryPolicy

Namespace: TypeSafe.AI.Sdk

public sealed class RetryPolicy

Retry configuration. Partial overrides inherit unset fields from the client or SDK defaults. Defaults match the JavaScript SDK.

Inheritance: object

View source

public bool ApiConnectionError { get; set; }

Retry connection failures, including interrupted response bodies. Default: true.

Value: bool

View source

public bool ApiTimeoutError { get; set; }

Whether to retry ApiTimeoutException. Default: true.

Value: bool

View source

public int BackoffInitialMs { get; set; }

First backoff delay in milliseconds, doubled up to BackoffMaxMs. Default: 500.

Value: int

View source

public double BackoffJitter { get; set; }

Fraction of each backoff delay randomly subtracted, from 0 to 1. Default: 0.25.

Value: double

View source

public int BackoffMaxMs { get; set; }

Maximum backoff delay in milliseconds. Default: 5000.

Value: int

View source

public static RetryPolicy Default { get; }

SDK default retry policy (a new isolated copy).

Value: RetryPolicy

View source

public ISet<int> HttpStatuses { get; set; }

HTTP status codes to retry. Default: 408, 429, and 500–599.

Value: ISet<int>

View source

public int MaxRetries { get; set; }

Maximum retries after the initial attempt; 0 disables retries. Default: 2.

Value: int

View source

public int MaxRetryAfterMs { get; set; }

Maximum server retry delay in milliseconds; longer delays use backoff. Default: 60000.

Value: int

View source

public bool RespectRetryAfter { get; set; }

Honor Retry-After and retry-after-ms up to MaxRetryAfterMs. Default: true.

Value: bool

View source

public RetryPolicy Clone()

Copy this policy so later mutations cannot affect in-flight requests.

Returns: RetryPolicy

View source

public static RetryPolicy Resolve(RetryPolicy baseline, RetryPolicy? overrides)

Merge overrides onto a base policy and validate every numeric field.

Parameters

Name Type Description
baseline RetryPolicy
overrides RetryPolicy

Returns: RetryPolicy

View source

public RetryPolicy Validate()

Validate a fully-specified constructor policy.

Returns: RetryPolicy

View source

MIT · Copyright (c) Dario Kondratiuk. · not affiliated with TypeSafe beyond being a client of the public API