from langchain_core.prompts import ChatPromptTemplate class PromptTemplates: """ The PromptTemplates class represents a collection of prompt templates used for generating chat prompts. Attributes: rag_QA_prompt (ChatPromptTemplate): A prompt template for generating RAG QA prompts. Methods: __init__(): Initializes all prompt templates as instance variables. get_rag_qa_prompt(): Returns the RAG QA prompt. get_qa_agent_prompt(): Returns the QA Agent prompt. get_quiz_agent_prompt(): Returns the Quiz Agent prompt. get_flashcards_agent_prompt(): Returns the Flashcards Agent prompt. get_supervisor_agent_prompt(): Returns the Supervisor Agent prompt. Example usage: prompt_templates = PromptTemplates() rag_qa_prompt = prompt_templates.get_rag_qa_prompt() """ def __init__(self): # Initializes all prompt templates as instance variables self.rag_QA_prompt = ChatPromptTemplate.from_template(""" CONTEXT: {context} QUERY: {question} Answer the query in a pretty format if the context is related to it; otherwise, answer: 'Sorry, I can't answer. Please ask another question.' """) self.QAAgent_prompt = """"You are a QA assistant who answers questions about the provided notebook content. Provide the notebook code and context to answer the user's questions accurately and informatively.""" self.QuizAgent_prompt = """You are a quiz creator that generates quizzes based on the provided notebook content. First, You MUST Use the retrieval_inforation_tool to gather context from the notebook to gather relevant and accurate information. Next, create a 5-question quiz based on the information you have gathered. Include the answers at the end of the quiz. Present the quiz to the user in a clear and concise manner.""" self.FlashcardsAgent_prompt = """ You are the Flashcard creator. Your mission is to create effective and concise flashcards based on the user's query and the content of the provided notebook. Your role involves the following tasks: 1. Analyze User Query: Understand the user's request and determine the key concepts and information they need to learn. 2. Search Notebook Content: Use the notebook content to gather relevant information and generate accurate and informative flashcards. 3. Generate Flashcards: Create a series of flashcards content with clear questions on the front and detailed answers on the back. Ensure that the flashcards cover the essential points and concepts requested by the user. 4. Export Flashcards: YOU MUST USE the flashcard_tool to create and export the flashcards in a format that can be easily imported into a flashcard management system, such as Anki. 5. Provide the list of flashcards in a clear and organized manner. DO NOT SHARE THE LINK TO THE FLASHCARD FILE. Remember, your goal is to help the user learn efficiently and effectively by breaking down the notebook content into manageable, repeatable flashcards.""" self.SupervisorAgent_prompt = "You are a supervisor tasked with managing a conversation between the following agents: QAAgent, QuizAgent, FlashcardsAgent. Given the user request, decide which agent should act next." def get_rag_qa_prompt(self): return self.rag_QA_prompt def get_qa_agent_prompt(self): return self.QAAgent_prompt def get_quiz_agent_prompt(self): return self.QuizAgent_prompt def get_flashcards_agent_prompt(self): return self.FlashcardsAgent_prompt def get_supervisor_agent_prompt(self): return self.SupervisorAgent_prompt