a custom prompt for condensing the question‚ÄãBy default, ConversationalRetrievalQA uses CONDENSE_QUESTION_PROMPT to condense a question. Here is the implementation of this in the docsfrom langchain.prompts.prompt import PromptTemplate_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question, in its original language.Chat History:{chat_history}Follow Up Input: {question}Standalone question:"""CONDENSE_QUESTION_PROMPT = PromptTemplate.from_template(_template)But instead of this any custom template can be used to further augment information in the question or instruct the LLM to do something. Here is an examplefrom langchain.prompts.prompt import PromptTemplatecustom_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question. At the end of standalone question add this 'Answer the question in German language.' If you do not know the answer reply with 'I am sorry'.Chat History:{chat_history}Follow Up Input: {question}Standalone question:"""CUSTOM_QUESTION_PROMPT = PromptTemplate.from_template(custom_template)model = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.3)embeddings = OpenAIEmbeddings()vectordb = Chroma(embedding_function=embeddings, persist_directory=directory)memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)qa = ConversationalRetrievalChain.from_llm(    model,    vectordb.as_retriever(),    condense_question_prompt=CUSTOM_QUESTION_PROMPT,    memory=memory)query = "What did the president say about Ketanji Brown Jackson"result = qa({"question": query})query = "Did he mention who she succeeded"result = qa({"question": query})Return Source Documents‚ÄãYou can also easily return source documents from the ConversationalRetrievalChain. This is useful for when you want to inspect what documents were returned.qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0),
The ConversationalRetrievalQA chain builds on RetrievalQAChain to provide a chat history component.
The ConversationalRetrievalQA chain builds on RetrievalQAChain to provide a chat history component. ->: a custom prompt for condensing the question‚ÄãBy default, ConversationalRetrievalQA uses CONDENSE_QUESTION_PROMPT to condense a question. Here is the implementation of this in the docsfrom langchain.prompts.prompt import PromptTemplate_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question, in its original language.Chat History:{chat_history}Follow Up Input: {question}Standalone question:"""CONDENSE_QUESTION_PROMPT = PromptTemplate.from_template(_template)But instead of this any custom template can be used to further augment information in the question or instruct the LLM to do something. Here is an examplefrom langchain.prompts.prompt import PromptTemplatecustom_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question. At the end of standalone question add this 'Answer the question in German language.' If you do not know the answer reply with 'I am sorry'.Chat History:{chat_history}Follow Up Input: {question}Standalone question:"""CUSTOM_QUESTION_PROMPT = PromptTemplate.from_template(custom_template)model = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.3)embeddings = OpenAIEmbeddings()vectordb = Chroma(embedding_function=embeddings, persist_directory=directory)memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)qa = ConversationalRetrievalChain.from_llm(    model,    vectordb.as_retriever(),    condense_question_prompt=CUSTOM_QUESTION_PROMPT,    memory=memory)query = "What did the president say about Ketanji Brown Jackson"result = qa({"question": query})query = "Did he mention who she succeeded"result = qa({"question": query})Return Source Documents‚ÄãYou can also easily return source documents from the ConversationalRetrievalChain. This is useful for when you want to inspect what documents were returned.qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0),