airflow.providers.common.ai.managed_agents.failover¶
Attributes¶
Classes¶
Active/passive failover across interchangeable managed agents. |
Module Contents¶
- class airflow.providers.common.ai.managed_agents.failover.FailoverManagedAgentClient(members, *, failover_on=(Exception,))[source]¶
Active/passive failover across interchangeable managed agents.
Members are tried in order and the first answer wins. The group is itself a
ManagedAgentClient, so a toolset built over it presents a single tool and the calling model has no say in which provider serves the request: the policy stays deterministic Python rather than a prompt instruction a model may ignore. Groups nest.Members must be substitutable: the same agent deployed twice, not two specialists over different data. Two containerized agents built from one image qualify; an agent bound to one platform’s own objects does not, because there is nothing equivalent to fail over to. The group cannot check this.
What it can check is conversation state. A failover starts a fresh conversation on the standby, which is correct for a one-shot consultation and wrong for a multi-turn one, so the group never reports
capabilities.sessionsand refuses a request that carries asession_id, whatever its members support.- Parameters:
members (collections.abc.Sequence[airflow.providers.common.ai.managed_agents.base.ManagedAgentClient]) – Interchangeable clients, tried in order. At least two.
failover_on (tuple[type[BaseException], ...]) – Exception types that move to the next member. Defaults to
Exceptionbecausecommon.aicannot enumerate the cloud SDKs’ exception trees. Narrow it when the members’ exception types are known.ManagedAgentRejectednever triggers failover, whatever this is set to: the standby would reject the same prompt.
- property members: tuple[airflow.providers.common.ai.managed_agents.base.ManagedAgentClient, ...][source]¶
- property capabilities: airflow.providers.common.ai.managed_agents.base.ManagedAgentCapabilities[source]¶
The intersection of the members’, except sessions, which a group never offers.