AuthProfile
Defined in the failover module.Rust AI Agent SDK Authentication profile for an LLM provider.
Fields
| Name | Type | Description |
|---|---|---|
name | String | Profile name for identification |
provider | String | Provider name (openai, anthropic, google, etc.) |
api_key | String | API key for authentication |
base_url | Option<String> | Optional base URL override |
model | Option<String> | Default model for this profile |
priority | i32 | Priority for failover (lower = higher priority) |
rate_limit_rpm | Option<u32> | Requests per minute limit |
rate_limit_tpm | Option<u32> | Tokens per minute limit |
status | ProviderStatus | Current status |
last_error | Option<String> | Last error message |
last_error_time | Option<Instant> | Last error timestamp |
cooldown_until | Option<Instant> | Cooldown until timestamp |
metadata | HashMap<String | Additional provider-specific configuration |
Methods
new
| Name | Type |
|---|---|
name | impl Into<String> |
provider | impl Into<String> |
api_key | impl Into<String> |
base_url
| Name | Type |
|---|---|
url | impl Into<String> |
model
| Name | Type |
|---|---|
model | impl Into<String> |
priority
| Name | Type |
|---|---|
priority | i32 |
rate_limit_rpm
| Name | Type |
|---|---|
rpm | u32 |
rate_limit_tpm
| Name | Type |
|---|---|
tpm | u32 |
metadata
| Name | Type |
|---|---|
key | impl Into<String> |
value | impl Into<String> |
is_available
mark_rate_limited
| Name | Type |
|---|---|
cooldown | Duration |
mark_error
| Name | Type |
|---|---|
error | impl Into<String> |
cooldown | Duration |
reset
Source
View on GitHub
praisonai/src/failover/mod.rs at line 59
