danielcwq commited on
Commit
6779167
·
1 Parent(s): 14e8c79

Update query_data.py

Browse files
Files changed (1) hide show
  1. query_data.py +4 -4
query_data.py CHANGED
@@ -15,7 +15,7 @@ from langchain.schema import (
15
  SystemMessage
16
  )
17
 
18
- system_template = """Use the following pieces of context to answer the users question.
19
  If you don't know the answer, just say that you don't know, don't try to make up an answer.
20
  ----------------
21
  {context}"""
@@ -27,7 +27,7 @@ messages = [
27
  prompt = ChatPromptTemplate.from_messages(messages)
28
 
29
  _template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
30
- You can assume the question about the syllabus of the H2 Economics, H2 History and H2 Geography A-Level Examinations in Singapore.
31
 
32
  Chat History:
33
  {chat_history}
@@ -35,10 +35,10 @@ Follow Up Input: {question}
35
  Standalone question:"""
36
  CONDENSE_QUESTION_PROMPT = PromptTemplate.from_template(_template)
37
 
38
- #template = """You are an AI assistant for answering questions about history, geography or economics for the H2 A-Levels.
39
  #You are given the following extracted parts of a long document and a question. Provide a conversational answer.
40
  #If you don't know the answer, just say "Hmm, I'm not sure." Don't try to make up an answer.
41
- #If the question is not about history, geography or economics, politely inform them that you are tuned to only answer questions about it.
42
  #Question: {question}
43
  #=========
44
  #{context}
 
15
  SystemMessage
16
  )
17
 
18
+ system_template = """Use the following pieces of context to answer the user's question. Use only the context to answer the question.
19
  If you don't know the answer, just say that you don't know, don't try to make up an answer.
20
  ----------------
21
  {context}"""
 
27
  prompt = ChatPromptTemplate.from_messages(messages)
28
 
29
  _template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.
30
+ You can assume the question about the law case between Review Publishing Company Limited and Lee Hsien Loong in Singapore.
31
 
32
  Chat History:
33
  {chat_history}
 
35
  Standalone question:"""
36
  CONDENSE_QUESTION_PROMPT = PromptTemplate.from_template(_template)
37
 
38
+ #template = """You are an AI assistant for answering questions about the law case.
39
  #You are given the following extracted parts of a long document and a question. Provide a conversational answer.
40
  #If you don't know the answer, just say "Hmm, I'm not sure." Don't try to make up an answer.
41
+ #If the question is not about law, politely inform them that you are tuned to only answer questions about it.
42
  #Question: {question}
43
  #=========
44
  #{context}