> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Failover Config • Rust AI Agent SDK

> FailoverConfig: Configuration for failover behavior.

# FailoverConfig

> Defined in the [**failover**](../modules/failover) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

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`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create a new config with defaults

### `max_retries`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_retries(mut self, retries: u32) -> Self
```

Set max retries

**Parameters:**

| Name      | Type  |
| --------- | ----- |
| `retries` | `u32` |

### `retry_delay`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn retry_delay(mut self, delay: f64) -> Self
```

Set retry delay

**Parameters:**

| Name    | Type  |
| ------- | ----- |
| `delay` | `f64` |

### `exponential_backoff`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn exponential_backoff(mut self, enabled: bool) -> Self
```

Set exponential backoff

**Parameters:**

| Name      | Type   |
| --------- | ------ |
| `enabled` | `bool` |

### `max_retry_delay`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_retry_delay(mut self, delay: f64) -> Self
```

Set max retry delay

**Parameters:**

| Name    | Type  |
| ------- | ----- |
| `delay` | `f64` |

### `cooldown_on_rate_limit`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn cooldown_on_rate_limit(mut self, seconds: f64) -> Self
```

Set cooldown on rate limit

**Parameters:**

| Name      | Type  |
| --------- | ----- |
| `seconds` | `f64` |

### `cooldown_on_error`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn cooldown_on_error(mut self, seconds: f64) -> Self
```

Set cooldown on error

**Parameters:**

| Name      | Type  |
| --------- | ----- |
| `seconds` | `f64` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/failover/mod.rs#L211">
  `praisonai/src/failover/mod.rs` at line 211
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />

  <Card title="Rust Failover" icon="shield" href="/docs/rust/failover" />

  <Card title="Rust Retry" icon="rotate-right" href="/docs/rust/retry" />
</CardGroup>
