From d54b977d4e31f31765b8113a2c520058503d0bd9 Mon Sep 17 00:00:00 2001 From: Peter Stolz <50801264+PeterStolz@users.noreply.github.com> Date: Thu, 20 Apr 2023 19:46:51 +0200 Subject: [PATCH] Fix docstring of RetrievalQA (#3231) Structure changed an RetrievalQA now expects BaseRetriever not VectorStore --- langchain/chains/retrieval_qa/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/langchain/chains/retrieval_qa/base.py b/langchain/chains/retrieval_qa/base.py index bcc26b16f3..dc1d68bfdf 100644 --- a/langchain/chains/retrieval_qa/base.py +++ b/langchain/chains/retrieval_qa/base.py @@ -154,8 +154,9 @@ class RetrievalQA(BaseRetrievalQA): from langchain.llms import OpenAI from langchain.chains import RetrievalQA from langchain.faiss import FAISS - vectordb = FAISS(...) - retrievalQA = RetrievalQA.from_llm(llm=OpenAI(), retriever=vectordb) + from langchain.vectorstores.base import VectorStoreRetriever + retriever = VectorStoreRetriever(vectorstore=FAISS(...)) + retrievalQA = RetrievalQA.from_llm(llm=OpenAI(), retriever=retriever) """