AS AgentScopeAPI 手册 / API Reference

TodoTools

public class TodoTools
源码Source io/agentscope/core/tool/builtin/TodoTools.java:49–261

Todo 工具,封装可被智能体调用的能力。位于 io.agentscope.core.tool.builtin 包。核心成员包括 todoWrite。

Built-in task-list tool that lets the agent maintain a structured todo list for the current session, mirroring opencode's todowrite.

The single todo_write tool uses full-list-replace semantics: the model passes the entire updated list every call and the tool rebuilds AgentState#getTasksContext() from it. This is intentionally simpler than a granular create/update/delete surface — the model never has to reason about ids or partial diffs, and the latest complete list is always the source of truth (and is re-surfaced every turn by TaskReminderMiddleware).

The list is persisted automatically: AgentState.tasksContext is part of the agent state that ReActAgent flushes to its AgentStateStore after every call.

This tool is independent from the harness TaskTool (task_output / task_cancel / task_list), which manages background subagent runs — a different layer that this tool neither reads nor writes.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
TodoItem类class
Todo 条目,让智能体以受控方式调用外部能力。
A single todo item as supplied by the model.

方法摘要Method Summary

方法Method说明Description
public String todoWrite(List<TodoItem> todos, AgentState state)
执行 `todoWrite` 方法。
Replaces the session task list with `todos`.

方法详情Method Detail

todoWrite

public String todoWrite(List<TodoItem> todos, AgentState state)

执行 todoWrite 方法。

Replaces the session task list with todos.

参数Parameters
名称Name类型Type说明Description
todosList<TodoItem>todos(类型 `List`)。The todos.
stateAgentState状态对象(类型 `AgentState`)。The state.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/tool/builtin/TodoTools.java:92–173

嵌套类详情Nested Class Detail

TodoItem

public static final class TodoItem

Todo 条目,让智能体以受控方式调用外部能力。位于 io.agentscope.core.tool.builtin 包。核心成员包括 getContent、getStatus、getPriority、TodoItem。

A single todo item as supplied by the model.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.