Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -116,7 +116,7 @@ history_aware_retriever = create_history_aware_retriever(llm, retriever, context
|
|
116 |
# QA system prompt and chain
|
117 |
qa_system_prompt = """ You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively.
|
118 |
If you don't know the answer, simply state that you don't know.
|
119 |
-
YOUR ANSWER SHOULD BE IN '{
|
120 |
When responding to queries, follow these guidelines:
|
121 |
1. Provide Clear Answers:
|
122 |
- You have to answer in that language based on the given language of the answer. If it is English, answer it in English; if it is Arabic, you should answer it in Arabic.
|
@@ -206,7 +206,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
206 |
await stream_response()
|
207 |
except Exception as e:
|
208 |
print(f"Error during message handling: {e}")
|
209 |
-
await websocket.send_json({'response': "Something went wrong, Please try again."
|
210 |
except WebSocketDisconnect:
|
211 |
print(f"Client disconnected: {websocket.client}")
|
212 |
if session_id:
|
|
|
116 |
# QA system prompt and chain
|
117 |
qa_system_prompt = """ You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively.
|
118 |
If you don't know the answer, simply state that you don't know.
|
119 |
+
YOUR ANSWER SHOULD BE IN '{language}' LANGUAGE.
|
120 |
When responding to queries, follow these guidelines:
|
121 |
1. Provide Clear Answers:
|
122 |
- You have to answer in that language based on the given language of the answer. If it is English, answer it in English; if it is Arabic, you should answer it in Arabic.
|
|
|
206 |
await stream_response()
|
207 |
except Exception as e:
|
208 |
print(f"Error during message handling: {e}")
|
209 |
+
await websocket.send_json({'response': "Something went wrong, Please try again."})
|
210 |
except WebSocketDisconnect:
|
211 |
print(f"Client disconnected: {websocket.client}")
|
212 |
if session_id:
|