Home / Function/ on_chain_start() — langchain Function Reference

on_chain_start() — langchain Function Reference

Architecture documentation for the on_chain_start() function in stdout.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8245925b_379e_91d8_182e_d404bc9515ee["on_chain_start()"]
  dcf2a9b2_8ab4_fbe0_5f57_ef548417d10e["StdOutCallbackHandler"]
  8245925b_379e_91d8_182e_d404bc9515ee -->|defined in| dcf2a9b2_8ab4_fbe0_5f57_ef548417d10e
  style 8245925b_379e_91d8_182e_d404bc9515ee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/stdout.py lines 28–44

    def on_chain_start(
        self, serialized: dict[str, Any], inputs: dict[str, Any], **kwargs: Any
    ) -> None:
        """Print out that we are entering a chain.

        Args:
            serialized: The serialized chain.
            inputs: The inputs to the chain.
            **kwargs: Additional keyword arguments.
        """
        if "name" in kwargs:
            name = kwargs["name"]
        elif serialized:
            name = serialized.get("name", serialized.get("id", ["<unknown>"])[-1])
        else:
            name = "<unknown>"
        print(f"\n\n\033[1m> Entering new {name} chain...\033[0m")  # noqa: T201

Domain

Subdomains

Frequently Asked Questions

What does on_chain_start() do?
on_chain_start() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/stdout.py.
Where is on_chain_start() defined?
on_chain_start() is defined in libs/core/langchain_core/callbacks/stdout.py at line 28.

Analyze Your Own Codebase

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

Try Supermodel Free