Ritesh-hf commited on
Commit
38f2a07
·
verified ·
1 Parent(s): 0b433cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -105,7 +105,7 @@ contextualize_q_prompt = ChatPromptTemplate.from_messages(
105
  history_aware_retriever = create_history_aware_retriever(llm, compression_retriever, contextualize_q_prompt)
106
 
107
  # QA system prompt and chain
108
- qa_system_prompt = """You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively. \
109
  If you don't know the answer, simply state that you don't know. \
110
  Your answer should be in {language} language. \
111
  Provide answers in proper HTML format and keep them concise. \
@@ -114,6 +114,7 @@ When responding to queries, follow these guidelines: \
114
 
115
  1. Provide Clear Answers: \
116
  - Ensure the response directly addresses the query with accurate and relevant information.\
 
117
 
118
  2. Include Detailed References: \
119
  - Links to Sources: Include URLs to credible sources where users can verify information or explore further. \
@@ -122,14 +123,14 @@ When responding to queries, follow these guidelines: \
122
 
123
  3. Formatting for Readability: \
124
  - The answer should be in a proper HTML format with appropriate tags. \
125
- - For arabic language response align the text to right and convert numbers also.
126
- - Double check if the language of answer is correct or not.
127
- - Use bullet points or numbered lists where applicable to present information clearly. \
128
  - Highlight key details using bold or italics. \
129
- - Provide proper and meaningful abbreviations for urls. Do not include naked urls. \
130
 
131
  4. Organize Content Logically: \
132
- - Structure the content in a logical order, ensuring easy navigation and understanding for the user. \
133
 
134
  {context}
135
  """
@@ -208,5 +209,4 @@ def index_view():
208
 
209
  # Main function to run the app
210
  if __name__ == '__main__':
211
- print("Hello world")
212
  socketio.run(app, debug=True)
 
105
  history_aware_retriever = create_history_aware_retriever(llm, compression_retriever, contextualize_q_prompt)
106
 
107
  # QA system prompt and chain
108
+ qa_system_prompt = """ You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively. \
109
  If you don't know the answer, simply state that you don't know. \
110
  Your answer should be in {language} language. \
111
  Provide answers in proper HTML format and keep them concise. \
 
114
 
115
  1. Provide Clear Answers: \
116
  - Ensure the response directly addresses the query with accurate and relevant information.\
117
+ - Only use information from the provided context. Using outside information may result in the termination of the chat.
118
 
119
  2. Include Detailed References: \
120
  - Links to Sources: Include URLs to credible sources where users can verify information or explore further. \
 
123
 
124
  3. Formatting for Readability: \
125
  - The answer should be in a proper HTML format with appropriate tags. \
126
+ - For Arabic language response align the text to the right and convert numbers.
127
+ - Double-check if the language of the answer is correct or not.
128
+ - Use bullet points or numbered lists where applicable to present information. \
129
  - Highlight key details using bold or italics. \
130
+ - Provide proper and meaningful abbreviations for URLs. Do not include naked URLs. \
131
 
132
  4. Organize Content Logically: \
133
+ - Structure the content logically, ensuring easy navigation and understanding for the user. \
134
 
135
  {context}
136
  """
 
209
 
210
  # Main function to run the app
211
  if __name__ == '__main__':
 
212
  socketio.run(app, debug=True)