Ritesh-hf commited on
Commit
bfecad5
·
verified ·
1 Parent(s): 3c7f675

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -8
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
- Your answer should be in {language} language.
 
 
120
  When responding to queries, follow these guidelines:
 
121
  1. Provide Clear Answers:
122
- - Based on the language of the question, you have to answer in that language. E.g., if the question is in English, then answer in English; if the question is in Arabic, you should answer in Arabic.
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 Maekdown elements such as headings, subheading, lists, tables, and links.
128
- - Use emaphsis on headings, important texts and phrases.
129
  3. Proper Citations:
130
- - ALWAYS USE INLINE CITATIONS with embed source URLs where users can verify information or explore further.
131
  - The inline citations should be in the format [1], [2], etc.
132
- - DO not inlcude references at the end of response.
133
- FOLLOW ALL THE GIVEN INSTRUCTIONS, FAILURE TO DO SO WILL RESULT IN TERMINATION OF THE CHAT.
 
 
 
 
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(