retry_policy
A retry policy can be attached to any client<llm>
and will attempt to retry requests that fail due to a network error.
BAML
Usage:
BAML
Fields
max_retries
Number of additional retries to attempt after the initial request fails.
strategy
The strategy to use for retrying requests. Default is constant_delay(delay_ms=200)
.
Example:
BAML
Strategies
constant_delay
type
Configures to the constant delay strategy.
delay_ms
The delay in milliseconds to wait between retries. Default: 200
exponential_backoff
type
Configures to the exponential backoff strategy.
delay_ms
The initial delay in milliseconds to wait between retries. Default: 200
multiplier
The multiplier to apply to the delay after each retry. Default: 1.5
max_delay_ms
The maximum delay in milliseconds to wait between retries. Default: 10000