Spaces:
Runtime error
Runtime error
Update query_data.py
Browse files- query_data.py +3 -3
query_data.py
CHANGED
@@ -3,7 +3,7 @@ from langchain.llms import OpenAI
|
|
3 |
from langchain.chains import ChatVectorDBChain
|
4 |
|
5 |
_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
|
6 |
-
You can assume the question about the
|
7 |
|
8 |
Chat History:
|
9 |
{chat_history}
|
@@ -11,10 +11,10 @@ Follow Up Input: {question}
|
|
11 |
Standalone question:"""
|
12 |
CONDENSE_QUESTION_PROMPT = PromptTemplate.from_template(_template)
|
13 |
|
14 |
-
template = """You are an AI assistant for answering questions about
|
15 |
You are given the following extracted parts of a long document and a question. Provide a conversational answer.
|
16 |
If you don't know the answer, just say "Hmm, I'm not sure." Don't try to make up an answer.
|
17 |
-
If the question is not about
|
18 |
Question: {question}
|
19 |
=========
|
20 |
{context}
|
|
|
3 |
from langchain.chains import ChatVectorDBChain
|
4 |
|
5 |
_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
|
6 |
+
You can assume the question about the syllabus of the H2 Economics A-Level Examination in Singapore.
|
7 |
|
8 |
Chat History:
|
9 |
{chat_history}
|
|
|
11 |
Standalone question:"""
|
12 |
CONDENSE_QUESTION_PROMPT = PromptTemplate.from_template(_template)
|
13 |
|
14 |
+
template = """You are an AI assistant for answering questions about economics for the H2 Economics A-Levels.
|
15 |
You are given the following extracted parts of a long document and a question. Provide a conversational answer.
|
16 |
If you don't know the answer, just say "Hmm, I'm not sure." Don't try to make up an answer.
|
17 |
+
If the question is not about H2 Economics, politely inform them that you are tuned to only answer questions about it.
|
18 |
Question: {question}
|
19 |
=========
|
20 |
{context}
|