Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,7 +41,7 @@ def get_web_search_results(query: str, max_results: int = 10) -> List[Dict[str,
|
|
| 41 |
def rephrase_query(original_query: str, conversation_manager: ConversationManager) -> str:
|
| 42 |
context = conversation_manager.get_context()
|
| 43 |
if context:
|
| 44 |
-
prompt = f"""
|
| 45 |
|
| 46 |
Context: {context}
|
| 47 |
|
|
@@ -60,11 +60,11 @@ def summarize_results(query: str, search_results: List[Dict[str, str]], model: s
|
|
| 60 |
context = conversation_manager.get_context()
|
| 61 |
search_context = "\n\n".join([f"Title: {result['title']}\nContent: {result['body']}" for result in search_results])
|
| 62 |
|
| 63 |
-
prompt = f"""
|
| 64 |
-
|
| 65 |
Include key facts, relevant statistics, and expert opinions if available.
|
| 66 |
-
Ensure the article is well-structured with an introduction, main body, and conclusion.
|
| 67 |
-
Address the query in the context of the ongoing conversation
|
| 68 |
Cite sources directly within the generated text and not at the end of the generated text, integrating URLs where appropriate to support the information provided:
|
| 69 |
|
| 70 |
{search_context}
|
|
|
|
| 41 |
def rephrase_query(original_query: str, conversation_manager: ConversationManager) -> str:
|
| 42 |
context = conversation_manager.get_context()
|
| 43 |
if context:
|
| 44 |
+
prompt = f"""You are a highly intelligent conversational chatbot. You have been given the following context and a new query, rephrase the query to make it more specific and contextual. Provide ONLY the rephrased query without any additional explanation:
|
| 45 |
|
| 46 |
Context: {context}
|
| 47 |
|
|
|
|
| 60 |
context = conversation_manager.get_context()
|
| 61 |
search_context = "\n\n".join([f"Title: {result['title']}\nContent: {result['body']}" for result in search_results])
|
| 62 |
|
| 63 |
+
prompt = f"""You are a highly intelligene & expert analyst and your job is to skillfully articulate the web search results web search results about '{query}' and considering the context: {context},
|
| 64 |
+
You have to create a comprehensive news summary FOCUSING on the context provided to you.
|
| 65 |
Include key facts, relevant statistics, and expert opinions if available.
|
| 66 |
+
Ensure the article is well-structured with an introduction, main body, and conclusion, IF NECESSARY.
|
| 67 |
+
Address the query in the context of the ongoing conversation IF APPLICABLE.
|
| 68 |
Cite sources directly within the generated text and not at the end of the generated text, integrating URLs where appropriate to support the information provided:
|
| 69 |
|
| 70 |
{search_context}
|