bstraehle commited on
Commit
77388e2
1 Parent(s): 08f0cb2

Update assistants.py

Browse files
Files changed (1) hide show
  1. assistants.py +7 -1
assistants.py CHANGED
@@ -124,7 +124,13 @@ def execute_tool_call(tool_call):
124
  args = {}
125
 
126
  if len(tool_call.function.arguments) > 10:
127
- args = json.loads(tool_call.function.arguments)
 
 
 
 
 
 
128
 
129
  return tools[name](**args)
130
 
 
124
  args = {}
125
 
126
  if len(tool_call.function.arguments) > 10:
127
+ args_json = ""
128
+
129
+ try:
130
+ args_json = tool_call.function.arguments
131
+ args = json.loads(args_json)
132
+ except json.JSONDecodeError as e:
133
+ print(f"Error parsing function name '{name}' function args '{args_json}': {e}")
134
 
135
  return tools[name](**args)
136