Package com.alibaba.cloud.ai.graph.agent
Class AgentTool
java.lang.Object
com.alibaba.cloud.ai.graph.agent.AgentTool
Factory class for creating MethodToolCallback instances for ReactAgent.
This class provides a programmatic way to create MethodToolCallback without requiring @Tool annotation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExecutor class for AgentTool that contains the method to be used by MethodToolCallback. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.ai.tool.ToolCallbackcreate(ReactAgent agent) Create a ToolCallback using MethodToolCallback.static org.springframework.ai.tool.ToolCallbackCreate a ToolCallback using MethodToolCallback.
-
Constructor Details
-
AgentTool
public AgentTool()
-
-
Method Details
-
getFunctionToolCallback
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
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
-