Spaces:
Running
Running
""" | |
Prompt configuration. | |
""" | |
from datetime import datetime | |
from langchain.prompts.prompt import PromptTemplate | |
from langchain.prompts import ChatPromptTemplate | |
from langchain_core.prompts import ChatPromptTemplate | |
interprate_question_sharepoint_template = """ | |
whatever is asked, just answer only {{}}""" | |
PROMPT_INTERPRATE_INTENTION_SHAREPOINT = ChatPromptTemplate.from_template( | |
interprate_question_sharepoint_template | |
) | |
interprate_question_template = ( | |
"""You are an assistant that have to identify the object of a question. | |
A user asks a question about meeting decisions. | |
If the question is about a particular meeting, identified by a meeting number, answer only 'meeting <meeting number>'. | |
Otherwise answer only 'other'. | |
Example: | |
Q: What decision was taken at meeting 123th? | |
R: meeting 123 | |
Q: Give me an example of a decision that applied a penalty to a country? | |
R: autre | |
""" | |
"La question est la suivante: {query}." | |
) | |
PROMPT_INTERPRATE_INTENTION = ChatPromptTemplate.from_template( | |
interprate_question_template | |
) | |
current_date = datetime.now().strftime('%d/%m/%Y') | |
company_name = "UNEP" # to change | |
answering_template = ( | |
f"You are an AI Assistant by Ekimetrics for {company_name}. " | |
f"Your task is to help {company_name} employees. " | |
"You will be given a question and extracted parts of documents." | |
"Provide a clear and structured answer based on the context provided. " | |
"When relevant, use bullet points and lists to structure your answers. " | |
"Whenever you use information from a document, reference it at the end of the sentence (ex: [doc 2]). " | |
"You don't have to use all documents, only if it makes sense in the conversation. " | |
"If no relevant information to answer the question is present in the documents, " | |
"just say you don't have enough information to answer.\n\n" | |
"{context}\n\n" | |
"Question: {question}" | |
) | |
ANSWER_PROMPT = ChatPromptTemplate.from_template(answering_template) |