Home / Function/ _get_docs() — langchain Function Reference

_get_docs() — langchain Function Reference

Architecture documentation for the _get_docs() function in retrieval.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  857136aa_95ce_637d_eb84_ed2df24dae5c["_get_docs()"]
  76f853c5_b279_fd04_f253_b0c960712f80["RetrievalQAWithSourcesChain"]
  857136aa_95ce_637d_eb84_ed2df24dae5c -->|defined in| 76f853c5_b279_fd04_f253_b0c960712f80
  0afcca8a_ef8b_63ff_50cb_7330bdb61fee["_reduce_tokens_below_limit()"]
  857136aa_95ce_637d_eb84_ed2df24dae5c -->|calls| 0afcca8a_ef8b_63ff_50cb_7330bdb61fee
  style 857136aa_95ce_637d_eb84_ed2df24dae5c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/qa_with_sources/retrieval.py lines 46–57

    def _get_docs(
        self,
        inputs: dict[str, Any],
        *,
        run_manager: CallbackManagerForChainRun,
    ) -> list[Document]:
        question = inputs[self.question_key]
        docs = self.retriever.invoke(
            question,
            config={"callbacks": run_manager.get_child()},
        )
        return self._reduce_tokens_below_limit(docs)

Subdomains

Frequently Asked Questions

What does _get_docs() do?
_get_docs() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/qa_with_sources/retrieval.py.
Where is _get_docs() defined?
_get_docs() is defined in libs/langchain/langchain_classic/chains/qa_with_sources/retrieval.py at line 46.
What does _get_docs() call?
_get_docs() calls 1 function(s): _reduce_tokens_below_limit.

Analyze Your Own Codebase

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

Try Supermodel Free