Home / Function/ _get_docs() — langchain Function Reference

_get_docs() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8e932862_cc2c_8a91_ae17_87d023efcca7["_get_docs()"]
  1c559a69_197e_d647_5f47_79dc8fa4a648["ConversationalRetrievalChain"]
  8e932862_cc2c_8a91_ae17_87d023efcca7 -->|defined in| 1c559a69_197e_d647_5f47_79dc8fa4a648
  cc60c9e9_1c90_5c4d_901c_b053eae628ef["_get_docs()"]
  cc60c9e9_1c90_5c4d_901c_b053eae628ef -->|calls| 8e932862_cc2c_8a91_ae17_87d023efcca7
  6e6f6256_b657_b069_4feb_e1aba5c970b7["_call()"]
  6e6f6256_b657_b069_4feb_e1aba5c970b7 -->|calls| 8e932862_cc2c_8a91_ae17_87d023efcca7
  0ec6d3c8_c314_4625_083f_9ddc0dfb409c["_reduce_tokens_below_limit()"]
  8e932862_cc2c_8a91_ae17_87d023efcca7 -->|calls| 0ec6d3c8_c314_4625_083f_9ddc0dfb409c
  cc60c9e9_1c90_5c4d_901c_b053eae628ef["_get_docs()"]
  8e932862_cc2c_8a91_ae17_87d023efcca7 -->|calls| cc60c9e9_1c90_5c4d_901c_b053eae628ef
  style 8e932862_cc2c_8a91_ae17_87d023efcca7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/conversational_retrieval/base.py lines 408–420

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

Subdomains

Called By

Frequently Asked Questions

What does _get_docs() do?
_get_docs() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/conversational_retrieval/base.py.
Where is _get_docs() defined?
_get_docs() is defined in libs/langchain/langchain_classic/chains/conversational_retrieval/base.py at line 408.
What does _get_docs() call?
_get_docs() calls 2 function(s): _get_docs, _reduce_tokens_below_limit.
What calls _get_docs()?
_get_docs() is called by 2 function(s): _call, _get_docs.

Analyze Your Own Codebase

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

Try Supermodel Free