Package com.alibaba.cloud.ai.graph.agent
Class AgentTool.AgentToolExecutor
java.lang.Object
com.alibaba.cloud.ai.graph.agent.AgentTool.AgentToolExecutor
- Enclosing class:
- AgentTool
Executor class for AgentTool that contains the method to be used by MethodToolCallback.
This class does not require @Tool annotation, as the method is registered via reflection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.ai.chat.messages.AssistantMessageexecuteAgent(String input, org.springframework.ai.chat.model.ToolContext toolContext) Execute the agent tool with the given input.
-
Constructor Details
-
AgentToolExecutor
-
-
Method Details
-
executeAgent
public org.springframework.ai.chat.messages.AssistantMessage executeAgent(String input, org.springframework.ai.chat.model.ToolContext toolContext) Execute the agent tool with the given input. This method is used by MethodToolCallback via reflection. The ToolContext parameter is automatically injected by Spring AI and is not exposed to the LLM.- Parameters:
input- the input JSON string containing the "input" parametertoolContext- the tool context containing state, config, etc. (automatically injected)- Returns:
- AssistantMessage the response from the agent
-