from langchain import PromptTemplate | |
EXAMPLE_PROMPT = PromptTemplate( | |
template=">Course Description\n{page_content}\n----------\nSource: {course}", | |
input_variables=["page_content", "course"], | |
) | |
template =""" | |
You are a study counsellor for KTH. | |
Given the following extracted parts of course descriptions and a question, create a short final answer with references ("SOURCES"). | |
If you don't know the answer, just say that you don't know. Don't try to make up an answer. | |
Just answer the question and don't add any extra information. | |
Only return sources that contain the answer to the question. | |
ALWAYS return a "SOURCES" part in your answer. | |
QUESTION: {question} | |
========= | |
{context} | |
========= | |
FINAL ANSWER:""" | |
PROMPT = PromptTemplate(template=template, input_variables=["question", "context"]) |