Spaces:
Sleeping
Sleeping
Update prompts.py
Browse files- prompts.py +24 -18
prompts.py
CHANGED
@@ -4,50 +4,56 @@ from langchain.prompts import PromptTemplate
|
|
4 |
classification_prompt_str = """
|
5 |
You are a helpful assistant that classifies user questions into three categories:
|
6 |
1) "Wellness" if the question involves health, nutrition, fitness, mental well-being, self-care, or research related to these.
|
7 |
-
2) "Brand" if the question
|
8 |
-
3) "OutOfScope" if it
|
9 |
|
10 |
**Response format**:
|
11 |
-
Reply exactly with one word: "Wellness", "Brand", or "OutOfScope".
|
12 |
|
13 |
Question: {query}
|
14 |
"""
|
15 |
|
|
|
16 |
tailor_prompt_str = """
|
17 |
-
You are a helpful assistant for DailyWellnessAI. Your
|
18 |
|
19 |
Here's the response to tailor:
|
20 |
{response}
|
21 |
|
22 |
-
Tailor it to
|
23 |
-
-
|
24 |
-
-
|
25 |
-
-
|
26 |
|
27 |
-
Provide the revised response below:
|
28 |
"""
|
29 |
|
|
|
30 |
cleaner_prompt_str = """
|
31 |
-
You are a helpful AI.
|
32 |
|
33 |
-
1) CSV (Knowledge Base) Answer
|
34 |
{kb_answer}
|
35 |
|
36 |
-
2) Web Search Result
|
37 |
{web_answer}
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
42 |
|
43 |
-
|
44 |
"""
|
45 |
|
|
|
46 |
refusal_prompt_str = """
|
47 |
-
This question
|
48 |
-
|
|
|
49 |
"""
|
50 |
|
|
|
51 |
# Now we define the PromptTemplate objects:
|
52 |
classification_prompt = PromptTemplate(
|
53 |
template=classification_prompt_str,
|
|
|
4 |
classification_prompt_str = """
|
5 |
You are a helpful assistant that classifies user questions into three categories:
|
6 |
1) "Wellness" if the question involves health, nutrition, fitness, mental well-being, self-care, or research related to these.
|
7 |
+
2) "Brand" if the question specifically pertains to 'DailyWellnessAI'—its mission, disclaimers, features, policies, etc.
|
8 |
+
3) "OutOfScope" if it does not fall into the above two categories.
|
9 |
|
10 |
**Response format**:
|
11 |
+
Reply exactly with one word: "Wellness", "Brand", or "OutOfScope". Do not provide any additional explanation.
|
12 |
|
13 |
Question: {query}
|
14 |
"""
|
15 |
|
16 |
+
|
17 |
tailor_prompt_str = """
|
18 |
+
You are a helpful assistant for DailyWellnessAI. Your role is to simplify complex ideas and offer actionable, user-friendly advice that aligns with our mission to enhance daily wellness through AI.
|
19 |
|
20 |
Here's the response to tailor:
|
21 |
{response}
|
22 |
|
23 |
+
Tailor it to ensure:
|
24 |
+
- Simplicity and clarity.
|
25 |
+
- Practicality, with actionable recommendations where appropriate.
|
26 |
+
- Alignment with DailyWellnessAI's mission of simplifying daily wellness through AI.
|
27 |
|
28 |
+
Provide the revised, concise response below:
|
29 |
"""
|
30 |
|
31 |
+
|
32 |
cleaner_prompt_str = """
|
33 |
+
You are a helpful AI. Below, you have two sources of information:
|
34 |
|
35 |
+
1) CSV (Knowledge Base) Answer:
|
36 |
{kb_answer}
|
37 |
|
38 |
+
2) Web Search Result:
|
39 |
{web_answer}
|
40 |
|
41 |
+
Your task:
|
42 |
+
- Combine and synthesize the two into a single, clear, cohesive answer.
|
43 |
+
- Avoid duplication or irrelevant details.
|
44 |
+
- Present the final response in straightforward, user-friendly language.
|
45 |
|
46 |
+
Do not repeat content verbatim. Merge the information meaningfully and provide your synthesized answer below:
|
47 |
"""
|
48 |
|
49 |
+
|
50 |
refusal_prompt_str = """
|
51 |
+
This question doesn’t directly fall under the categories of daily wellness or questions about the DailyWellnessAI brand.
|
52 |
+
However, a simple benefit of this topic is that it could contribute to wellness in the sense that [briefly explain a connection, e.g., it promotes mindfulness, relaxation, balance, etc.].
|
53 |
+
For more in-depth wellness insights or questions about DailyWellnessAI, feel free to ask!
|
54 |
"""
|
55 |
|
56 |
+
|
57 |
# Now we define the PromptTemplate objects:
|
58 |
classification_prompt = PromptTemplate(
|
59 |
template=classification_prompt_str,
|