Failover Config • Rust AI Agent SDK
FailoverConfig: Configuration for failover behavior.
FailoverConfig
Defined in the failover module.
Rust AI Agent SDK
Configuration for failover behavior.
Fields
| Name | Type | Description |
|---|---|---|
max_retries | u32 | Maximum retry attempts per request |
retry_delay | f64 | Base delay between retries (seconds) |
exponential_backoff | bool | Whether to use exponential backoff |
max_retry_delay | f64 | Maximum retry delay (seconds) |
cooldown_on_rate_limit | f64 | Cooldown duration for rate limits (seconds) |
cooldown_on_error | f64 | Cooldown duration for errors (seconds) |
rotate_on_success | bool | Whether to rotate profiles on success |
Methods
new
fn new() -> SelfCreate a new config with defaults
max_retries
fn max_retries(mut self, retries: u32) -> SelfSet max retries
Parameters:
| Name | Type |
|---|---|
retries | u32 |
retry_delay
fn retry_delay(mut self, delay: f64) -> SelfSet retry delay
Parameters:
| Name | Type |
|---|---|
delay | f64 |
exponential_backoff
fn exponential_backoff(mut self, enabled: bool) -> SelfSet exponential backoff
Parameters:
| Name | Type |
|---|---|
enabled | bool |
max_retry_delay
fn max_retry_delay(mut self, delay: f64) -> SelfSet max retry delay
Parameters:
| Name | Type |
|---|---|
delay | f64 |
cooldown_on_rate_limit
fn cooldown_on_rate_limit(mut self, seconds: f64) -> SelfSet cooldown on rate limit
Parameters:
| Name | Type |
|---|---|
seconds | f64 |
cooldown_on_error
fn cooldown_on_error(mut self, seconds: f64) -> SelfSet cooldown on error
Parameters:
| Name | Type |
|---|---|
seconds | f64 |
Source
View on GitHubpraisonai/src/failover/mod.rs at line 211