Class AgentTool

java.lang.Object
com.alibaba.cloud.ai.graph.agent.AgentTool

public class AgentTool extends Object
Factory class for creating MethodToolCallback instances for ReactAgent. This class provides a programmatic way to create MethodToolCallback without requiring @Tool annotation.
  • Constructor Details

    • AgentTool

      public AgentTool()
  • Method Details

    • getFunctionToolCallback

      public static org.springframework.ai.tool.ToolCallback getFunctionToolCallback(ReactAgent agent)
      Create a ToolCallback using MethodToolCallback. This is a convenience method that delegates to AgentMethodToolCallback.create().
      Parameters:
      agent - the ReactAgent instance
      Returns:
      ToolCallback created with MethodToolCallback
      See Also:
    • create

      public static org.springframework.ai.tool.ToolCallback create(ReactAgent agent)
      Create a ToolCallback using MethodToolCallback. This method uses reflection to find the executeAgent method and builds MethodToolCallback directly without requiring @Tool annotation.
      Parameters:
      agent - the ReactAgent instance
      Returns:
      ToolCallback created with MethodToolCallback