Home / Function/ split_text() — langchain Function Reference

split_text() — langchain Function Reference

Architecture documentation for the split_text() function in character.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  cdc32315_d799_46f6_bd91_09d4da023d15["split_text()"]
  22d8d30b_9b36_1532_bb1c_4c9aa03a4bb8["RecursiveCharacterTextSplitter"]
  cdc32315_d799_46f6_bd91_09d4da023d15 -->|defined in| 22d8d30b_9b36_1532_bb1c_4c9aa03a4bb8
  11fcdf48_fab6_27e3_ca6c_8904e5348e23["split_text()"]
  11fcdf48_fab6_27e3_ca6c_8904e5348e23 -->|calls| cdc32315_d799_46f6_bd91_09d4da023d15
  90247d99_f9d1_5357_ea60_e7b8e740431f["_split_text()"]
  cdc32315_d799_46f6_bd91_09d4da023d15 -->|calls| 90247d99_f9d1_5357_ea60_e7b8e740431f
  11fcdf48_fab6_27e3_ca6c_8904e5348e23["split_text()"]
  cdc32315_d799_46f6_bd91_09d4da023d15 -->|calls| 11fcdf48_fab6_27e3_ca6c_8904e5348e23
  style cdc32315_d799_46f6_bd91_09d4da023d15 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/langchain_text_splitters/character.py lines 149–158

    def split_text(self, text: str) -> list[str]:
        """Split the input text into smaller chunks based on predefined separators.

        Args:
            text: The input text to be split.

        Returns:
            A list of text chunks obtained after splitting.
        """
        return self._split_text(text, self._separators)

Subdomains

Called By

Frequently Asked Questions

What does split_text() do?
split_text() is a function in the langchain codebase, defined in libs/text-splitters/langchain_text_splitters/character.py.
Where is split_text() defined?
split_text() is defined in libs/text-splitters/langchain_text_splitters/character.py at line 149.
What does split_text() call?
split_text() calls 2 function(s): _split_text, split_text.
What calls split_text()?
split_text() is called by 1 function(s): split_text.

Analyze Your Own Codebase

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

Try Supermodel Free