Spaces:
Sleeping
Sleeping
File size: 2,009 Bytes
26ed9d3 |
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 |
"""
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) |