bstraehle commited on
Commit
6e17db2
1 Parent(s): 53e2acb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
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
- tool_output = {
186
- "tool_call_id": tool_call_id,
187
- "output": try:
188
- tool_call_result.to_json()
189
- except AttributeError:
190
- tool_call_result
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