Update app.py
Browse files
app.py
CHANGED
@@ -174,19 +174,17 @@ def create_conversational_rag_chain(retriever):
|
|
174 |
verbose=False,
|
175 |
)
|
176 |
|
177 |
-
template = """Given the
|
178 |
|
179 |
-
|
180 |
|
181 |
-
|
182 |
|
183 |
-
|
184 |
-
|
185 |
-
question: {question}
|
186 |
-
|
187 |
-
context: {context}
|
188 |
|
189 |
-
|
|
|
|
|
190 |
"""
|
191 |
prompt = ChatPromptTemplate.from_template(template, role='ai')
|
192 |
|
|
|
174 |
verbose=False,
|
175 |
)
|
176 |
|
177 |
+
template = """**Given the context (format: dictionary) and question, provide a comprehensive answer in natural language that addresses the question directly.Indicate your confidence level in the answer (high, medium, low).**
|
178 |
|
179 |
+
The context contains documents with a 'page_content' field and potentially other metadata. Focus on the 'page_content' field for information retrieval.
|
180 |
|
181 |
+
When answering, prioritize including all relevant details from the context to support your response. Avoid yes/no answers or simple options (A, B, etc.).
|
182 |
|
183 |
+
**In the answer, use only English language. DO NOT ASK more questions by yourself!**
|
|
|
|
|
|
|
|
|
184 |
|
185 |
+
**Question:** {question}
|
186 |
+
**Context:** {context}
|
187 |
+
**Answer:** (confidence level)
|
188 |
"""
|
189 |
prompt = ChatPromptTemplate.from_template(template, role='ai')
|
190 |
|