mominah commited on
Commit
6378c3f
·
verified ·
1 Parent(s): 0240527

Update prompt_templates.py

Browse files
Files changed (1) hide show
  1. prompt_templates.py +13 -56
prompt_templates.py CHANGED
@@ -3,8 +3,8 @@ from langchain.prompts import ChatPromptTemplate
3
 
4
  class PromptTemplates:
5
  """
6
- A class to encapsulate various prompt templates for solving assignments, papers,
7
- creating quizzes, assignments, and additional tasks such as a university chatbot and answer checking.
8
  """
9
 
10
  @staticmethod
@@ -12,12 +12,7 @@ class PromptTemplates:
12
  quiz_solving_prompt = '''
13
  You are an assistant specialized in solving quizzes. Your goal is to provide accurate, concise, and contextually relevant answers.
14
  Use the following retrieved context to answer the user's question.
15
- If the context lacks sufficient information, respond with "I don't know." Do not make up answers or provide unverified information.
16
-
17
- Guidelines:
18
- 1. Extract key information from the context to form a coherent response.
19
- 2. Maintain a clear and professional tone.
20
- 3. If the question requires clarification, specify it politely.
21
 
22
  Retrieved context:
23
  {context}
@@ -36,7 +31,7 @@ class PromptTemplates:
36
  def get_assignment_solving_prompt():
37
  assignment_solving_prompt = '''
38
  You are an expert assistant specializing in solving academic assignments with clarity and precision.
39
- Your task is to provide step-by-step solutions and detailed explanations that align with the given requirements.
40
 
41
  Retrieved context:
42
  {context}
@@ -44,12 +39,6 @@ class PromptTemplates:
44
  Assignment Details:
45
  {question}
46
 
47
- Guidelines:
48
- 1. **Understand the Problem:** Analyze the assignment details to identify objectives.
49
- 2. **Provide Step-by-Step Solutions:** Break down the solution logically with examples.
50
- 3. **Explain Your Reasoning:** Offer clear explanations for each step.
51
- 4. **Maintain Academic Integrity:** Do not fabricate information.
52
-
53
  Your response:
54
  '''
55
  return ChatPromptTemplate.from_messages([
@@ -60,8 +49,8 @@ class PromptTemplates:
60
  @staticmethod
61
  def get_paper_solving_prompt():
62
  paper_solving_prompt = '''
63
- You are an expert assistant specialized in solving academic papers with precision and clarity.
64
- Your task is to provide well-structured answers to the questions in the paper, ensuring accuracy, depth, and adherence to instructions.
65
 
66
  Retrieved context:
67
  {context}
@@ -69,12 +58,6 @@ class PromptTemplates:
69
  Paper Information:
70
  {question}
71
 
72
- Instructions:
73
- 1. **Understand Each Question:** Identify requirements for each question.
74
- 2. **Provide Structured Responses:** Use clear sections for your answer.
75
- 3. **Support with Explanations:** Include examples or reasoning where applicable.
76
- 4. **Follow Formatting Guidelines:** Ensure your response is properly formatted.
77
-
78
  Your response:
79
  '''
80
  return ChatPromptTemplate.from_messages([
@@ -86,7 +69,7 @@ class PromptTemplates:
86
  def get_quiz_creation_prompt():
87
  quiz_creation_prompt = '''
88
  You are an expert assistant specializing in creating engaging and educational quizzes.
89
- Your task is to design a quiz based on the topic, difficulty level, and format specified.
90
 
91
  Retrieved context:
92
  {context}
@@ -94,12 +77,6 @@ class PromptTemplates:
94
  Quiz Details:
95
  Topic: {question}
96
 
97
- Guidelines:
98
- 1. **Relevance:** All questions should relate directly to the topic.
99
- 2. **Clarity:** Write questions in clear, concise language.
100
- 3. **Diversity:** Include a variety of question types.
101
- 4. **Answer Key:** Provide correct answers or explanations.
102
-
103
  Your quiz:
