on_chain_end() — langchain Function Reference
Architecture documentation for the on_chain_end() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 345a9c6c_5d65_81c4_da44_5f0ea61fc060["on_chain_end()"] 0f6b3261_31fa_c34e_ca33_cb141bdf78ff["BaseTracer"] 345a9c6c_5d65_81c4_da44_5f0ea61fc060 -->|defined in| 0f6b3261_31fa_c34e_ca33_cb141bdf78ff aea890c6_499d_589a_9dd7_0d29b172ee5f["on_chain_end()"] aea890c6_499d_589a_9dd7_0d29b172ee5f -->|calls| 345a9c6c_5d65_81c4_da44_5f0ea61fc060 9191b24f_a202_df21_16c5_e2608083aef8["_end_trace()"] 345a9c6c_5d65_81c4_da44_5f0ea61fc060 -->|calls| 9191b24f_a202_df21_16c5_e2608083aef8 76693ba5_9082_bc25_dc8b_d223d817dd6f["_on_chain_end()"] 345a9c6c_5d65_81c4_da44_5f0ea61fc060 -->|calls| 76693ba5_9082_bc25_dc8b_d223d817dd6f aea890c6_499d_589a_9dd7_0d29b172ee5f["on_chain_end()"] 345a9c6c_5d65_81c4_da44_5f0ea61fc060 -->|calls| aea890c6_499d_589a_9dd7_0d29b172ee5f style 345a9c6c_5d65_81c4_da44_5f0ea61fc060 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/tracers/base.py lines 286–312
def on_chain_end(
self,
outputs: dict[str, Any],
*,
run_id: UUID,
inputs: dict[str, Any] | None = None,
**kwargs: Any,
) -> Run:
"""End a trace for a chain run.
Args:
outputs: The outputs for the chain.
run_id: The run ID.
inputs: The inputs for the chain.
**kwargs: Additional arguments.
Returns:
The run.
"""
chain_run = self._complete_chain_run(
outputs=outputs,
run_id=run_id,
inputs=inputs,
)
self._end_trace(chain_run)
self._on_chain_end(chain_run)
return chain_run
Domain
Subdomains
Defined In
Called By
Source
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/base.py.
Where is on_chain_end() defined?
on_chain_end() is defined in libs/core/langchain_core/tracers/base.py at line 286.
What does on_chain_end() call?
on_chain_end() calls 3 function(s): _end_trace, _on_chain_end, on_chain_end.
What calls on_chain_end()?
on_chain_end() is called by 1 function(s): on_chain_end.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free