Commit
·
bfbd754
1
Parent(s):
425fab4
Update utils.py
Browse files
utils.py
CHANGED
@@ -50,6 +50,7 @@ def ask_and_get_answer(vector_store, q, k=3):
|
|
50 |
from langchain.chat_models import ChatOpenAI
|
51 |
# choose the 3.5 turbo model which is default and set the temperature to 1 which is maximum
|
52 |
llm = ChatOpenAI(model='gpt-3.5-turbo', temperature=1)
|
|
|
53 |
retriever = vector_store.as_retriever(search_type='similarity', search_kwargs={'k': k})
|
54 |
chain = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
|
55 |
answer = chain.run(q)
|
|
|
50 |
from langchain.chat_models import ChatOpenAI
|
51 |
# choose the 3.5 turbo model which is default and set the temperature to 1 which is maximum
|
52 |
llm = ChatOpenAI(model='gpt-3.5-turbo', temperature=1)
|
53 |
+
#VectorStoreRetrieverMemory stores memories in a VectorDB and queries the top-K most "salient" docs every time it is called.
|
54 |
retriever = vector_store.as_retriever(search_type='similarity', search_kwargs={'k': k})
|
55 |
chain = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=retriever)
|
56 |
answer = chain.run(q)
|