SameerMesiah97 commented on code in PR #71853:
URL: https://github.com/apache/airflow/pull/71853#discussion_r3816773649


##########
providers/common/ai/src/airflow/providers/common/ai/toolsets/hook.py:
##########
@@ -136,7 +141,10 @@ async def call_tool(
     ) -> Any:
         method_name = name.removeprefix(self._tool_name_prefix) if 
self._tool_name_prefix else name
         method: Callable[..., Any] = getattr(self._hook, method_name)
-        result = method(**tool_args)
+        try:
+            result = method(**tool_args)
+        except Exception as e:
+            raise ModelRetry(f"The {name} tool failed: {e}") from e

Review Comment:
   Does this not catch every error, including non-transient ones? I looked at 
PR **#71445** and it appears you only catch `SQLSafetyError` there. Can this be 
narrowed to exceptions the model can reasonably recover from?



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