Class WriteTodosTool
java.lang.Object
com.alibaba.cloud.ai.graph.agent.tools.WriteTodosTool
- All Implemented Interfaces:
BiFunction<WriteTodosTool.Request,org.springframework.ai.chat.model.ToolContext, WriteTodosTool.Response>
public class WriteTodosTool
extends Object
implements BiFunction<WriteTodosTool.Request,org.springframework.ai.chat.model.ToolContext,WriteTodosTool.Response>
Tool for writing and managing todos in the agent workflow.
This tool allows agents to create, update, and track task lists.
Inspired by Claude Code's TodoWrite tool, it helps AI agents track progress, organize complex tasks, and provide visibility into task execution.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordstatic final recordTool response with success status and message.static interfaceHandler invoked when todos are updated. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWriteTodosTool(WriteTodosTool.TodoEventHandler todoEventHandler) -
Method Summary
Modifier and TypeMethodDescriptionapply(WriteTodosTool.Request request, org.springframework.ai.chat.model.ToolContext toolContext) static WriteTodosTool.Builderbuilder()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
-
Field Details
-
SUCCESS_MESSAGE
- See Also:
-
DEFAULT_TOOL_DESCRIPTION
- See Also:
-
-
Constructor Details
-
WriteTodosTool
public WriteTodosTool() -
WriteTodosTool
-
-
Method Details
-
apply
public WriteTodosTool.Response apply(WriteTodosTool.Request request, org.springframework.ai.chat.model.ToolContext toolContext) - Specified by:
applyin interfaceBiFunction<WriteTodosTool.Request,org.springframework.ai.chat.model.ToolContext, WriteTodosTool.Response>
-
builder
-