Home / Function/ on_agent_action() — langchain Function Reference

on_agent_action() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2411e67b_520d_276b_21c3_d9c3e83ce187["on_agent_action()"]
  d905f7ba_84e1_978e_30ed_f25fd37354ce["AsyncCallbackManagerForChainRun"]
  2411e67b_520d_276b_21c3_d9c3e83ce187 -->|defined in| d905f7ba_84e1_978e_30ed_f25fd37354ce
  f0cd3c05_aee4_21c7_c860_78b7d129beb7["on_agent_action()"]
  f0cd3c05_aee4_21c7_c860_78b7d129beb7 -->|calls| 2411e67b_520d_276b_21c3_d9c3e83ce187
  f0cd3c05_aee4_21c7_c860_78b7d129beb7["on_agent_action()"]
  2411e67b_520d_276b_21c3_d9c3e83ce187 -->|calls| f0cd3c05_aee4_21c7_c860_78b7d129beb7
  3a243d21_72d1_dca9_f7be_acbb482b9f86["ahandle_event()"]
  2411e67b_520d_276b_21c3_d9c3e83ce187 -->|calls| 3a243d21_72d1_dca9_f7be_acbb482b9f86
  style 2411e67b_520d_276b_21c3_d9c3e83ce187 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/manager.py lines 1013–1031

    async def on_agent_action(self, action: AgentAction, **kwargs: Any) -> None:
        """Run when agent action is received.

        Args:
            action: The agent action.
            **kwargs: Additional keyword arguments.
        """
        if not self.handlers:
            return
        await ahandle_event(
            self.handlers,
            "on_agent_action",
            "ignore_agent",
            action,
            run_id=self.run_id,
            parent_run_id=self.parent_run_id,
            tags=self.tags,
            **kwargs,
        )

Domain

Subdomains

Called By

Frequently Asked Questions

What does on_agent_action() do?
on_agent_action() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/manager.py.
Where is on_agent_action() defined?
on_agent_action() is defined in libs/core/langchain_core/callbacks/manager.py at line 1013.
What does on_agent_action() call?
on_agent_action() calls 2 function(s): ahandle_event, on_agent_action.
What calls on_agent_action()?
on_agent_action() is called by 1 function(s): on_agent_action.

Analyze Your Own Codebase

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

Try Supermodel Free