load_qa_chain#
- langchain.chains.question_answering.chain.load_qa_chain(llm: BaseLanguageModel, chain_type: str = 'stuff', verbose: bool | None = None, callback_manager: BaseCallbackManager | None = None, **kwargs: Any) BaseCombineDocumentsChain [source]#
Deprecated since version 0.2.13: This class is deprecated. See the following migration guides for replacements based on chain_type:
stuff: https://python.langchain.com/docs/versions/migrating_chains/stuff_docs_chain map_reduce: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain refine: https://python.langchain.com/docs/versions/migrating_chains/refine_chain map_rerank: https://python.langchain.com/docs/versions/migrating_chains/map_rerank_docs_chain
See also guides on retrieval and question-answering here: https://python.langchain.com/docs/how_to/#qa-with-rag
Load question answering chain.
- Parameters:
llm (BaseLanguageModel) – Language Model to use in the chain.
chain_type (str) – Type of document combining chain to use. Should be one of “stuff”, “map_reduce”, “map_rerank”, and “refine”.
verbose (bool | None) – Whether chains should be run in verbose mode or not. Note that this applies to all chains that make up the final chain.
callback_manager (BaseCallbackManager | None) – Callback manager to use for the chain.
kwargs (Any)
- Returns:
A chain to use for question answering.
- Return type:
Examples using load_qa_chain