类 SubAgentTool
- 所有已实现的接口:
AgentTool
This tool allows an agent to be called as a tool by other agents, supporting multi-turn conversation with session management. Each session maintains its own agent instance and state.
Thread safety is ensured by using SubAgentProvider to create a fresh agent instance
for each new session.
The tool exposes two parameters:
session_id- Optional. Omit to start a new session, provide to continue an existing one.message- Required. The message to send to the agent.
-
构造器概要
构造器构造器说明SubAgentTool(SubAgentProvider<?> agentProvider, SubAgentConfig config) Creates a new SubAgentTool. -
方法概要
修饰符和类型方法说明reactor.core.publisher.Mono<ToolResultBlock> callAsync(ToolCallParam param) Execute the tool with the given parameters (asynchronous).Gets the description of the tool.getName()Gets the name of the tool.Gets the parameters schema for this tool in JSON Schema format.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 io.agentscope.core.tool.AgentTool
getOutputSchema
-
构造器详细资料
-
SubAgentTool
Creates a new SubAgentTool.- 参数:
agentProvider- Provider for creating agent instancesconfig- Configuration for the tool
-
-
方法详细资料
-
getName
从接口复制的说明:AgentToolGets the name of the tool.The name should be unique within a toolkit and follow snake_case convention for compatibility with various LLM providers.
-
getDescription
从接口复制的说明:AgentToolGets the description of the tool.The description should clearly explain what the tool does, when it should be used, and what kind of results it returns. This helps the LLM decide when to invoke the tool.
- 指定者:
getDescription在接口中AgentTool- 返回:
- The tool description (never null)
-
getParameters
从接口复制的说明:AgentToolGets the parameters schema for this tool in JSON Schema format.The schema defines the structure of the input parameters that this tool accepts. It should include:
- type: "object"
- properties: Map of parameter names to their schemas
- required: List of required parameter names
- 指定者:
getParameters在接口中AgentTool- 返回:
- Map representing the JSON Schema for tool parameters (never null)
-
callAsync
从接口复制的说明:AgentToolExecute the tool with the given parameters (asynchronous).This method accepts a
ToolCallParamobject containing all necessary context for tool execution, including:- toolUseBlock: Contains tool call ID and name for tracking
- input: Input parameters for the tool
- agent: The calling agent (may be null), provides access to agent context
-