Commit
·
5da2e2f
1
Parent(s):
4d38190
Update query_data.py
Browse files- query_data.py +3 -2
query_data.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from langchain.prompts.prompt import PromptTemplate
|
2 |
-
from langchain.llms import
|
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.
|
@@ -22,9 +22,10 @@ Question: {question}
|
|
22 |
Answer in Markdown:"""
|
23 |
QA_PROMPT = PromptTemplate(template=template, input_variables=["question", "context"])
|
24 |
|
|
|
25 |
|
26 |
def get_chain(vectorstore):
|
27 |
-
llm =
|
28 |
qa_chain = ChatVectorDBChain.from_llm(
|
29 |
llm,
|
30 |
vectorstore,
|
|
|
1 |
from langchain.prompts.prompt import PromptTemplate
|
2 |
+
from langchain.llms import OpenAIChat
|
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.
|
|
|
22 |
Answer in Markdown:"""
|
23 |
QA_PROMPT = PromptTemplate(template=template, input_variables=["question", "context"])
|
24 |
|
25 |
+
prefix_messages = [{"role": "system", "content": "You are a helpful assistant that is very good at answering questions about conversational AI and the bot forge."}]
|
26 |
|
27 |
def get_chain(vectorstore):
|
28 |
+
llm = OpenAIChat(temperature=0,prefix_messages)
|
29 |
qa_chain = ChatVectorDBChain.from_llm(
|
30 |
llm,
|
31 |
vectorstore,
|