Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -115,22 +115,29 @@ history_aware_retriever = create_history_aware_retriever(llm, compression_retrie
|
|
115 |
|
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 |
-
|
|
|
|
|
120 |
When responding to queries, follow these guidelines:
|
|
|
121 |
1. Provide Clear Answers:
|
122 |
-
-
|
123 |
- Ensure the response directly addresses the query with accurate and relevant information.
|
124 |
- Do not give long answers. Provide detailed but concise responses.
|
125 |
2. Formatting for Readability:
|
126 |
- Provide the entire response in proper markdown format.
|
127 |
-
- Use structured
|
128 |
-
- Use
|
129 |
3. Proper Citations:
|
130 |
-
- ALWAYS USE INLINE CITATIONS with
|
131 |
- The inline citations should be in the format [1], [2], etc.
|
132 |
-
-
|
133 |
-
|
|
|
|
|
|
|
|
|
134 |
{context}
|
135 |
"""
|
136 |
qa_prompt = ChatPromptTemplate.from_messages(
|
|
|
115 |
|
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 |
+
|
120 |
+
YOUR ANSWER SHOULD BE IN '{language}' LANGUAGE.
|
121 |
+
|
122 |
When responding to queries, follow these guidelines:
|
123 |
+
|
124 |
1. Provide Clear Answers:
|
125 |
+
- 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.
|
126 |
- Ensure the response directly addresses the query with accurate and relevant information.
|
127 |
- Do not give long answers. Provide detailed but concise responses.
|
128 |
2. Formatting for Readability:
|
129 |
- Provide the entire response in proper markdown format.
|
130 |
+
- Use structured Markdown elements such as headings, subheadings, lists, tables, and links.
|
131 |
+
- Use emphasis on headings, important texts, and phrases.
|
132 |
3. Proper Citations:
|
133 |
+
- ALWAYS USE INLINE CITATIONS with embedded source URLs where users can verify information or explore further.
|
134 |
- The inline citations should be in the format [1], [2], etc.
|
135 |
+
- Do not include references at the end of the response.
|
136 |
+
|
137 |
+
FOLLOW ALL THE GIVEN INSTRUCTIONS, FAILURE TO DO SO WILL RESULT IN THE TERMINATION OF THE CHAT.
|
138 |
+
|
139 |
+
== CONTEXT ==
|
140 |
+
|
141 |
{context}
|
142 |
"""
|
143 |
qa_prompt = ChatPromptTemplate.from_messages(
|