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

NameTypeDescription
max_retriesu32Maximum retry attempts per request
retry_delayf64Base delay between retries (seconds)
exponential_backoffboolWhether to use exponential backoff
max_retry_delayf64Maximum retry delay (seconds)
cooldown_on_rate_limitf64Cooldown duration for rate limits (seconds)
cooldown_on_errorf64Cooldown duration for errors (seconds)
rotate_on_successboolWhether to rotate profiles on success

Methods

new

rust
fn new() -> Self

Create a new config with defaults

max_retries

rust
fn max_retries(mut self, retries: u32) -> Self

Set max retries

Parameters:

NameType
retriesu32

retry_delay

rust
fn retry_delay(mut self, delay: f64) -> Self

Set retry delay

Parameters:

NameType
delayf64

exponential_backoff

rust
fn exponential_backoff(mut self, enabled: bool) -> Self

Set exponential backoff

Parameters:

NameType
enabledbool

max_retry_delay

rust
fn max_retry_delay(mut self, delay: f64) -> Self

Set max retry delay

Parameters:

NameType
delayf64

cooldown_on_rate_limit

rust
fn cooldown_on_rate_limit(mut self, seconds: f64) -> Self

Set cooldown on rate limit

Parameters:

NameType
secondsf64

cooldown_on_error

rust
fn cooldown_on_error(mut self, seconds: f64) -> Self

Set cooldown on error

Parameters:

NameType
secondsf64

Source

View on GitHub

praisonai/src/failover/mod.rs at line 211


Related Documentation