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
  f0cd3c05_aee4_21c7_c860_78b7d129beb7["on_agent_action()"]
  81cd9db4_6745_5fd9_98e7_4b450c8fee53["CallbackManagerForChainRun"]
  f0cd3c05_aee4_21c7_c860_78b7d129beb7 -->|defined in| 81cd9db4_6745_5fd9_98e7_4b450c8fee53
  2411e67b_520d_276b_21c3_d9c3e83ce187["on_agent_action()"]
  2411e67b_520d_276b_21c3_d9c3e83ce187 -->|calls| f0cd3c05_aee4_21c7_c860_78b7d129beb7
  2411e67b_520d_276b_21c3_d9c3e83ce187["on_agent_action()"]
  f0cd3c05_aee4_21c7_c860_78b7d129beb7 -->|calls| 2411e67b_520d_276b_21c3_d9c3e83ce187
  8964b4e9_440e_18a7_2a15_a54a0b2b733c["handle_event()"]
  f0cd3c05_aee4_21c7_c860_78b7d129beb7 -->|calls| 8964b4e9_440e_18a7_2a15_a54a0b2b733c
  style f0cd3c05_aee4_21c7_c860_78b7d129beb7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/manager.py lines 904–922

    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
        handle_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 904.
What does on_agent_action() call?
on_agent_action() calls 2 function(s): handle_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