Builder
public static class Builder
源码Source
io/agentscope/core/tool/ToolCallParam.java:161–258ToolCallParam的构建器。位于 io.agentscope.core.tool 包。核心成员包括 toolUseBlock、input、agent、runtimeContext、context、emitter。
Builder for ToolCallParam.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder toolUseBlock(ToolUseBlock toolUseBlock) | 设置工具使用块。 Sets the tool use block. |
public Builder input(Map<String, Object> input) | 设置输入参数。 Sets the input parameters. |
public Builder agent(Agent agent) | 设置智能体。 Sets the calling agent. |
public Builder runtimeContext(RuntimeContext runtimeContext) | 设置运行时上下文用于工具调用。 Sets the runtime context for the tool call. |
public Builder context(ToolExecutionContext context)deprecated | 设置工具执行上下文。 Sets the tool execution context. |
public Builder emitter(ToolEmitter emitter) | 设置ToolEmitter 用于流式工具输出。 Sets the ToolEmitter for streaming tool output. |
public ToolCallParam build() | 构建ToolCallParam 实例。 Builds the ToolCallParam instance. |
方法详情Method Detail
toolUseBlock
public Builder toolUseBlock(ToolUseBlock toolUseBlock)
设置工具使用块。
Sets the tool use block.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolUseBlock | ToolUseBlock | 工具使用块。The tool use block |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/tool/ToolCallParam.java:184–187input
public Builder input(Map<String, Object> input)
设置输入参数。
Sets the input parameters.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
input | Map<String, Object> | 输入参数。The input parameters |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/tool/ToolCallParam.java:195–198agent
public Builder agent(Agent agent)
设置智能体。
Sets the calling agent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体。The agent |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/tool/ToolCallParam.java:206–209runtimeContext
public Builder runtimeContext(RuntimeContext runtimeContext)
设置运行时上下文用于工具调用。
Sets the runtime context for the tool call.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文。The runtime context |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/tool/ToolCallParam.java:217–220context
public Builder context(ToolExecutionContext context)
deprecated
设置工具执行上下文。
Sets the tool execution context.
已弃用。Deprecated. 已弃用,请改用受支持的替代 API。Use `#runtimeContext(RuntimeContext)` instead.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
context | ToolExecutionContext | 执行上下文。The execution context |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/tool/ToolCallParam.java:229–237emitter
public Builder emitter(ToolEmitter emitter)
设置ToolEmitter 用于流式工具输出。
Sets the ToolEmitter for streaming tool output.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
emitter | ToolEmitter | emitter(类型 `ToolEmitter`)。The ToolEmitter |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/core/tool/ToolCallParam.java:245–248build
public ToolCallParam build()
构建ToolCallParam 实例。
Builds the ToolCallParam instance.
ToolCallParam一种新的ToolCallParam。A new ToolCallParam
源码Source
io/agentscope/core/tool/ToolCallParam.java:255–257