RetryConfig

data class RetryConfig(val maxAttempts: Int = 3, val initialDelay: Duration = 1.seconds, val maxDelay: Duration = 30.seconds, val backoffMultiplier: Double = 2.0, val jitterFactor: Double = 0.1, val retryablePatterns: List<RetryablePattern> = DEFAULT_PATTERNS, val retryAfterExtractor: RetryAfterExtractor? = DefaultRetryAfterExtractor)(source)

Configuration for retry behavior in LLM client operations.

Constructors

Link copied to clipboard
constructor(maxAttempts: Int = 3, initialDelay: Duration = 1.seconds, maxDelay: Duration = 30.seconds, backoffMultiplier: Double = 2.0, jitterFactor: Double = 0.1, retryablePatterns: List<RetryablePattern> = DEFAULT_PATTERNS, retryAfterExtractor: RetryAfterExtractor? = DefaultRetryAfterExtractor)

Types

Link copied to clipboard
object Companion

Companion object for providing predefined retry configurations and patterns. Contains default retry logic settings that can be used across different use cases, along with scoped configurations for conservative, aggressive, and production environments.

Properties

Link copied to clipboard

Multiplier for exponential backoff

Link copied to clipboard

Initial delay before first retry

Link copied to clipboard
val jitterFactor: Double = 0.1

Random jitter factor (0.0 to 1.0)

Link copied to clipboard
val maxAttempts: Int = 3

Maximum number of attempts (including initial)

Link copied to clipboard

Maximum delay between retries

Link copied to clipboard

Patterns to identify retryable errors

Link copied to clipboard

Optional extractor for retry-after hints