cayu.sessions.ModelFailoverPolicy
Part of cayu.sessions.base. Read the Python API overview and install the required extra.
from cayu.sessions import ModelFailoverPolicyBounded, explicit alternatives after an eligible ordinary model failure.
The primary target is resolved by the run entrance. max_total_attempts
includes that primary’s attempts and all same-provider retries, not just
transitions between targets. This value never authorizes dispatch itself.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
fallbacks |
tuple[ModelTarget, ...] |
Field(min_length=1, max_length=7) |
max_total_attempts |
StrictInt |
Field(default=20, ge=1, le=80) |
copy_fallbacks (method)
Section titled “copy_fallbacks (method)”ModelFailoverPolicy.copy_fallbacks(value: object) -> tuple[ModelTarget, ...]resolve_targets (method)
Section titled “resolve_targets (method)”ModelFailoverPolicy.resolve_targets(primary: ModelTarget) -> tuple[ModelTarget, ...]Copy and validate the ordered plan, including its resolved primary.