Spaces:
Runtime error
Runtime error
Update presentation_api.py
Browse files- presentation_api.py +4 -1
presentation_api.py
CHANGED
|
@@ -129,8 +129,11 @@ async def chat(input_data: ChatInput):
|
|
| 129 |
|
| 130 |
elif kind == "on_tool_end":
|
| 131 |
tool_output = event['data'].get('output', '')
|
|
|
|
|
|
|
|
|
|
| 132 |
yield f"{json.dumps({'type': 'tool_end', 'tool': event['name'], 'output': tool_output})}\n"
|
| 133 |
-
|
| 134 |
return EventSourceResponse(
|
| 135 |
generate(),
|
| 136 |
media_type="text/event-stream"
|
|
|
|
| 129 |
|
| 130 |
elif kind == "on_tool_end":
|
| 131 |
tool_output = event['data'].get('output', '')
|
| 132 |
+
print(type(tool_output))
|
| 133 |
+
print(type(dir(tool_output)))
|
| 134 |
+
tool_output = tool_output.pretty_repr()
|
| 135 |
yield f"{json.dumps({'type': 'tool_end', 'tool': event['name'], 'output': tool_output})}\n"
|
| 136 |
+
|
| 137 |
return EventSourceResponse(
|
| 138 |
generate(),
|
| 139 |
media_type="text/event-stream"
|