Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -418,7 +418,7 @@ Context:
|
|
418 |
Initial Response:
|
419 |
{initial_response}
|
420 |
|
421 |
-
|
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 |
-
|
528 |
-
After
|
529 |
-
Importantly, only include information that is directly supported by the
|
|
|
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":
|