Home / Function/ __repr__() — langchain Function Reference

__repr__() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3af9ca9d_6450_8a28_13aa_4fabcb0dfdab["__repr__()"]
  c6a370e4_a02a_c56a_38eb_7ca734dcbfea["RunnableLambda"]
  3af9ca9d_6450_8a28_13aa_4fabcb0dfdab -->|defined in| c6a370e4_a02a_c56a_38eb_7ca734dcbfea
  style 3af9ca9d_6450_8a28_13aa_4fabcb0dfdab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/base.py lines 4836–4849

    def __repr__(self) -> str:
        """Return a string representation of this `Runnable`."""
        if self._repr is None:
            if hasattr(self, "func") and isinstance(self.func, itemgetter):
                self._repr = f"RunnableLambda({str(self.func)[len('operator.') :]})"
            elif hasattr(self, "func"):
                self._repr = f"RunnableLambda({get_lambda_source(self.func) or '...'})"
            elif hasattr(self, "afunc"):
                self._repr = (
                    f"RunnableLambda(afunc={get_lambda_source(self.afunc) or '...'})"
                )
            else:
                self._repr = "RunnableLambda(...)"
        return self._repr

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free