RetryPolicy

org.llm4s.reliability.RetryPolicy
See theRetryPolicy companion object
@Stable
sealed trait RetryPolicy

Retry policy for transient failures.

Defines how many times to retry and how long to wait between attempts.

Attributes

Companion
object
Source
RetryPolicy.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def delayFor(attemptNumber: Int, error: LLMError): FiniteDuration

Calculate delay before next retry attempt.

Calculate delay before next retry attempt.

Value parameters

attemptNumber

The attempt number (1-indexed)

error

The error that triggered the retry

Attributes

Returns

Delay duration before next attempt

Source
RetryPolicy.scala

The most attempts one call makes, the first included: 3 is the first try and up to two retries, 1 is no retry.

The most attempts one call makes, the first included: 3 is the first try and up to two retries, 1 is no retry.

Attributes

Source
RetryPolicy.scala

Concrete methods

Whether this policy sends the request again after error.

Whether this policy sends the request again after error.

By default it is the library's one rule, org.llm4s.error.LLMError.isRetryable: ReliableClient applies it through this method, and the agent graph's node retries use the same rule. noRetry retries nothing, and a custom policy may decide differently.

Attributes

Source
RetryPolicy.scala