Expand description
§Error Classifier
Classifies errors into actionable categories for retry and failover decisions.
Inspired by rustic-ai’s error classification approach, this module provides classifiers that categorize errors by their error codes for decision-making.
§Categories
| Category | Meaning | Failover? |
|---|---|---|
"timeout" | Operation exceeded time limit | Yes |
"rate_limited" | Provider returned HTTP 429 | Yes |
"http_5xx" | Provider returned server error | Yes |
"connect_error" | Network/connection failure | Yes |
"context_length" | Input exceeded model context window | No |
"other" | Unknown or unclassified error | Config |
Structs§
- Failover
Config - Configuration for which error categories should trigger failover.
- Failover
Result - Result of a failover-aware execution.
Functions§
- classify_
agent_ error - Classify an
AgentErrorinto a stable category string. - classify_
llm_ error - Classify an
LlmErrorinto a stable category string.