Home / Function/ on_chain_end() — langchain Function Reference

on_chain_end() — langchain Function Reference

Architecture documentation for the on_chain_end() function in manager.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  093c841a_166d_5740_b357_6299063e562a["on_chain_end()"]
  d905f7ba_84e1_978e_30ed_f25fd37354ce["AsyncCallbackManagerForChainRun"]
  093c841a_166d_5740_b357_6299063e562a -->|defined in| d905f7ba_84e1_978e_30ed_f25fd37354ce
  3b7be403_b5f2_f25b_2714_6d61955e1332["on_chain_end()"]
  3b7be403_b5f2_f25b_2714_6d61955e1332 -->|calls| 093c841a_166d_5740_b357_6299063e562a
  5b3f5fc0_dfdb_49a5_405b_50c149699640["on_chain_end()"]
  5b3f5fc0_dfdb_49a5_405b_50c149699640 -->|calls| 093c841a_166d_5740_b357_6299063e562a
  3a243d21_72d1_dca9_f7be_acbb482b9f86["ahandle_event()"]
  093c841a_166d_5740_b357_6299063e562a -->|calls| 3a243d21_72d1_dca9_f7be_acbb482b9f86
  3b7be403_b5f2_f25b_2714_6d61955e1332["on_chain_end()"]
  093c841a_166d_5740_b357_6299063e562a -->|calls| 3b7be403_b5f2_f25b_2714_6d61955e1332
  style 093c841a_166d_5740_b357_6299063e562a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/manager.py lines 966–985

    async def on_chain_end(self, outputs: dict[str, Any] | Any, **kwargs: Any) -> None:
        """Run when a chain ends running.

        Args:
            outputs: The outputs of the chain.
            **kwargs: Additional keyword arguments.

        """
        if not self.handlers:
            return
        await ahandle_event(
            self.handlers,
            "on_chain_end",
            "ignore_chain",
            outputs,
            run_id=self.run_id,
            parent_run_id=self.parent_run_id,
            tags=self.tags,
            **kwargs,
        )

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/callbacks/manager.py.
Where is on_chain_end() defined?
on_chain_end() is defined in libs/core/langchain_core/callbacks/manager.py at line 966.
What does on_chain_end() call?
on_chain_end() calls 2 function(s): ahandle_event, on_chain_end.
What calls on_chain_end()?
on_chain_end() is called by 2 function(s): on_chain_end, on_chain_end.

Analyze Your Own Codebase

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

Try Supermodel Free