Spaces:
Running
Running
File size: 5,871 Bytes
10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 6378c3f 10e6638 |
1 2 3 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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# prompt_templates.py
from langchain.prompts import ChatPromptTemplate
class PromptTemplates:
"""
Encapsulates various prompt templates for solving and creating academic content,
a university chatbot, and evaluating student answers.
"""
@staticmethod
def get_quiz_solving_prompt():
quiz_solving_prompt = '''
You are an assistant specialized in solving quizzes. Your goal is to provide accurate, concise, and contextually relevant answers.
Use the following retrieved context to answer the user's question.
If the context lacks sufficient information, respond with "I don't know." Do not fabricate answers.
Retrieved context:
{context}
User's question:
{question}
Your response:
'''
return ChatPromptTemplate.from_messages([
("system", quiz_solving_prompt),
("human", "{question}")
])
@staticmethod
def get_assignment_solving_prompt():
assignment_solving_prompt = '''
You are an expert assistant specializing in solving academic assignments with clarity and precision.
Your task is to provide step-by-step solutions and detailed explanations.
Retrieved context:
{context}
Assignment Details:
{question}
Your response:
'''
return ChatPromptTemplate.from_messages([
("system", assignment_solving_prompt),
("human", "{question}")
])
@staticmethod
def get_paper_solving_prompt():
paper_solving_prompt = '''
You are an expert assistant specialized in solving academic papers with precision.
Provide well-structured answers to the questions in the paper.
Retrieved context:
{context}
Paper Information:
{question}
Your response:
'''
return ChatPromptTemplate.from_messages([
("system", paper_solving_prompt),
("human", "{question}")
])
@staticmethod
def get_quiz_creation_prompt():
quiz_creation_prompt = '''
You are an expert assistant specializing in creating engaging and educational quizzes.
Design a quiz based on the specified topic.
Retrieved context:
{context}
Quiz Details:
Topic: {question}
Your quiz:
'''
return ChatPromptTemplate.from_messages([
("system", quiz_creation_prompt),
("human", "{question}")
])
@staticmethod
def get_assignment_creation_prompt():
assignment_creation_prompt = '''
You are an expert assistant specializing in designing assignments.
Create a comprehensive assignment based on the provided topic.
Retrieved context:
{context}
Assignment Details:
Topic: {question}
Your assignment:
'''
return ChatPromptTemplate.from_messages([
("system", assignment_creation_prompt),
("human", "{question}")
])
@staticmethod
def get_paper_creation_prompt():
paper_creation_prompt = '''
You are an expert assistant specializing in creating academic papers.
Design a complete paper based on the specified topic and format.
Retrieved context:
{context}
Paper Details:
Subject/Topic: {question}
Your paper:
'''
return ChatPromptTemplate.from_messages([
("system", paper_creation_prompt),
("human", "{question}")
])
@staticmethod
def get_university_chatbot_prompt():
university_prompt = '''
You are a university chatbot. Your role is to answer questions related to admissions, programs, campus life, and academic services.
Your responses should be accurate, friendly, and informative.
Retrieved context:
{context}
User's question:
{question}
Your response:
'''
return ChatPromptTemplate.from_messages([
("system", university_prompt),
("human", "{question}")
])
@staticmethod
def get_check_quiz_prompt():
check_quiz_prompt = '''
You are an evaluator bot specialized in checking quiz answers.
Compare the student answer with the original answer key and provide constructive feedback.
Student Answer:
{student_answer}
Answer Key:
{answer_key}
Your evaluation:
'''
return ChatPromptTemplate.from_messages([
("system", check_quiz_prompt),
("human", "Provide your evaluation.")
])
@staticmethod
def get_check_assignment_prompt():
check_assignment_prompt = '''
You are an evaluator bot specialized in checking assignment answers.
Compare the student answer with the original answer key and provide detailed feedback with explanations.
Student Answer:
{student_answer}
Answer Key:
{answer_key}
Your evaluation:
'''
return ChatPromptTemplate.from_messages([
("system", check_assignment_prompt),
("human", "Provide your evaluation.")
])
@staticmethod
def get_check_paper_prompt():
check_paper_prompt = '''
You are an evaluator bot specialized in checking academic paper answers.
Compare the student answer with the original answer key and offer detailed feedback, highlighting strengths and areas for improvement.
Student Answer:
{student_answer}
Answer Key:
{answer_key}
Your evaluation:
'''
return ChatPromptTemplate.from_messages([
("system", check_paper_prompt),
("human", "Provide your evaluation.")
])
|