on_agent_action(
self,
action: AgentAction,
*,
run_id: UUID,
parent_run_id: Optional[UUID| Name | Type | Description |
|---|---|---|
action* | AgentAction | The |
run_id* | UUID | Unique identifier for this run. |
parent_run_id | Optional[UUID] | Default: NoneRun ID of the parent agent. |
**kwargs | Any | Default: {} |
Cache tool context emitted from agent actions.
AgentAction is emitted before tool execution. This method stores
the tool name, input, and log in the parent agent span's stash so that
subsequent :meth:on_tool_start calls can include richer context.
Additional LangChain callback keyword arguments.