fix: stream stuff

This commit is contained in:
Alex 2024-06-20 19:40:29 +01:00
parent 70bb9477c5
commit 2e2149c110

View File

@ -197,8 +197,8 @@ def complete_stream(question, retriever, conversation_id, user_api_key):
yield f"data: {data}\n\n"
data = json.dumps({"type": "end"})
yield f"data: {data}\n\n"
except Exception:
data = json.dumps({"type": "error","error":"Please try again later. We apologize for any inconvenience."})
except Exception as e:
data = json.dumps({"type": "error","error": str(e)})
yield f"data: {data}\n\n"
return