Complete the code to import the necessary class for question reformulation.
from langchain.chains import [1]
The ConversationalRetrievalChain class is used for question reformulation with history in LangChain.
Complete the code to create a retriever from a vector store.
retriever = vectorstore.[1]()The as_retriever() method converts a vector store into a retriever object.
Fix the error in the code to create a ConversationalRetrievalChain with a language model and retriever.
qa_chain = ConversationalRetrievalChain.from_llm(llm=[1], retriever=retriever)The parameter name is llm to pass the language model instance.
Fill both blanks to reformulate a question using chat history and a new question.
rephrased_question = qa_chain.[1](question=new_question, chat_history=[2])
The method rephrase_question is used to reformulate the question, and the chat history is passed as history.
Fill all three blanks to create a question-answering chain that uses a language model, retriever, and returns source documents.
qa_chain = ConversationalRetrievalChain.from_llm(llm=[1], retriever=[2], return_source_documents=[3])
The llm parameter passes the language model, retriever passes the retriever object, and return_source_documents=True enables returning source documents.