Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,6 +125,10 @@ async def echo(websocket):
|
|
| 125 |
global retriever, conversational_rag_chain
|
| 126 |
async for message in websocket:
|
| 127 |
data = json.loads(message)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
if not "message" in message:
|
| 129 |
return
|
| 130 |
if not "token" in message:
|
|
|
|
| 125 |
global retriever, conversational_rag_chain
|
| 126 |
async for message in websocket:
|
| 127 |
data = json.loads(message)
|
| 128 |
+
if data["message"]:
|
| 129 |
+
response = store
|
| 130 |
+
await websocket.send(json.dumps({"response": response}))
|
| 131 |
+
break
|
| 132 |
if not "message" in message:
|
| 133 |
return
|
| 134 |
if not "token" in message:
|