Skip to main content

Module retry

Module retry 

Source
Expand description

Retry strategies for failed model calls and the backoff math they use.

Structs§

BackoffContext
Context passed to a BackoffStrategy for each retry decision (BackoffContext).
ConstantBackoff
Constant backoff: the same delay for every retry (ConstantBackoff).
ConstantBackoffOptions
Options for ConstantBackoff (ConstantBackoffOptions).
DefaultModelRetryStrategy
Retries model calls that fail with an error the SDK classifies as retryable (DefaultModelRetryStrategy).
DefaultModelRetryStrategyOptions
Options for DefaultModelRetryStrategy (DefaultModelRetryStrategyOptions).
ExponentialBackoff
Exponential backoff: base * multiplier^(attempt - 1), capped at max, then jittered (ExponentialBackoff).
ExponentialBackoffOptions
Options for ExponentialBackoff (ExponentialBackoffOptions).
IsRetryable
Classifies which errors a DefaultModelRetryStrategy retries.
LinearBackoff
Linear backoff: base * attempt, capped at max, then jittered (LinearBackoff).
LinearBackoffOptions
Options for LinearBackoff (LinearBackoffOptions).
ModelRetryContext
What a ModelRetryStrategy sees of a failed model call.

Enums§

JitterKind
Jitter applied to the raw delay (JitterKind). For other jitter, implement BackoffStrategy.
RetryDecision
Whether to retry a failed operation, and how long to wait first (RetryDecision).
RetryStrategy
Any retry strategy the agent accepts (RetryStrategy).

Traits§

BackoffStrategy
Computes the delay before the next retry attempt (BackoffStrategy).
ModelRetryStrategy
A policy for retrying failed model calls (ModelRetryStrategy).