ArturG9 commited on
Commit
b279902
1 Parent(s): f5769a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -15
app.py CHANGED
@@ -174,22 +174,12 @@ def create_conversational_rag_chain(retriever):
174
  verbose=False,
175
  )
176
 
177
- template = """ You are an assistant for question-answering tasks**
178
- **Given the context (format: dictionary) and question, provide a comprehensive answer in natural language that addresses the question directly.**
179
-
180
- **You should not use personal opinions when answering questions; instead you must rely solely upon context**
181
-
182
- The context contains documents with a 'page_content' field and potentially other metadata. Focus on the 'page_content' field for information retrieval.
183
-
184
- When answering, prioritize including all relevant details from the context to support your response. Avoid yes/no answers or simple options (A, B, etc.).
185
-
186
- **In the answer, use only English language. DO NOT ASK more questions by yourself!**
187
-
188
- **Question:** {question}
189
- **Context:** {context}
190
- Answer:
191
  """
192
- prompt = ChatPromptTemplate.from_template(template, role='ai')
 
193
 
194
 
195
  rag_chain = prompt | llm | StrOutputParser()
 
174
  verbose=False,
175
  )
176
 
177
+ template = """Answer the question based only on the following context:
178
+ {context}
179
+ Question: {question}
 
 
 
 
 
 
 
 
 
 
 
180
  """
181
+ prompt = ChatPromptTemplate.from_template(template)
182
+
183
 
184
 
185
  rag_chain = prompt | llm | StrOutputParser()