AgentGenerateTool
public class AgentGenerateTool
io/agentscope/harness/agent/tool/AgentGenerateTool.java:42–155智能体 Generate 工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包。核心成员包括 agentGenerate、AgentGenerateTool。
Tool that generates a new subagent spec from a natural-language description and either persists
it to subagents/<name>.md (where io.agentscope.harness.agent.middleware.DynamicSubagentsMiddleware
will pick it up on the next reasoning step) or returns the markdown for human review.
Wraps SubagentSpecGenerator; takes care of name validation, collision detection
against the live DefaultAgentManager registry, and dry-run handling.
Not registered by io.agentscope.harness.agent.middleware.SubagentsMiddleware by
default; callers must opt in via SubagentsMiddleware#enableAgentGenerateTool(...).
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentGenerateTool(SubagentSpecGenerator generator, DefaultAgentManager agentManager, AbstractFilesystem filesystem) | 初始化 `AgentGenerateTool` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Mono<String> agentGenerate(RuntimeContext runtimeContext, String name, String description, Boolean dryRun) | 执行 `agentGenerate` 方法。 Performs the agent generate operation. |
构造器详情Constructor Detail
AgentGenerateTool
public AgentGenerateTool(SubagentSpecGenerator generator, DefaultAgentManager agentManager, AbstractFilesystem filesystem)
初始化 AgentGenerateTool 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
generator | SubagentSpecGenerator | generator(类型 `SubagentSpecGenerator`)。The generator. |
agentManager | DefaultAgentManager | 智能体管理器(类型 `DefaultAgentManager`)。The agent manager. |
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
io/agentscope/harness/agent/tool/AgentGenerateTool.java:53–60方法详情Method Detail
agentGenerate
public Mono<String> agentGenerate(RuntimeContext runtimeContext, String name, String description, Boolean dryRun)
执行 agentGenerate 方法。
Performs the agent generate operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
name | String | 名称(类型 `String`)。The name. |
description | String | 描述(类型 `String`)。The description. |
dryRun | Boolean | dry 运行(类型 `Boolean`)。The dry run. |
Mono<String>io/agentscope/harness/agent/tool/AgentGenerateTool.java:62–154