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:
734
734
try :
735
735
function , parsed_arguments = self ._get_func_and_args (tool_call )
736
736
return function (** parsed_arguments ) if parsed_arguments else function ()
737
- except TypeError as e :
737
+ except Exception as e : # pylint: disable=broad-exception-caught
738
738
error_message = f"Error executing function '{ tool_call .function .name } ': { e } "
739
739
logging .error (error_message )
740
740
# 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:
745
745
class AsyncFunctionTool (BaseFunctionTool ):
746
746
747
747
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
-
750
748
try :
749
+ function , parsed_arguments = self ._get_func_and_args (tool_call )
751
750
if inspect .iscoroutinefunction (function ):
752
751
return await function (** parsed_arguments ) if parsed_arguments else await function ()
753
752
return function (** parsed_arguments ) if parsed_arguments else function ()
754
- except TypeError as e :
753
+ except Exception as e : # pylint: disable=broad-exception-caught
755
754
error_message = f"Error executing function '{ tool_call .function .name } ': { e } "
756
755
logging .error (error_message )
757
756
# 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