From 5e91928607dd2d2a1b71a526ceb9d3770b00e08d Mon Sep 17 00:00:00 2001 From: Krulknul <85589076+Krulknul@users.noreply.github.com> Date: Tue, 28 Mar 2023 00:04:03 +0200 Subject: [PATCH] Added `.as_retriever()` to `from_llm()` calls (#2051) --- docs/modules/chains/index_examples/chat_vector_db.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/modules/chains/index_examples/chat_vector_db.ipynb b/docs/modules/chains/index_examples/chat_vector_db.ipynb index c47d48334e..98d3ee9734 100644 --- a/docs/modules/chains/index_examples/chat_vector_db.ipynb +++ b/docs/modules/chains/index_examples/chat_vector_db.ipynb @@ -121,7 +121,7 @@ }, "outputs": [], "source": [ - "qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), vectorstore)" + "qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), vectorstore.as_retriever())" ] }, { @@ -230,7 +230,7 @@ "metadata": {}, "outputs": [], "source": [ - "qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), vectorstore, return_source_documents=True)" + "qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), vectorstore.as_retriever(), return_source_documents=True)" ] }, { @@ -292,7 +292,7 @@ "metadata": {}, "outputs": [], "source": [ - "qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), vectorstore, return_source_documents=True)\n", + "qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), vectorstore.as_retriever(), return_source_documents=True)\n", "chat_history = []\n", "query = \"What did the president say about Ketanji Brown Jackson\"\n", "result = qa({\"question\": query, \"chat_history\": chat_history, \"vectordbkwargs\": vectordbkwargs})"