Spaces:
Runtime error
Runtime error
Feature: generic prompts
Browse files
streamlit_langchain_chat/prompts.py
CHANGED
@@ -20,7 +20,7 @@ summary_prompt = prompts.PromptTemplate(
|
|
20 |
|
21 |
qa_template = """Write an answer for the user's question below solely based on the provided context.
|
22 |
If the user does not specify how many words the answer should be, the length of the answer should be {length}.
|
23 |
-
If the context is irrelevant, reply "Your question falls outside the scope of
|
24 |
For each sentence in your answer, indicate which sources most support it via valid citation markers at the end of sentences, like (Example2012).
|
25 |
Answer in an unbiased and professional tone.
|
26 |
Make clear what is your opinion.
|
@@ -39,10 +39,9 @@ qa_prompt = prompts.PromptTemplate(
|
|
39 |
template=qa_template,
|
40 |
)
|
41 |
|
42 |
-
# usado por GPCL
|
43 |
qa_prompt_GPCL = prompts.PromptTemplate(
|
44 |
input_variables=["question", "context_str"],
|
45 |
-
template="You are an AI assistant providing helpful advice about
|
46 |
"You should only provide hyperlinks that reference the context below. Do NOT make up hyperlinks."
|
47 |
'If you can not find the answer in the context below, just say "Hmm, I am not sure. Could you please rephrase your question?" Do not try to make up an answer.'
|
48 |
"If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context.\n\n"
|
@@ -76,7 +75,7 @@ citation_prompt = prompts.PromptTemplate(
|
|
76 |
partial_variables={"date": _get_datetime},
|
77 |
)
|
78 |
|
79 |
-
system_template = """You are an AI chatbot with knowledge of
|
80 |
You sometimes refuse to answer if there is insufficient information.
|
81 |
If the user does not specify a language, answer in the language of the user's question. """
|
82 |
system_message_prompt = SystemMessagePromptTemplate.from_template(system_template)
|
|
|
20 |
|
21 |
qa_template = """Write an answer for the user's question below solely based on the provided context.
|
22 |
If the user does not specify how many words the answer should be, the length of the answer should be {length}.
|
23 |
+
If the context is irrelevant, reply "Your question falls outside the scope of these documents, so I cannot answer".
|
24 |
For each sentence in your answer, indicate which sources most support it via valid citation markers at the end of sentences, like (Example2012).
|
25 |
Answer in an unbiased and professional tone.
|
26 |
Make clear what is your opinion.
|
|
|
39 |
template=qa_template,
|
40 |
)
|
41 |
|
|
|
42 |
qa_prompt_GPCL = prompts.PromptTemplate(
|
43 |
input_variables=["question", "context_str"],
|
44 |
+
template="You are an AI assistant providing helpful advice about an organization's documents and or policies. You are given the following extracted parts of a long document and a question. Provide a conversational answer based on the context provided."
|
45 |
"You should only provide hyperlinks that reference the context below. Do NOT make up hyperlinks."
|
46 |
'If you can not find the answer in the context below, just say "Hmm, I am not sure. Could you please rephrase your question?" Do not try to make up an answer.'
|
47 |
"If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context.\n\n"
|
|
|
75 |
partial_variables={"date": _get_datetime},
|
76 |
)
|
77 |
|
78 |
+
system_template = """You are an AI chatbot with knowledge of an organization's documents and/or policies that answers in an unbiased, professional tone.
|
79 |
You sometimes refuse to answer if there is insufficient information.
|
80 |
If the user does not specify a language, answer in the language of the user's question. """
|
81 |
system_message_prompt = SystemMessagePromptTemplate.from_template(system_template)
|