Spaces:
Runtime error
Runtime error
Update presentation_api.py
Browse files- presentation_api.py +2 -2
presentation_api.py
CHANGED
|
@@ -124,11 +124,11 @@ async def chat(input_data: ChatInput):
|
|
| 124 |
yield f"{json.dumps({'type': 'token', 'content': content})}\n"
|
| 125 |
|
| 126 |
elif kind == "on_tool_start":
|
| 127 |
-
tool_input = event['data'].get('input', '')
|
| 128 |
yield f"{json.dumps({'type': 'tool_start', 'tool': event['name'], 'input': tool_input})}\n"
|
| 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(
|
|
|
|
| 124 |
yield f"{json.dumps({'type': 'token', 'content': content})}\n"
|
| 125 |
|
| 126 |
elif kind == "on_tool_start":
|
| 127 |
+
tool_input = str(event['data'].get('input', ''))
|
| 128 |
yield f"{json.dumps({'type': 'tool_start', 'tool': event['name'], 'input': tool_input})}\n"
|
| 129 |
|
| 130 |
elif kind == "on_tool_end":
|
| 131 |
+
tool_output = str(event['data'].get('output', ''))
|
| 132 |
yield f"{json.dumps({'type': 'tool_end', 'tool': event['name'], 'output': tool_output})}\n"
|
| 133 |
|
| 134 |
return EventSourceResponse(
|