Skip to main content

FailoverManager

Defined in the failover module.
Rust AI Agent SDK Manages failover between multiple LLM auth profiles. Provides automatic failover when rate limits or errors occur, with configurable retry behavior and cooldown periods.

Fields

Methods

new

Create a new failover manager. Parameters:

default_config

Create with default config.

add_profile

Add an auth profile. Parameters:

remove_profile

Remove a profile by name. Parameters:

get_profile

Get a profile by name. Parameters:

get_profile_mut

Get a mutable profile by name. Parameters:

list_profiles

List all profiles.

get_next_profile

Get the next available profile. Returns profiles in priority order, skipping those that are rate limited or in cooldown.

mark_failure

Mark a profile as failed. Parameters:

mark_success

Mark a profile as successful. Parameters:

on_failover

Register a callback for failover events. Parameters:

get_retry_delay

Calculate retry delay for an attempt. Parameters:

status

Get failover manager status.

reset_all

Reset all profiles to available status.

len

Get the number of profiles.

is_empty

Check if empty.

Source

View on GitHub

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

Rust Failover

Rust Retry