Class ExecuteTools
java.lang.Object
org.bsc.langgraph4j.agentexecutor.actions.ExecuteTools
- All Implemented Interfaces:
NodeAction<AgentExecutor.State>
The ExecuteTools class implements the NodeAction interface for handling
actions related to executing tools within an agent's context.
-
Constructor Summary
ConstructorDescriptionExecuteTools
(@NonNull Agent agent, @NonNull ToolNode toolNode) Constructs an ExecuteTools instance with the specified agent and tool node. -
Method Summary
Modifier and TypeMethodDescriptionapply
(AgentExecutor.State state) Applies the tool execution logic based on the provided agent state.
-
Constructor Details
-
ExecuteTools
Constructs an ExecuteTools instance with the specified agent and tool node.- Parameters:
agent
- the agent to be associated with this execution tool, must not be nulltoolNode
- the tool node to be executed, must not be null
-
-
Method Details
-
apply
Applies the tool execution logic based on the provided agent state.- Specified by:
apply
in interfaceNodeAction<AgentExecutor.State>
- Parameters:
state
- the current state of the agent executor- Returns:
- a map containing the intermediate steps of the execution
- Throws:
IllegalArgumentException
- if no agent outcome is providedIllegalStateException
- if no action or tool is found for execution
-