Skip to main content

Module error_classifier

Module error_classifier 

Source
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

CategoryMeaningFailover?
"timeout"Operation exceeded time limitYes
"rate_limited"Provider returned HTTP 429Yes
"http_5xx"Provider returned server errorYes
"connect_error"Network/connection failureYes
"context_length"Input exceeded model context windowNo
"other"Unknown or unclassified errorConfig

Structs§

FailoverConfig
Configuration for which error categories should trigger failover.
FailoverResult
Result of a failover-aware execution.

Functions§

classify_agent_error
Classify an AgentError into a stable category string.
classify_llm_error
Classify an LlmError into a stable category string.