gopidesupavan commented on code in PR #69624:
URL: https://github.com/apache/airflow/pull/69624#discussion_r3545996968


##########
providers/anthropic/src/airflow/providers/anthropic/hooks/anthropic.py:
##########
@@ -409,17 +409,35 @@ def count_tokens(
             params["system"] = system
         return self.conn.messages.count_tokens(**params).input_tokens
 
-    def create_batch(self, requests: list[dict[str, Any]]) -> MessageBatch:
+    @staticmethod
+    def _apply_default_model(request: dict[str, Any], default_model: str) -> 
dict[str, Any]:
+        """
+        Fill ``params['model']`` from ``default_model`` when the request omits 
it.
+
+        The input dict is never mutated, and a request that sets its own 
``model`` is
+        returned unchanged, so a single batch can still mix models across 
requests.
+        """
+        params = request.get("params")
+        if not isinstance(params, dict) or params.get("model"):

Review Comment:
   I think there's a small edge case here. If params is None (or missing), not 
isinstance(params, dict) evaluates to True, so we return immediately and never 
get a chance to populate the default model. Was that intentional?



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