Shreyas094 commited on
Commit
6d2edac
·
verified ·
1 Parent(s): c9f4c5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -418,7 +418,7 @@ Context:
418
  Initial Response:
419
  {initial_response}
420
 
421
- Please validate the initial response against the provided context. Remove any hallucinations, irrelevant, or factually incorrect information. Generate a revised response that is accurate and directly supported by the context. If any information cannot be verified from the context, state that explicitly. Lastly after writing the revised response, please provide a list of sources used in your response
422
 
423
  Revised Response:
424
  """
@@ -524,9 +524,10 @@ def get_response_with_search(query, model, num_calls=3, temperature=0.1):
524
 
525
  prompt = f"""Using the following context from web search results:
526
  {context}
527
- Write a detailed and complete research document that fulfills the following user request: '{query}'
528
- After writing the document, please provide a list of sources used in your response.
529
- Importantly, only include information that is directly supported by the provided context. If you're unsure about any information, state that it couldn't be verified from the given context."""
 
530
 
531
  initial_response = ""
532
  if model == "@cf/meta/llama-3.1-8b-instruct":
 
418
  Initial Response:
419
  {initial_response}
420
 
421
+ You are an expert assistant tasked with carefully validating the initial response against the provided context. Remove any hallucinations, irrelevant details, or factually incorrect information. Generate a revised response that is accurate and directly supported by the context. If any information cannot be verified from the context, explicitly state that it could not be confirmed. After writing the revised response, provide a list of all sources used.
422
 
423
  Revised Response:
424
  """
 
524
 
525
  prompt = f"""Using the following context from web search results:
526
  {context}
527
+ You are an expert assistant tasked with creating a detailed and comprehensive research document in response to the following user query: '{query}'
528
+ Base your entire response strictly on the information retrieved from trusted sources. After completing the document, provide a list of all sources used.
529
+ Importantly, only include information that is directly supported by the retrieved content.
530
+ If any part of the information cannot be verified from the given sources, clearly state that it could not be confirmed."""
531
 
532
  initial_response = ""
533
  if model == "@cf/meta/llama-3.1-8b-instruct":