from_llm(
cls,
llm: BaseLanguageModel,
retriever: BaseRetriever,
condense_question_prompt: BasePromptTemplate | Name | Type | Description |
|---|---|---|
llm* | BaseLanguageModel | The default language model to use at every part of this chain (eg in both the question generation and the answering) |
retriever* | BaseRetriever | The retriever to use to fetch relevant documents from. |
condense_question_prompt | BasePromptTemplate | Default: CONDENSE_QUESTION_PROMPTThe prompt to use to condense the chat history and new question into a standalone question. |
chain_type | str | Default: 'stuff' |
verbose | bool | Default: False |
condense_question_llm | BaseLanguageModel | None | Default: None |
combine_docs_chain_kwargs | dict | None | Default: None |
callbacks | Callbacks | Default: None |
kwargs | Any | Default: {} |
Convenience method to load chain from LLM and retriever.
This provides some logic to create the question_generator chain
as well as the combine_docs_chain.
The chain type to use to create the combine_docs_chain, will
be sent to load_qa_chain.
Verbosity flag for logging to stdout.
The language model to use for condensing the chat
history and new question into a standalone question. If none is
provided, will default to llm.
Parameters to pass as kwargs to load_qa_chain
when constructing the combine_docs_chain.
Callbacks to pass to all subchains.
Additional parameters to pass when initializing ConversationalRetrievalChain