104
  '''
105
  return ChatPromptTemplate.from_messages([
@@ -111,7 +88,7 @@ class PromptTemplates:
111
  def get_assignment_creation_prompt():
112
  assignment_creation_prompt = '''
113
  You are an expert assistant specializing in designing assignments.
114
- Your task is to create a comprehensive assignment based on the provided topic, target audience, and desired outcomes.
115
 
116
  Retrieved context:
117
  {context}
@@ -119,12 +96,6 @@ class PromptTemplates:
119
  Assignment Details:
120
  Topic: {question}
121
 
122
- Guidelines:
123
- 1. **Alignment:** Ensure tasks relate closely to the topic.
124
- 2. **Clear Instructions:** Provide detailed instructions.
125
- 3. **Encourage Critical Thinking:** Include questions that prompt analysis.
126
- 4. **Optional Rubric:** Include evaluation criteria if needed.
127
-
128
  Your assignment:
129
  '''
130
  return ChatPromptTemplate.from_messages([
@@ -135,8 +106,8 @@ class PromptTemplates:
135
  @staticmethod
136
  def get_paper_creation_prompt():
137
  paper_creation_prompt = '''
138
- You are an expert assistant specializing in creating comprehensive academic papers.
139
- Your task is to design a complete paper based on the specified topic, audience, format, and difficulty level.
140
 
141
  Retrieved context:
142
  {context}
@@ -144,12 +115,6 @@ class PromptTemplates:
144
  Paper Details:
145
  Subject/Topic: {question}
146
 
147
- Guidelines:
148
- 1. **Relevance:** Ensure the paper aligns with the subject.
149
- 2. **Clarity:** Use clear, concise language.
150
- 3. **Diversity:** Incorporate various question types.
151
- 4. **Grading Scheme:** Provide suggested marks and answer key if applicable.
152
-
153
  Your paper:
154
  '''
155
  return ChatPromptTemplate.from_messages([
@@ -163,11 +128,6 @@ class PromptTemplates:
163
  You are a university chatbot. Your role is to answer questions related to admissions, programs, campus life, and academic services.
164
  Your responses should be accurate, friendly, and informative.
165
 
166
- Guidelines:
167
- 1. Use a professional and courteous tone.
168
- 2. Provide concise and relevant information.
169
- 3. If unsure, ask for more details.
170
-
171
  Retrieved context:
172
  {context}
173
 
@@ -185,8 +145,7 @@ class PromptTemplates:
185
  def get_check_quiz_prompt():
186
  check_quiz_prompt = '''
187
  You are an evaluator bot specialized in checking quiz answers.
188
- The student answer and the original answer key are provided below.
189
- Your task is to compare the two and provide constructive feedback.
190
 
191
  Student Answer:
192
  {student_answer}
@@ -205,8 +164,7 @@ class PromptTemplates:
205
  def get_check_assignment_prompt():
206
  check_assignment_prompt = '''
207
  You are an evaluator bot specialized in checking assignment answers.
208
- The student answer and the original answer key are provided below.
209
- Your task is to compare the two and provide detailed feedback with explanations.
210
 
211
  Student Answer:
212
  {student_answer}
@@ -225,8 +183,7 @@ class PromptTemplates:
225
  def get_check_paper_prompt():
226
  check_paper_prompt = '''
227
  You are an evaluator bot specialized in checking academic paper answers.
228
- The student answer and the original answer key are provided below.
229
- Your task is to compare the two and offer detailed feedback, highlighting strengths and areas for improvement.
230
 
231
  Student Answer:
232
  {student_answer}
 
3
 
4
  class PromptTemplates:
5
  """
6
+ Encapsulates various prompt templates for solving and creating academic content,
7
+ a university chatbot, and evaluating student answers.
8
  """
9
 
10
  @staticmethod
 
