RetryPolicy
Namespace: TypeSafe.AI.Sdk
public sealed class RetryPolicyRetry configuration. Partial overrides inherit unset fields from the client or SDK defaults. Defaults match the JavaScript SDK.
Inheritance: object
Properties
Section titled “Properties”ApiConnectionError
Section titled “ApiConnectionError”public bool ApiConnectionError { get; set; }Retry connection failures, including interrupted response bodies. Default: true.
Value: bool
ApiTimeoutError
Section titled “ApiTimeoutError”public bool ApiTimeoutError { get; set; }Whether to retry ApiTimeoutException. Default: true.
Value: bool
BackoffInitialMs
Section titled “BackoffInitialMs”public int BackoffInitialMs { get; set; }First backoff delay in milliseconds, doubled up to BackoffMaxMs. Default: 500.
Value: int
BackoffJitter
Section titled “BackoffJitter”public double BackoffJitter { get; set; }Fraction of each backoff delay randomly subtracted, from 0 to 1. Default: 0.25.
Value: double
BackoffMaxMs
Section titled “BackoffMaxMs”public int BackoffMaxMs { get; set; }Maximum backoff delay in milliseconds. Default: 5000.
Value: int
Default
Section titled “Default”public static RetryPolicy Default { get; }SDK default retry policy (a new isolated copy).
Value: RetryPolicy
HttpStatuses
Section titled “HttpStatuses”public ISet<int> HttpStatuses { get; set; }HTTP status codes to retry. Default: 408, 429, and 500–599.
Value: ISet<int>
MaxRetries
Section titled “MaxRetries”public int MaxRetries { get; set; }Maximum retries after the initial attempt; 0 disables retries. Default: 2.
Value: int
MaxRetryAfterMs
Section titled “MaxRetryAfterMs”public int MaxRetryAfterMs { get; set; }Maximum server retry delay in milliseconds; longer delays use backoff. Default: 60000.
Value: int
RespectRetryAfter
Section titled “RespectRetryAfter”public bool RespectRetryAfter { get; set; }Honor Retry-After and retry-after-ms up to MaxRetryAfterMs. Default: true.
Value: bool
Methods
Section titled “Methods”Clone()
Section titled “Clone()”public RetryPolicy Clone()Copy this policy so later mutations cannot affect in-flight requests.
Returns: RetryPolicy
Resolve(RetryPolicy, RetryPolicy?)
Section titled “Resolve(RetryPolicy, RetryPolicy?)”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
Validate()
Section titled “Validate()”public RetryPolicy Validate()Validate a fully-specified constructor policy.
Returns: RetryPolicy
MIT · Copyright (c) Dario Kondratiuk. · not affiliated with TypeSafe beyond being a client of the public API