Builder
public static class Builder
源码Source
io/agentscope/core/message/ToolUseBlock.java:200–285构建器,用于构建并配置目标实例。位于 io.agentscope.core.message 包。核心成员包括 id、name、input、content、metadata、state。
Builder for constructing ToolUseBlock instances.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder id(String id) | 设置标识。 Sets the unique identifier for the tool call. |
public Builder name(String name) | 设置名称的工具到执行。 Sets the name of the tool to execute. |
public Builder input(Map<String, Object> input) | 设置输入参数用于工具。 Sets the input parameters for the tool. |
public Builder content(String content) | 设置原始内容用于流式工具调用。 Sets the raw content for streaming tool calls. |
public Builder metadata(Map<String, Object> metadata) | 设置元数据。 Sets the provider-specific metadata. |
public Builder state(ToolCallState state) | 设置工具调用状态。 Sets the tool call state. |
public ToolUseBlock build() | 构建并返回最终实例。 Builds a new ToolUseBlock with the configured properties. |
方法详情Method Detail
id
public Builder id(String id)
设置标识。
Sets the unique identifier for the tool call.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 工具调用标识。The tool call ID |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ToolUseBlock.java:214–217name
public Builder name(String name)
设置名称的工具到执行。
Sets the name of the tool to execute.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 工具名称。The tool name |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ToolUseBlock.java:225–228input
public Builder input(Map<String, Object> input)
设置输入参数用于工具。
Sets the input parameters for the tool.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
input | Map<String, Object> | 工具输入参数映射。The tool input parameters map |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ToolUseBlock.java:236–239content
public Builder content(String content)
设置原始内容用于流式工具调用。
Sets the raw content for streaming tool calls.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
content | String | 原始内容用于流式。The raw content for streaming |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ToolUseBlock.java:247–250metadata
public Builder metadata(Map<String, Object> metadata)
设置元数据。
Sets the provider-specific metadata.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
metadata | Map<String, Object> | 元数据映射。The metadata map |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ToolUseBlock.java:261–264state
public Builder state(ToolCallState state)
设置工具调用状态。
Sets the tool call state.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
state | ToolCallState | 工具调用状态。The tool call state |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ToolUseBlock.java:272–275build
public ToolUseBlock build()
构建并返回最终实例。
Builds a new ToolUseBlock with the configured properties.
ToolUseBlock一种新的ToolUseBlock 实例。A new ToolUseBlock instance
源码Source
io/agentscope/core/message/ToolUseBlock.java:282–284