ArturG9 commited on
Commit
6d73054
·
verified ·
1 Parent(s): e67ed14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -174,19 +174,17 @@ def create_conversational_rag_chain(retriever):
174
  verbose=False,
175
  )
176
 
177
- template = """Given the question and context, provide a comprehensive answer in natural language that addresses and answers the question directly.
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
-
187
- context: {context}
188
 
189
- Answer:
 
 
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