Shreyas094 commited on
Commit
3d9b407
·
verified ·
1 Parent(s): 4ee7feb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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"""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,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"""Based on the following web search results about '{query}' and considering the context: {context},
64
- please create a comprehensive news article.
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 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}
 
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}