Home / Function/ transform_documents() — langchain Function Reference

transform_documents() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e269bebc_7f11_3715_6f4a_f53fba4229cb["transform_documents()"]
  c86e37d5_f962_cc1e_9821_b665e1359ae8["TextSplitter"]
  e269bebc_7f11_3715_6f4a_f53fba4229cb -->|defined in| c86e37d5_f962_cc1e_9821_b665e1359ae8
  d14f3e1b_dd57_6268_5d47_c8b53356440d["split_documents()"]
  e269bebc_7f11_3715_6f4a_f53fba4229cb -->|calls| d14f3e1b_dd57_6268_5d47_c8b53356440d
  style e269bebc_7f11_3715_6f4a_f53fba4229cb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/langchain_text_splitters/base.py lines 284–295

    def transform_documents(
        self, documents: Sequence[Document], **kwargs: Any
    ) -> Sequence[Document]:
        """Transform sequence of documents by splitting them.

        Args:
            documents: The sequence of documents to split.

        Returns:
            A list of split documents.
        """
        return self.split_documents(list(documents))

Subdomains

Frequently Asked Questions

What does transform_documents() do?
transform_documents() is a function in the langchain codebase, defined in libs/text-splitters/langchain_text_splitters/base.py.
Where is transform_documents() defined?
transform_documents() is defined in libs/text-splitters/langchain_text_splitters/base.py at line 284.
What does transform_documents() call?
transform_documents() calls 1 function(s): split_documents.

Analyze Your Own Codebase

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

Try Supermodel Free