Spaces:
Running
Running
Update prompts.py
Browse files- prompts.py +33 -51
prompts.py
CHANGED
@@ -1,54 +1,36 @@
|
|
1 |
# prompts.py #
|
2 |
|
3 |
from datetime import datetime
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
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}."
|
41 |
-
for item in news_data:
|
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_search_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
|
|
|
1 |
# prompts.py #
|
2 |
|
3 |
from datetime import datetime
|
4 |
+
marpit_example = """
|
5 |
+
---
|
6 |
+
marp: true
|
7 |
+
theme: default
|
8 |
+
paginate: true
|
9 |
+
style: |
|
10 |
+
section {
|
11 |
+
background-color: #;
|
12 |
+
font-family: ;
|
13 |
+
}
|
14 |
+
h1, h2 {
|
15 |
+
color: ;
|
16 |
+
border-bottom: ;
|
17 |
+
padding-bottom: ;
|
18 |
+
}
|
19 |
+
ul, ol {
|
20 |
+
color: ;
|
21 |
+
}
|
22 |
+
strong {
|
23 |
+
color: ;
|
24 |
+
}
|
25 |
+
img {
|
26 |
+
border-radius: ;
|
27 |
+
box-shadow: ;
|
28 |
+
}
|
29 |
+
---
|
30 |
+
"""
|
31 |
+
# Initialize OpenAI client (assuming you have set up the API key)
|
32 |
+
PRESENTATION_SYSTEM_PROMPT = f"""You are a Markdown Presentation maker using Marp formatting.
|
33 |
+
1. Enclose the output presentation in following tags <marp_presentation>presentation in marp format</marp_presentation>,
|
34 |
+
2. start the presentation using the following section {marpit_example},
|
35 |
+
3. use --- to add a new page"
|
36 |
+
4. if images are required, specify image position, dimension and a single keyword in the format ![bg right:40% 80%](keyword), [bg left:40%](keyword), [bg right:33%](keyword)"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|