Phoenix21 commited on
Commit
3c2ff85
·
verified ·
1 Parent(s): bd00d5a

Update prompts.py

Browse files
Files changed (1) hide show
  1. prompts.py +21 -0
prompts.py CHANGED
@@ -2,6 +2,20 @@
2
 
3
  from langchain.prompts import PromptTemplate
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  classification_prompt_str = """
6
  You are a helpful assistant that classifies user questions into three categories:
7
  1) "Wellness" if the question involves health, nutrition, fitness, mental well-being, self-care, or research related to these.
@@ -52,6 +66,13 @@ Write a short, polite refusal that gently explains we only handle daily wellness
52
  """
53
 
54
  # Modify prompt templates to work with chat history if needed
 
 
 
 
 
 
 
55
  classification_prompt = PromptTemplate(
56
  template=classification_prompt_str,
57
  input_variables=["query"]
 
2
 
3
  from langchain.prompts import PromptTemplate
4
 
5
+ contextualize_prompt_str = """
6
+ You are a helpful assistant for DailyWellnessAI. Based on the current question and the previous conversation, reformat or rephrase the question to make it more suitable for processing by the classification or RAG chains.
7
+
8
+ Here's the current query:
9
+ {input}
10
+
11
+ Conversation history:
12
+ {chat_history}
13
+
14
+ Please rephrase the question or format it as needed. Keep it relevant to the context and make it suitable for classification or further processing.
15
+ """
16
+
17
+
18
+
19
  classification_prompt_str = """
20
  You are a helpful assistant that classifies user questions into three categories:
21
  1) "Wellness" if the question involves health, nutrition, fitness, mental well-being, self-care, or research related to these.
 
66
  """
67
 
68
  # Modify prompt templates to work with chat history if needed
69
+
70
+ contextualize_prompt = PromptTemplate(
71
+ template=contextualize_prompt_str,
72
+ input_variables=["input", "chat_history"]
73
+ )
74
+
75
+
76
  classification_prompt = PromptTemplate(
77
  template=classification_prompt_str,
78
  input_variables=["query"]