Class TaskTool
java.lang.Object
com.alibaba.cloud.ai.graph.agent.extension.tools.model.TaskTool
- All Implemented Interfaces:
BiFunction<TaskTool.TaskRequest,org.springframework.ai.chat.model.ToolContext, String>
public class TaskTool
extends Object
implements BiFunction<TaskTool.TaskRequest,org.springframework.ai.chat.model.ToolContext,String>
Tool that enables invoking subagents to handle complex, isolated tasks.
This tool allows the main agent to delegate work to specialized subagents,
each with their own context and capabilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRequest structure for the task tool. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(TaskTool.TaskRequest request, org.springframework.ai.chat.model.ToolContext toolContext) static org.springframework.ai.tool.ToolCallbackcreateTaskToolCallback(Map<String, ReactAgent> subAgents, String description) Create a ToolCallback for the task tool.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
TaskTool
-
-
Method Details
-
apply
public String apply(TaskTool.TaskRequest request, org.springframework.ai.chat.model.ToolContext toolContext) - Specified by:
applyin interfaceBiFunction<TaskTool.TaskRequest,org.springframework.ai.chat.model.ToolContext, String>
-
createTaskToolCallback
public static org.springframework.ai.tool.ToolCallback createTaskToolCallback(Map<String, ReactAgent> subAgents, String description) Create a ToolCallback for the task tool.
-