12
  quiz_solving_prompt = '''
13
  You are an assistant specialized in solving quizzes. Your goal is to provide accurate, concise, and contextually relevant answers.
14
  Use the following retrieved context to answer the user's question.
15
+ If the context lacks sufficient information, respond with "I don't know." Do not fabricate answers.
 
 
 
 
 
16
 
17
  Retrieved context:
18
  {context}
 
31
  def get_assignment_solving_prompt():
32
  assignment_solving_prompt = '''
33
  You are an expert assistant specializing in solving academic assignments with clarity and precision.
34
+ Your task is to provide step-by-step solutions and detailed explanations.
35
 
36
  Retrieved context:
37
  {context}
 
39
  Assignment Details:
40
  {question}
41
 
 
 
 
 
 
 
42
  Your response:
43
  '''
44
  return ChatPromptTemplate.from_messages([
 
49
  @staticmethod
50
  def get_paper_solving_prompt():
51
  paper_solving_prompt = '''
52
+ You are an expert assistant specialized in solving academic papers with precision.
53
+ Provide well-structured answers to the questions in the paper.
54
 
55
  Retrieved context:
56
  {context}
 
58
  Paper Information:
59
  {question}
60
 
 
 
 
 
 
 
61
  Your response:
62
  '''
63
  return ChatPromptTemplate.from_messages([
 
69
  def get_quiz_creation_prompt():
70
  quiz_creation_prompt = '''
71
  You are an expert assistant specializing in creating engaging and educational quizzes.
72
+ Design a quiz based on the specified topic.
73
 
74
  Retrieved context:
75
  {context}
 
77
  Quiz Details:
78
  Topic: {question}
79
 
 
 
 
 
 
 
80
  Your quiz:
81
  '''
82
  return ChatPromptTemplate.from_messages([
 
88
  def get_assignment_creation_prompt():
89
  assignment_creation_prompt = '''
90
  You are an expert assistant specializing in designing assignments.
91
+ Create a comprehensive assignment based on the provided topic.
92
 
93
  Retrieved context:
94
  {context}
 
96
  Assignment Details:
97
  Topic: {question}
98
 
 
 
 
 
 
 
99
  Your assignment:
100
  '''
101
  return ChatPromptTemplate.from_messages([
 
106
  @staticmethod
107
  def get_paper_creation_prompt():
108
  paper_creation_prompt = '''
109
+ You are an expert assistant specializing in creating academic papers.
110
+ Design a complete paper based on the specified topic and format.
111
 
112
  Retrieved context:
113
  {context}
 
115
  Paper Details:
116
  Subject/Topic: {question}
117
 
 
 
 
 
 
 
118
  Your paper:
119
  '''
120
  return ChatPromptTemplate.from_messages([
 
128
  You are a university chatbot. Your role is to answer questions related to admissions, programs, campus life, and academic services.
129
  Your responses should be accurate, friendly, and informative.
130
 
 
 
 
 
 
131
  Retrieved context:
132
  {context}
133
 
 
145
  def get_check_quiz_prompt():
146
  check_quiz_prompt = '''
147
  You are an evaluator bot specialized in checking quiz answers.
148
+ Compare the student answer with the original answer key and provide constructive feedback.
 
149
 
150
  Student Answer:
151
  {student_answer}
 
164
  def get_check_assignment_prompt():
165
  check_assignment_prompt = '''
166
  You are an evaluator bot specialized in checking assignment answers.
167
+ Compare the student answer with the original answer key and provide detailed feedback with explanations.
 
168
 
169
  Student Answer:
170
  {student_answer}
 
183
  def get_check_paper_prompt():
184
  check_paper_prompt = '''
185
  You are an evaluator bot specialized in checking academic paper answers.
186
+ Compare the student answer with the original answer key and offer detailed feedback, highlighting strengths and areas for improvement.
 
187
 
188
  Student Answer:
189
  {student_answer}