langchain.chains.qa_with_sources.loading.load_qa_with_sources_chain¶

langchain.chains.qa_with_sources.loading.load_qa_with_sources_chain(llm: BaseLanguageModel, chain_type: str = 'stuff', verbose: Optional[bool] = None, **kwargs: Any) BaseCombineDocumentsChain[source]¶

Load a question answering with sources 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”, “refine” and “map_rerank”.

  • verbose (Optional[bool]) – Whether chains should be run in verbose mode or not. Note that this applies to all chains that make up the final chain.

  • kwargs (Any) –

Returns

A chain to use for question answering with sources.

Return type

BaseCombineDocumentsChain

Examples using load_qa_with_sources_chain¶