Home / Class/ Branch Class — langchain Architecture

Branch Class — langchain Architecture

Architecture documentation for the Branch class in graph.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  4b0afb4b_9c6d_4c3f_339a_f82cad3bb417["Branch"]
  81a6280b_4752_84db_f1fa_1a3b8040d481["graph.py"]
  4b0afb4b_9c6d_4c3f_339a_f82cad3bb417 -->|defined in| 81a6280b_4752_84db_f1fa_1a3b8040d481

Relationship Graph

Source Code

libs/core/langchain_core/runnables/graph.py lines 128–134

class Branch(NamedTuple):
    """Branch in a graph."""

    condition: Callable[..., str]
    """A callable that returns a string representation of the condition."""
    ends: dict[str, str] | None
    """Optional dictionary of end node IDs for the branches. """

Frequently Asked Questions

What is the Branch class?
Branch is a class in the langchain codebase, defined in libs/core/langchain_core/runnables/graph.py.
Where is Branch defined?
Branch is defined in libs/core/langchain_core/runnables/graph.py at line 128.

Analyze Your Own Codebase

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

Try Supermodel Free