Home / Function/ indent_lines_after_first() — langchain Function Reference

indent_lines_after_first() — langchain Function Reference

Architecture documentation for the indent_lines_after_first() function in utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c02e9468_bb24_64cc_cd9b_04fb56a1d429["indent_lines_after_first()"]
  ca66092c_447c_d201_0d3c_cfa6ca2cc9d3["utils.py"]
  c02e9468_bb24_64cc_cd9b_04fb56a1d429 -->|defined in| ca66092c_447c_d201_0d3c_cfa6ca2cc9d3
  style c02e9468_bb24_64cc_cd9b_04fb56a1d429 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/utils.py lines 450–463

def indent_lines_after_first(text: str, prefix: str) -> str:
    """Indent all lines of text after the first line.

    Args:
        text: The text to indent.
        prefix: Used to determine the number of spaces to indent.

    Returns:
        The indented text.
    """
    n_spaces = len(prefix)
    spaces = " " * n_spaces
    lines = text.splitlines()
    return "\n".join([lines[0]] + [spaces + line for line in lines[1:]])

Subdomains

Frequently Asked Questions

What does indent_lines_after_first() do?
indent_lines_after_first() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/utils.py.
Where is indent_lines_after_first() defined?
indent_lines_after_first() is defined in libs/core/langchain_core/runnables/utils.py at line 450.

Analyze Your Own Codebase

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

Try Supermodel Free