Home / Function/ _load_vector_db_qa_with_sources_chain() — langchain Function Reference

_load_vector_db_qa_with_sources_chain() — langchain Function Reference

Architecture documentation for the _load_vector_db_qa_with_sources_chain() function in loading.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  92120c44_3dd6_e4a9_3399_3c8d5c2a0216["_load_vector_db_qa_with_sources_chain()"]
  61dd5a0b_3bf7_b973_6dac_edfd465b21fb["loading.py"]
  92120c44_3dd6_e4a9_3399_3c8d5c2a0216 -->|defined in| 61dd5a0b_3bf7_b973_6dac_edfd465b21fb
  7c915b91_f326_1908_9969_d0cb1f4f7e34["load_chain_from_config()"]
  92120c44_3dd6_e4a9_3399_3c8d5c2a0216 -->|calls| 7c915b91_f326_1908_9969_d0cb1f4f7e34
  ab90e794_4e78_646b_dee9_e87a00250d94["load_chain()"]
  92120c44_3dd6_e4a9_3399_3c8d5c2a0216 -->|calls| ab90e794_4e78_646b_dee9_e87a00250d94
  style 92120c44_3dd6_e4a9_3399_3c8d5c2a0216 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/loading.py lines 429–459

def _load_vector_db_qa_with_sources_chain(
    config: dict,
    **kwargs: Any,
) -> VectorDBQAWithSourcesChain:
    if "vectorstore" in kwargs:
        vectorstore = kwargs.pop("vectorstore")
    else:
        msg = "`vectorstore` must be present."
        raise ValueError(msg)
    if "combine_documents_chain" in config:
        combine_documents_chain_config = config.pop("combine_documents_chain")
        combine_documents_chain = load_chain_from_config(
            combine_documents_chain_config,
            **kwargs,
        )
    elif "combine_documents_chain_path" in config:
        combine_documents_chain = load_chain(
            config.pop("combine_documents_chain_path"),
            **kwargs,
        )
    else:
        msg = (
            "One of `combine_documents_chain` or "
            "`combine_documents_chain_path` must be present."
        )
        raise ValueError(msg)
    return VectorDBQAWithSourcesChain(
        combine_documents_chain=combine_documents_chain,
        vectorstore=vectorstore,
        **config,
    )

Subdomains

Frequently Asked Questions

What does _load_vector_db_qa_with_sources_chain() do?
_load_vector_db_qa_with_sources_chain() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/loading.py.
Where is _load_vector_db_qa_with_sources_chain() defined?
_load_vector_db_qa_with_sources_chain() is defined in libs/langchain/langchain_classic/chains/loading.py at line 429.
What does _load_vector_db_qa_with_sources_chain() call?
_load_vector_db_qa_with_sources_chain() calls 2 function(s): load_chain, load_chain_from_config.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free