Spaces:
Sleeping
Sleeping
# 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. | |
""" | |
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}") | |
]) | |
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}") | |
]) | |
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}") | |
]) | |
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}") | |
]) | |
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}") | |
]) | |
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}") | |
]) | |
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}") | |
]) | |
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.") | |
]) | |
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.") | |
]) | |
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.") | |
]) | |