TeamTool
public final class TeamTool
io/agentscope/harness/agent/tool/TeamTool.java:38–709团队工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包。核心成员包括 team、listTasks、listClaimableTasks、createTask、assignTask、claimTask。
Unified AgentTeams tool. Actions are gated by TeamContext#availableActions() (lead gets
create/assign/spawn/shutdown/approve/complete; workers get list/claim/message).
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public TeamTool(TeamClient client, TeamContext context) | 初始化 `TeamTool` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
TeamTool
public TeamTool(TeamClient client, TeamContext context)
初始化 TeamTool 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | TeamClient | 客户端(类型 `TeamClient`)。The client. |
context | TeamContext | 上下文(类型 `TeamContext`)。The context. |
io/agentscope/harness/agent/tool/TeamTool.java:45–48方法详情Method Detail
team
public String team(String action, String taskId, String subject, String description, String owner, Long expectedVersion, String result, String toMember, String content, Integer limit, String memberName, String agentRef, String prompt, String planText)
执行团队相关操作。
Performs the team operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
action | String | 动作(类型 `String`)。The action. |
taskId | String | 任务标识(类型 `String`)。The task id. |
subject | String | 主题(类型 `String`)。The subject. |
description | String | 描述(类型 `String`)。The description. |
owner | String | 所有者(类型 `String`)。The owner. |
expectedVersion | Long | expected 版本(类型 `Long`)。The expected version. |
result | String | 结果(类型 `String`)。The result. |
toMember | String | 到成员(类型 `String`)。The to member. |
content | String | 内容(类型 `String`)。The content. |
limit | Integer | 数量上限(类型 `Integer`)。The limit. |
memberName | String | 成员名称(类型 `String`)。The member name. |
agentRef | String | 智能体引用(类型 `String`)。The agent ref. |
prompt | String | 提示词(类型 `String`)。The prompt. |
planText | String | 计划文本(类型 `String`)。The plan text. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:50–221listTasks
public String listTasks()
列出任务。
Lists the tasks.
Stringio/agentscope/harness/agent/tool/TeamTool.java:225–242listClaimableTasks
public String listClaimableTasks()
列出 listClaimableTasks。
Lists the claimable tasks.
Stringio/agentscope/harness/agent/tool/TeamTool.java:244–266createTask
public String createTask(String subject, String description, String owner)
创建任务。
Creates the task.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
subject | String | 主题(类型 `String`)。The subject. |
description | String | 描述(类型 `String`)。The description. |
owner | String | 所有者(类型 `String`)。The owner. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:268–298assignTask
public String assignTask(String taskId, String owner, Long expectedVersion)
执行 assignTask 方法。
Performs the assign task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
taskId | String | 任务标识(类型 `String`)。The task id. |
owner | String | 所有者(类型 `String`)。The owner. |
expectedVersion | Long | expected 版本(类型 `Long`)。The expected version. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:300–329claimTask
public String claimTask(String taskId, Long expectedVersion)
执行 claimTask 方法。
Performs the claim task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
taskId | String | 任务标识(类型 `String`)。The task id. |
expectedVersion | Long | expected 版本(类型 `Long`)。The expected version. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:331–359unclaimTask
public String unclaimTask(String taskId, Long expectedVersion)
执行 unclaimTask 方法。
Performs the unclaim task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
taskId | String | 任务标识(类型 `String`)。The task id. |
expectedVersion | Long | expected 版本(类型 `Long`)。The expected version. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:361–384failTask
public String failTask(String taskId, String reason)
执行 failTask 方法。
Performs the fail task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
taskId | String | 任务标识(类型 `String`)。The task id. |
reason | String | 原因(类型 `String`)。The reason. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:386–409completeTask
public String completeTask(String taskId, String result)
执行 completeTask 方法。
Performs the complete task operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
taskId | String | 任务标识(类型 `String`)。The task id. |
result | String | 结果(类型 `String`)。The result. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:411–435sendMessage
public String sendMessage(String toMember, String content)
发送消息。
Sends the message.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toMember | String | 到成员(类型 `String`)。The to member. |
content | String | 内容(类型 `String`)。The content. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:437–456broadcastMessage
public String broadcastMessage(String content)
设置该参数。
Performs the broadcast message operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
content | String | 内容(类型 `String`)。The content. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:458–476listMessages
public String listMessages(Integer limit)
列出消息。
Lists the messages.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
limit | Integer | 数量上限(类型 `Integer`)。The limit. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:478–497listMembers
public String listMembers()
列出成员。
Lists the members.
Stringio/agentscope/harness/agent/tool/TeamTool.java:499–516spawnMember
public String spawnMember(String memberName, String agentRef, String prompt)
执行 spawnMember 方法。
Performs the spawn member operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memberName | String | 成员名称(类型 `String`)。The member name. |
agentRef | String | 智能体引用(类型 `String`)。The agent ref. |
prompt | String | 提示词(类型 `String`)。The prompt. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:518–539shutdownMember
public String shutdownMember(String memberName)
设置该参数。
Performs the shutdown member operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memberName | String | 成员名称(类型 `String`)。The member name. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:541–559submitPlan
public String submitPlan(String planText, String memberName)
执行提交计划相关操作。
Performs the submit plan operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
planText | String | 计划文本(类型 `String`)。The plan text. |
memberName | String | 成员名称(类型 `String`)。The member name. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:561–581approvePlan
public String approvePlan(String memberName)
批准计划。
Performs the approve plan operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memberName | String | 成员名称(类型 `String`)。The member name. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:583–602rejectPlan
public String rejectPlan(String memberName)
拒绝计划。
Performs the reject plan operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memberName | String | 成员名称(类型 `String`)。The member name. |
Stringio/agentscope/harness/agent/tool/TeamTool.java:604–623completeTeam
public String completeTeam()
返回 completeTeam 结果。
Returns the complete team.
Stringio/agentscope/harness/agent/tool/TeamTool.java:625–642