类 ToolCallParam
java.lang.Object
io.agentscope.core.tool.ToolCallParam
Parameters for tool invocation.
This class encapsulates all the information needed to call a tool, including the tool use block (containing metadata like call ID and tool name), input parameters, and the calling agent.
Using a parameter object instead of multiple method parameters provides better extensibility - new parameters can be added without breaking existing code.
Example usage:
ToolCallParam param = ToolCallParam.builder()
.toolUseBlock(toolUseBlock)
.input(Map.of("key", "value"))
.agent(agent)
.build();
ToolResultBlock result = tool.callAsync(param).block();
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static ToolCallParam.Builderbuilder()Creates a new builder for constructing ToolCallParam instances.getAgent()Gets the agent making the call.Gets the tool execution context.Gets the ToolEmitter for streaming tool output.getInput()Gets the input parameters for the tool call.Gets the tool use block containing call metadata.
-
方法详细资料
-
getToolUseBlock
Gets the tool use block containing call metadata.- 返回:
- The tool use block
-
getInput
Gets the input parameters for the tool call.- 返回:
- Unmodifiable map of input parameters
-
getAgent
Gets the agent making the call.- 返回:
- The agent, or null if not provided
-
getContext
Gets the tool execution context.- 返回:
- The execution context, or null if not provided
-
getEmitter
Gets the ToolEmitter for streaming tool output.Tools can use this emitter to send intermediate progress updates during execution. If no emitter is configured, returns a no-op emitter that silently discards chunks.
- 返回:
- The ToolEmitter, never null
-
builder
Creates a new builder for constructing ToolCallParam instances.- 返回:
- A new builder
-