Spaces:
Runtime error
Runtime error
Update streamlit_langchain_chat/prompts.py
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 "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.
|
@@ -42,7 +42,7 @@ qa_prompt = prompts.PromptTemplate(
|
|
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. You are given the following extracted parts of a long document and a question. Provide a conversational answer based on the context provided."
|
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." 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"
|
|
|
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 University of Sydney policy, 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.
|
|
|
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 University of Sydney policy. You are given the following extracted parts of a long document and a question. Provide a conversational answer based on the context provided."
|
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." 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"
|