OSSS.ai.orchestration.error_policies¶
OSSS.ai.orchestration.error_policies
¶
Error policies for LangGraph nodes and OSSS execution.
This module provides centralized error handling policies, retry configurations, and circuit breaker decorators for robust LangGraph node execution.
ErrorPolicyType
¶
Bases: Enum
Types of error handling policies.
FallbackStrategy
¶
Bases: Enum
Fallback strategies for failed nodes.
PolicyRetryConfig
¶
Bases: BaseModel
Configuration for retry behavior.
Migrated from dataclass to Pydantic BaseModel for enhanced validation, serialization, and integration with the OSSS Pydantic ecosystem.
CircuitBreakerConfig
¶
Bases: BaseModel
Configuration for circuit breaker behavior.
Migrated from dataclass to Pydantic BaseModel for enhanced validation, serialization, and integration with the OSSS Pydantic ecosystem.
ErrorPolicy
¶
Bases: BaseModel
Comprehensive error handling policy.
Migrated from dataclass to Pydantic BaseModel for enhanced validation, serialization, and integration with the OSSS Pydantic ecosystem.
LangGraphExecutionError
¶
Bases: Exception
Wrapper for LangGraph node execution errors.
CircuitBreaker
¶
ErrorPolicyManager
¶
get_error_policy_manager()
¶
Get the global error policy manager.
retry_with_policy(node_name)
¶
Decorator for retry behavior based on error policy.
circuit_breaker_policy(node_name)
¶
Decorator for circuit breaker behavior.
timeout_policy(node_name)
¶
Decorator for timeout handling.
comprehensive_error_policy(node_name)
¶
Comprehensive decorator combining all error policies.
handle_node_fallback(node_name, error, fallback_strategy, context=None)
¶
Handle fallback behavior for failed nodes.
get_error_statistics()
¶
Get error handling statistics.