Class AgentTool.AgentToolExecutor

java.lang.Object
com.alibaba.cloud.ai.graph.agent.AgentTool.AgentToolExecutor
Enclosing class:
AgentTool

public static class AgentTool.AgentToolExecutor extends Object
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 Details

    • AgentToolExecutor

      public AgentToolExecutor(ReactAgent agent)
  • 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" parameter
      toolContext - the tool context containing state, config, etc. (automatically injected)
      Returns:
      AssistantMessage the response from the agent