Lee-W commented on code in PR #76801:
URL: https://github.com/apache/airflow/pull/76801#discussion_r4677667700


##########
providers/common/ai/src/airflow/providers/common/ai/durable/capability.py:
##########
@@ -808,6 +830,37 @@ def _decode_tool_payload(payload: Any) -> Any:
     raise DurableJournalError(f"durable execution found a tool result it 
cannot replay: {kind!r}")
 
 
+def _is_stamped_chain(model: Model) -> TypeGuard[FallbackModel]:
+    return isinstance(model, FallbackModel) and all(
+        isinstance(member, MemberStampingModel) for member in model.models
+    )
+
+
+def _find_unusable_answerer(response: ModelResponse, model: Model) -> str | 
None:
+    """Return why a recorded response cannot replay into ``model``'s chain, or 
``None`` if it can."""
+    if not _is_stamped_chain(model):
+        return None
+    if (member_model_id := get_member_model_id(response)) is None:
+        return _UNSTAMPED_ANSWERER
+    member_conn_id = get_member_conn_id(response)
+    answerers = {
+        (member.conn_id, member.model_id)
+        for member in model.models
+        if isinstance(member, MemberStampingModel)

Review Comment:
   updated. thanks!



-- 
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]

Reply via email to