airflow.providers.common.ai.durable.member_stamp¶
Record which member of a FallbackModel chain answered a model request.
Attributes¶
Classes¶
Stamp each response with the |
Functions¶
|
Return the |
|
Return the connection ID of the chain member that produced |
Module Contents¶
- airflow.providers.common.ai.durable.member_stamp.MEMBER_STAMP_KEY = '__airflow_common_ai__'[source]¶
- airflow.providers.common.ai.durable.member_stamp.get_member_model_id(response)[source]¶
Return the
model_idof the chain member that producedresponse, if it was stamped.
- airflow.providers.common.ai.durable.member_stamp.get_member_conn_id(response)[source]¶
Return the connection ID of the chain member that produced
response, if it was stamped with one.
- class airflow.providers.common.ai.durable.member_stamp.MemberStampingModel(wrapped, *, conn_id=None)[source]¶
Bases:
pydantic_ai.models.wrapper.WrapperModelStamp each response with the
model_idof the wrapped model.pydantic-ai’s
FallbackModelonly records which member answered on suspended responses, so a durable replay cannot otherwise tell whether the recorded answer came from a model that is still in the chain. The stamp lives under its own key rather than the__pydantic_ai__namespace that pydantic-ai owns.The hook also passes the ID of the connection the model came from, so a replay can tell two connections that serve the same model apart. It is a name, not an identity: it says nothing about the connection’s host or credentials. A member built without one stamps only the model.