类 ToolUseBlock
java.lang.Object
io.agentscope.core.message.ContentBlock
io.agentscope.core.message.ToolUseBlock
- 所有已实现的接口:
State
Represents a tool use request within a message.
This content block is used when an agent requests to execute a tool. It contains the tool's unique identifier, name, input parameters, and optionally the raw content for streaming tool calls.
The tool input is stored as a generic map of string keys to object values, allowing for flexible parameter passing to different tool implementations.
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器构造器说明Creates a new tool use block without metadata (convenience constructor).ToolUseBlock(String id, String name, Map<String, Object> input, String content, Map<String, Object> metadata) Creates a new tool use block with raw content for streaming.Creates a new tool use block for JSON deserialization. -
方法概要
修饰符和类型方法说明static ToolUseBlock.Builderbuilder()Creates a new builder for constructing a ToolUseBlock.Gets the raw content for streaming tool calls.getId()Gets the unique identifier of this tool call.getInput()Gets the input parameters for the tool.Gets the provider-specific metadata.getName()Gets the name of the tool to execute.
-
字段详细资料
-
METADATA_THOUGHT_SIGNATURE
Metadata key for Gemini thought signature (byte[] value).- 另请参阅:
-
-
构造器详细资料
-
ToolUseBlock
Creates a new tool use block for JSON deserialization.- 参数:
id- Unique identifier for this tool callname- Name of the tool to executeinput- Input parameters for the tool (will be defensively copied)metadata- Provider-specific metadata (will be defensively copied)
-
ToolUseBlock
Creates a new tool use block without metadata (convenience constructor).- 参数:
id- Unique identifier for this tool callname- Name of the tool to executeinput- Input parameters for the tool (will be defensively copied)
-
ToolUseBlock
public ToolUseBlock(String id, String name, Map<String, Object> input, String content, Map<String, Object> metadata) Creates a new tool use block with raw content for streaming.- 参数:
id- Unique identifier for this tool callname- Name of the tool to executeinput- Input parameters for the tool (will be defensively copied)content- Raw content for streaming tool callsmetadata- Provider-specific metadata (will be defensively copied)
-
-
方法详细资料
-
getId
Gets the unique identifier of this tool call.- 返回:
- The tool call ID
-
getName
Gets the name of the tool to execute.- 返回:
- The tool name
-
getInput
Gets the input parameters for the tool.- 返回:
- The tool input parameters map
-
getContent
Gets the raw content for streaming tool calls.- 返回:
- The raw content, or null if not set
-
getMetadata
Gets the provider-specific metadata.For Gemini, this may contain the thought signature under the key
METADATA_THOUGHT_SIGNATURE.- 返回:
- The metadata map, or an empty map if not set
-
builder
Creates a new builder for constructing a ToolUseBlock.- 返回:
- A new builder instance
-