Phoenix21 commited on
Commit
85d62f6
·
verified ·
1 Parent(s): 7facf02

improved the prompt for the expanded answer

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -183,15 +183,14 @@ class AnswerExpander:
183
  try:
184
  reference_block = "\n".join(f"- {idx+1}) {ans}" for idx, ans in enumerate(retrieved_answers, start=1))
185
  prompt = (
186
- f"You are Daily Wellness AI, a friendly wellness expert. Below are multiple "
187
- f"potential answers retrieved from a local knowledge base. You have a user question.\n\n"
188
- f"Question: {query}\n\n"
189
- f"Retrieved Answers:\n{reference_block}\n\n"
190
- "Please synthesize these references into a single cohesive, creative, "
191
- "and brand-aligned response. Add practical tips and positivity, and end "
192
- "with a short inspirational note.\n\n"
193
- "Disclaimer: This is general wellness information, not a substitute for professional medical advice."
194
- )
195
  logger.debug(f"Generated prompt for answer expansion: {prompt}")
196
  response = self.llm._call(prompt)
197
  logger.debug(f"Expanded answer: {response}")
 
183
  try:
184
  reference_block = "\n".join(f"- {idx+1}) {ans}" for idx, ans in enumerate(retrieved_answers, start=1))
185
  prompt = (
186
+ f"You are Daily Wellness AI, a friendly wellness expert. Below are multiple "
187
+ f"potential answers retrieved from a local knowledge base. You have a user question.\n\n"
188
+ f"Question: {query}\n\n"
189
+ f"Retrieved Answers:\n{reference_block}\n\n"
190
+ "Please synthesize these references into a single cohesive, creative, and brand-aligned response. "
191
+ "Add practical tips and positivity, and end with a short inspirational note. "
192
+ "Please provide a concise response in no more than 4 sentences.\n\n"
193
+ "Disclaimer: This is general wellness information, not a substitute for professional medical advice.")
 
194
  logger.debug(f"Generated prompt for answer expansion: {prompt}")
195
  response = self.llm._call(prompt)
196
  logger.debug(f"Expanded answer: {response}")