Spaces:
Runtime error
Runtime error
Update prompts.py
Browse files- prompts.py +15 -0
prompts.py
CHANGED
@@ -29,6 +29,12 @@ NEWS_ASSISTANT_PROMPT = \
|
|
29 |
Aim for a comprehensive overview that informs readers about recent developments
|
30 |
and their potential impact."""
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
def generate_news_prompt(query, news_data):
|
33 |
today = datetime.now().strftime("%Y-%m-%d")
|
34 |
prompt = f"Based on the following recent news about user query: {query}, create a well rounded news report, well formatted using markdown format:'Today's date is {today}."
|
@@ -36,4 +42,13 @@ def generate_news_prompt(query, news_data):
|
|
36 |
prompt += f"Title: {item['title']}\n"
|
37 |
prompt += f"Snippet: {item['snippet']}\n"
|
38 |
prompt += f"Last Updated: {item['last_updated']}\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
return prompt
|
|
|
29 |
Aim for a comprehensive overview that informs readers about recent developments
|
30 |
and their potential impact."""
|
31 |
|
32 |
+
RESEARCH_ASSISTANT_PROMPT = \
|
33 |
+
"""You are an expert writer capable of writing beautifully formatted answers in markdown formatting using internet search results.
|
34 |
+
1. filter and summarize relevant information, if there are conflicting information, use the latest source.
|
35 |
+
2. use it to construct a clear and factual answer.
|
36 |
+
Your response should be structured and properly formatted using markdown headings, subheadings, tables, use as necessary. Ignore Links and references
|
37 |
+
"""
|
38 |
def generate_news_prompt(query, news_data):
|
39 |
today = datetime.now().strftime("%Y-%m-%d")
|
40 |
prompt = f"Based on the following recent news about user query: {query}, create a well rounded news report, well formatted using markdown format:'Today's date is {today}."
|
|
|
42 |
prompt += f"Title: {item['title']}\n"
|
43 |
prompt += f"Snippet: {item['snippet']}\n"
|
44 |
prompt += f"Last Updated: {item['last_updated']}\n\n"
|
45 |
+
return prompt
|
46 |
+
|
47 |
+
def generate_research_prompt(query, search_data):
|
48 |
+
today = datetime.now().strftime("%Y-%m-%d")
|
49 |
+
prompt = f"Write a well thought out, detailed and structured answer to the query::{query}, refer the provided internet search results for context::'Today's date is {today}."
|
50 |
+
for item in search_data:
|
51 |
+
prompt += f"Title: {item['title']}\n"
|
52 |
+
prompt += f"Snippet: {item['snippet']}\n"
|
53 |
+
prompt += f"Last Updated: {item['last_updated']}\n\n"
|
54 |
return prompt
|