Lee-W commented on code in PR #76801:
URL: https://github.com/apache/airflow/pull/76801#discussion_r4615664670
##########
providers/common/ai/tests/unit/common/ai/hooks/test_pydantic_ai.py:
##########
@@ -867,12 +877,21 @@ def test_param_builds_chain_in_order(self, registry,
infer_model_stub):
model = hook.get_conn()
assert isinstance(model, FallbackModel)
- assert model.models == [
+ assert get_chain_members(model) == [
infer_model_stub.models["openai:gpt-5.6-sol"],
infer_model_stub.models["anthropic:claude-opus-4-6"],
infer_model_stub.models["groq:llama-4"],
]
+ def test_every_chain_member_is_stamped_with_its_model_id(self, registry,
infer_model_stub):
+ registry.add("primary", extra={"model": "openai:gpt-5.6-sol"})
+ registry.add("second", extra={"model": "anthropic:claude-opus-4-6"})
+
+ model = PydanticAIHook(llm_conn_id="primary",
fallback_conn_ids=["second"]).get_conn()
+
+ assert isinstance(model, FallbackModel)
+ assert all(isinstance(member, MemberStampingModel) for member in
model.models)
Review Comment:
Rewrote it: the first member of a hook-built chain fails, the second
answers, and the test checks `get_member_model_id` on the response.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]