in private practice.', metadata={'source': '../../../modules/state_of_the_union.txt'})ConversationalRetrievalChain with search_distance‚ÄãIf you are using a vector store that supports filtering by search distance, you can add a threshold value parameter.vectordbkwargs = {"search_distance": 0.9}qa = ConversationalRetrievalChain.from_llm(    OpenAI(temperature=0), vectorstore.as_retriever(), return_source_documents=True)chat_history = []query = "What did the president say about Ketanji Brown Jackson"result = qa(    {"question": query, "chat_history": chat_history, "vectordbkwargs": vectordbkwargs})print(result["answer"])     The president said that Ketanji Brown Jackson is one of the nation's top legal minds and a former top litigator in private practice, and that she will continue Justice Breyer's legacy of excellence.ConversationalRetrievalChain with map_reduce‚ÄãWe can also use different types of combine document chains with the ConversationalRetrievalChain chain.from langchain.chains import LLMChainfrom langchain.chains.question_answering import load_qa_chainfrom langchain.chains.conversational_retrieval.prompts import CONDENSE_QUESTION_PROMPTquestion_generator = LLMChain(llm=llm, prompt=CONDENSE_QUESTION_PROMPT)doc_chain = load_qa_chain(llm, chain_type="map_reduce")chain = ConversationalRetrievalChain(    retriever=vectorstore.as_retriever(),    question_generator=question_generator,    combine_docs_chain=doc_chain,)chat_history = []query = "What did the president say about Ketanji Brown Jackson"result = chain({"question": query, "chat_history": chat_history})result["answer"]    " The president said that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson, who is one of the nation's top legal minds and a former top litigator in private practice."ConversationalRetrievalChain with Question Answering with sources‚ÄãYou can also use this chain with the question answering with sources chain.from langchain.chains.qa_with_sources import
This notebook is based on the chatvectordb notebook, but using Vectara as the vector database.
This notebook is based on the chatvectordb notebook, but using Vectara as the vector database. ->: in private practice.', metadata={'source': '../../../modules/state_of_the_union.txt'})ConversationalRetrievalChain with search_distance‚ÄãIf you are using a vector store that supports filtering by search distance, you can add a threshold value parameter.vectordbkwargs = {"search_distance": 0.9}qa = ConversationalRetrievalChain.from_llm(    OpenAI(temperature=0), vectorstore.as_retriever(), return_source_documents=True)chat_history = []query = "What did the president say about Ketanji Brown Jackson"result = qa(    {"question": query, "chat_history": chat_history, "vectordbkwargs": vectordbkwargs})print(result["answer"])     The president said that Ketanji Brown Jackson is one of the nation's top legal minds and a former top litigator in private practice, and that she will continue Justice Breyer's legacy of excellence.ConversationalRetrievalChain with map_reduce‚ÄãWe can also use different types of combine document chains with the ConversationalRetrievalChain chain.from langchain.chains import LLMChainfrom langchain.chains.question_answering import load_qa_chainfrom langchain.chains.conversational_retrieval.prompts import CONDENSE_QUESTION_PROMPTquestion_generator = LLMChain(llm=llm, prompt=CONDENSE_QUESTION_PROMPT)doc_chain = load_qa_chain(llm, chain_type="map_reduce")chain = ConversationalRetrievalChain(    retriever=vectorstore.as_retriever(),    question_generator=question_generator,    combine_docs_chain=doc_chain,)chat_history = []query = "What did the president say about Ketanji Brown Jackson"result = chain({"question": query, "chat_history": chat_history})result["answer"]    " The president said that he nominated Circuit Court of Appeals Judge Ketanji Brown Jackson, who is one of the nation's top legal minds and a former top litigator in private practice."ConversationalRetrievalChain with Question Answering with sources‚ÄãYou can also use this chain with the question answering with sources chain.from langchain.chains.qa_with_sources import