Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -182,14 +182,17 @@ def generate_tool_outputs(tool_call_ids, tool_call_results):
|
|
182 |
tool_outputs = []
|
183 |
|
184 |
for tool_call_id, tool_call_result in zip(tool_call_ids, tool_call_results):
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
|
|
|
|
|
|
193 |
tool_outputs.append(tool_output)
|
194 |
|
195 |
return tool_outputs
|
|
|
182 |
tool_outputs = []
|
183 |
|
184 |
for tool_call_id, tool_call_result in zip(tool_call_ids, tool_call_results):
|
185 |
+
try:
|
186 |
+
tool_output = {
|
187 |
+
"tool_call_id": tool_call_id,
|
188 |
+
"output": tool_call_result.to_json()
|
189 |
+
}
|
190 |
+
except AttributeError:
|
191 |
+
tool_output = {
|
192 |
+
"tool_call_id": tool_call_id,
|
193 |
+
"output": tool_call_result
|
194 |
+
}
|
195 |
+
|
196 |
tool_outputs.append(tool_output)
|
197 |
|
198 |
return tool_outputs
|