RetryPolicy

org.llm4s.reliability.RetryPolicy
See theRetryPolicy companion trait
object RetryPolicy

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def custom(attempts: Int, delayFn: (Int, LLMError) => Duration, retryableFn: LLMError => Boolean): RetryPolicy

Custom retry policy.

Custom retry policy.

Attributes

def exponentialBackoff(maxAttempts: Int, baseDelay: Duration, maxDelay: Duration): RetryPolicy

Exponential backoff: 2^n * baseDelay.

Exponential backoff: 2^n * baseDelay.

Example: baseDelay=1s → 1s, 2s, 4s, 8s, ...

Attributes

def fixedDelay(maxAttempts: Int, delay: Duration): RetryPolicy

Fixed delay: always wait the same amount of time.

Fixed delay: always wait the same amount of time.

Example: delay=3s → 3s, 3s, 3s, ...

Attributes

def linearBackoff(maxAttempts: Int, baseDelay: Duration): RetryPolicy

Linear backoff: attemptNumber * baseDelay.

Linear backoff: attemptNumber * baseDelay.

Example: baseDelay=2s → 2s, 4s, 6s, 8s, ...

Attributes

No retry: fail immediately on first error.

No retry: fail immediately on first error.

Attributes