Spaces:
Running
Running
Update assistants.py
Browse files- assistants.py +3 -6
assistants.py
CHANGED
@@ -152,6 +152,7 @@ def execute_tool_call(tool_call):
|
|
152 |
except json.JSONDecodeError as e:
|
153 |
print(f"Error parsing function name '{name}' function args '{args_json}': {e}")
|
154 |
|
|
|
155 |
gr.Info(f"Function: {name}, args: {args}", duration=30)
|
156 |
|
157 |
return tools[name](**args)
|
@@ -171,13 +172,9 @@ def execute_tool_calls(run_steps):
|
|
171 |
for tool_call in step_details.tool_calls:
|
172 |
print(get_json("tool_call", tool_call))
|
173 |
|
174 |
-
func_name = ""
|
175 |
-
|
176 |
if hasattr(tool_call, "function"):
|
177 |
-
|
178 |
-
|
179 |
-
tool_call_ids.append(tool_call.id)
|
180 |
-
tool_call_results.append(execute_tool_call(tool_call))
|
181 |
else:
|
182 |
gr.Info(f"Tool: {tool_call.type}", duration=30)
|
183 |
|
|
|
152 |
except json.JSONDecodeError as e:
|
153 |
print(f"Error parsing function name '{name}' function args '{args_json}': {e}")
|
154 |
|
155 |
+
#if tool_call.function.output == None:
|
156 |
gr.Info(f"Function: {name}, args: {args}", duration=30)
|
157 |
|
158 |
return tools[name](**args)
|
|
|
172 |
for tool_call in step_details.tool_calls:
|
173 |
print(get_json("tool_call", tool_call))
|
174 |
|
|
|
|
|
175 |
if hasattr(tool_call, "function"):
|
176 |
+
tool_call_ids.append(tool_call.id)
|
177 |
+
tool_call_results.append(execute_tool_call(tool_call))
|
|
|
|
|
178 |
else:
|
179 |
gr.Info(f"Tool: {tool_call.type}", duration=30)
|
180 |
|