File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
sdk/ai/azure-ai-projects/azure/ai/projects/models Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -734,7 +734,7 @@ def execute(self, tool_call: RequiredFunctionToolCall) -> Any:
734734 try :
735735 function , parsed_arguments = self ._get_func_and_args (tool_call )
736736 return function (** parsed_arguments ) if parsed_arguments else function ()
737- except TypeError as e :
737+ except Exception as e : # pylint: disable=broad-exception-caught
738738 error_message = f"Error executing function '{ tool_call .function .name } ': { e } "
739739 logging .error (error_message )
740740 # Return error message as JSON string back to agent in order to make possible self
@@ -745,13 +745,12 @@ def execute(self, tool_call: RequiredFunctionToolCall) -> Any:
745745class AsyncFunctionTool (BaseFunctionTool ):
746746
747747 async def execute (self , tool_call : RequiredFunctionToolCall ) -> Any : # pylint: disable=invalid-overridden-method
748- function , parsed_arguments = self ._get_func_and_args (tool_call )
749-
750748 try :
749+ function , parsed_arguments = self ._get_func_and_args (tool_call )
751750 if inspect .iscoroutinefunction (function ):
752751 return await function (** parsed_arguments ) if parsed_arguments else await function ()
753752 return function (** parsed_arguments ) if parsed_arguments else function ()
754- except TypeError as e :
753+ except Exception as e : # pylint: disable=broad-exception-caught
755754 error_message = f"Error executing function '{ tool_call .function .name } ': { e } "
756755 logging .error (error_message )
757756 # Return error message as JSON string back to agent in order to make possible self correction
You can’t perform that action at this time.
0 commit comments