Home / Function/ _on_chain_end() — langchain Function Reference

_on_chain_end() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  52082883_bf43_56da_0542_07f3c24da80e["_on_chain_end()"]
  56d9fac7_db71_9c71_7cac_1d680d392fa0["FunctionCallbackHandler"]
  52082883_bf43_56da_0542_07f3c24da80e -->|defined in| 56d9fac7_db71_9c71_7cac_1d680d392fa0
  1bda6774_d332_dec5_ed8f_8d6eef57961e["get_breadcrumbs()"]
  52082883_bf43_56da_0542_07f3c24da80e -->|calls| 1bda6774_d332_dec5_ed8f_8d6eef57961e
  78a56963_548a_2192_487f_472b05419cba["elapsed()"]
  52082883_bf43_56da_0542_07f3c24da80e -->|calls| 78a56963_548a_2192_487f_472b05419cba
  95875f96_0c2d_b364_e63a_651f8ed4cdcd["try_json_stringify()"]
  52082883_bf43_56da_0542_07f3c24da80e -->|calls| 95875f96_0c2d_b364_e63a_651f8ed4cdcd
  style 52082883_bf43_56da_0542_07f3c24da80e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/stdout.py lines 114–123

    def _on_chain_end(self, run: Run) -> None:
        crumbs = self.get_breadcrumbs(run)
        run_type = run.run_type.capitalize()
        self.function_callback(
            f"{get_colored_text('[chain/end]', color='blue')} "
            + get_bolded_text(
                f"[{crumbs}] [{elapsed(run)}] Exiting {run_type} run with output:\n"
            )
            + f"{try_json_stringify(run.outputs, '[outputs]')}"
        )

Domain

Subdomains

Frequently Asked Questions

What does _on_chain_end() do?
_on_chain_end() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/stdout.py.
Where is _on_chain_end() defined?
_on_chain_end() is defined in libs/core/langchain_core/tracers/stdout.py at line 114.
What does _on_chain_end() call?
_on_chain_end() calls 3 function(s): elapsed, get_breadcrumbs, try_json_stringify.

Analyze Your Own Codebase

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

Try Supermodel Free