Harrison/verbose conv ret (#3492)

Co-authored-by: makretch <max.kretchmer@gmail.com>
This commit is contained in:
Harrison Chase 2023-04-24 22:16:07 -07:00 committed by GitHub
parent 36a039d017
commit 7084d69ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,7 @@ class ConversationalRetrievalChain(BaseConversationalRetrievalChain):
retriever: BaseRetriever, retriever: BaseRetriever,
condense_question_prompt: BasePromptTemplate = CONDENSE_QUESTION_PROMPT, condense_question_prompt: BasePromptTemplate = CONDENSE_QUESTION_PROMPT,
chain_type: str = "stuff", chain_type: str = "stuff",
verbose: bool = False,
combine_docs_chain_kwargs: Optional[Dict] = None, combine_docs_chain_kwargs: Optional[Dict] = None,
**kwargs: Any, **kwargs: Any,
) -> BaseConversationalRetrievalChain: ) -> BaseConversationalRetrievalChain:
@ -181,9 +182,12 @@ class ConversationalRetrievalChain(BaseConversationalRetrievalChain):
doc_chain = load_qa_chain( doc_chain = load_qa_chain(
llm, llm,
chain_type=chain_type, chain_type=chain_type,
verbose=verbose,
**combine_docs_chain_kwargs, **combine_docs_chain_kwargs,
) )
condense_question_chain = LLMChain(llm=llm, prompt=condense_question_prompt) condense_question_chain = LLMChain(
llm=llm, prompt=condense_question_prompt, verbose=verbose
)
return cls( return cls(
retriever=retriever, retriever=retriever,
combine_docs_chain=doc_chain, combine_docs_chain=doc_chain,