Skip to content

cayu.sessions.ModelFailoverPolicy

Part of cayu.sessions.base. Read the Python API overview and install the required extra.

from cayu.sessions import ModelFailoverPolicy

Bounded, 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.

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)
ModelFailoverPolicy.copy_fallbacks(value: object) -> tuple[ModelTarget, ...]
ModelFailoverPolicy.resolve_targets(primary: ModelTarget) -> tuple[ModelTarget, ...]

Copy and validate the ordered plan, including its resolved primary.

Release source · Runtime guarantees · Capability guides