Package com.google.genai.types
Class HttpRetryOptions
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.HttpRetryOptions
HTTP retry options to be used in each of the requests.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for HttpRetryOptions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattempts()Maximum number of attempts, including the original request.static HttpRetryOptions.Builderbuilder()Instantiates a builder for HttpRetryOptions.expBase()Multiplier by which the delay increases after each attempt.static HttpRetryOptionsDeserializes a JSON string to a HttpRetryOptions object.List of HTTP status codes that should trigger a retry.Initial delay before the first retry, in fractions of a second.jitter()Randomness factor for the delay.maxDelay()Maximum delay between retries, in fractions of a second.abstract HttpRetryOptions.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
HttpRetryOptions
public HttpRetryOptions()
-
-
Method Details
-
attempts
Maximum number of attempts, including the original request. If 0 or 1, it means no retries. If not specified, default to 5. -
initialDelay
Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second. -
maxDelay
Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds. -
expBase
Multiplier by which the delay increases after each attempt. If not specified, default to 2.0. -
jitter
Randomness factor for the delay. If not specified, default to 1.0. -
httpStatusCodes
List of HTTP status codes that should trigger a retry. If not specified, a default set of retryable codes (408, 429, and 5xx) may be used. -
builder
Instantiates a builder for HttpRetryOptions. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a HttpRetryOptions object.
-