Home / Function/ acombine_docs() — langchain Function Reference

acombine_docs() — langchain Function Reference

Architecture documentation for the acombine_docs() function in reduce.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  924b164e_b8f4_c752_6dc9_c259afef92be["acombine_docs()"]
  1d761688_0112_f998_eecc_6712fc22bf37["ReduceDocumentsChain"]
  924b164e_b8f4_c752_6dc9_c259afef92be -->|defined in| 1d761688_0112_f998_eecc_6712fc22bf37
  4961cdaa_eb66_8549_74f5_80aa6ef431de["_acollapse()"]
  924b164e_b8f4_c752_6dc9_c259afef92be -->|calls| 4961cdaa_eb66_8549_74f5_80aa6ef431de
  style 924b164e_b8f4_c752_6dc9_c259afef92be fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/combine_documents/reduce.py lines 275–307

    async def acombine_docs(
        self,
        docs: list[Document],
        token_max: int | None = None,
        callbacks: Callbacks = None,
        **kwargs: Any,
    ) -> tuple[str, dict]:
        """Async combine multiple documents recursively.

        Args:
            docs: List of documents to combine, assumed that each one is less than
                `token_max`.
            token_max: Recursively creates groups of documents less than this number
                of tokens.
            callbacks: Callbacks to be passed through
            **kwargs: additional parameters to be passed to LLM calls (like other
                input variables besides the documents)

        Returns:
            The first element returned is the single string output. The second
                element returned is a dictionary of other keys to return.
        """
        result_docs, _ = await self._acollapse(
            docs,
            token_max=token_max,
            callbacks=callbacks,
            **kwargs,
        )
        return await self.combine_documents_chain.acombine_docs(
            docs=result_docs,
            callbacks=callbacks,
            **kwargs,
        )

Subdomains

Calls

Frequently Asked Questions

What does acombine_docs() do?
acombine_docs() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/combine_documents/reduce.py.
Where is acombine_docs() defined?
acombine_docs() is defined in libs/langchain/langchain_classic/chains/combine_documents/reduce.py at line 275.
What does acombine_docs() call?
acombine_docs() calls 1 function(s): _acollapse.

Analyze Your Own Codebase

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

Try Supermodel Free