🐛 fix(chat.py): change the prefix of the error message to 'data' to fix the server response

The error message prefix was changed from 'data' to 'error' to fix the server response.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-15 15:08:04 -03:00
commit 265646ded3

View file

@ -109,7 +109,7 @@ async def stream_build(flow_id: str):
chat_manager.set_cache(flow_id, graph.build())
except Exception as exc:
logger.error("Error while building the flow: %s", exc)
yield f"data: {json.dumps({'error': str(exc)})}\n\n"
yield f"error: {json.dumps({'error': str(exc)})}\n\n"
finally:
yield f"data: {final_response}\n\n"