JevRetryPolicy

org.llm4s.jev.JevRetryPolicy
See theJevRetryPolicy companion object
final case class JevRetryPolicy

How JevClient retries a transient failure.

The defaults are those of TypeSafe's own client SDKs (https://docs.typesafe.ai/sdk/python/api/retries.md): two retries after the first attempt, a first delay of 0.5 s that doubles up to 5 s with a quarter of each delay randomly taken off, and a budget of 30 s for the whole call. A delay the server asked for (Retry-After or retry-after-ms) replaces the computed one. What is retried is LLM4S's one retry rule, org.llm4s.reliability.RetryPolicy.isTransient: a 408, a 429, a 5xx (the API's 529 Overloaded too), and a connection failure or timeout. A rejected credential (401, 403), an invalid request (400, 422) and a cancellation are never retried.

Value parameters

backoffInitial

the first delay, doubled for each further retry

backoffMax

the longest computed delay

budget

the longest a call may take, attempts and delays together: each attempt's HTTP timeout is capped at what is left of it, and no retry is started whose delay would reach what is left

jitter

the fraction of each computed delay that is randomly taken off, from 0 to 1

maxRetries

retries after the first attempt; 0 sends each request once

Attributes

Companion
object
Source
JevRetryPolicy.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Checks the policy; the first problem is reported, naming the setting.

Checks the policy; the first problem is reported, naming the setting.

Attributes

Source
JevRetryPolicy.scala

Attributes

Source
JevRetryPolicy.scala

Attributes

Source
JevRetryPolicy.scala
def withMaxRetries(maxRetries: Int): JevRetryPolicy

Attributes

Source
JevRetryPolicy.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product