类 DefaultToolResultConverter
java.lang.Object
io.agentscope.core.tool.DefaultToolResultConverter
- 所有已实现的接口:
ToolResultConverter
Default implementation of ToolResultConverter.
Handles JSON serialization with schema information.
This converter:
- Converts null results to "null" text
- Converts void results to "Done" text
- Passes through ToolResultBlock instances unchanged
- Serializes objects to JSON with schema information
- Falls back to toString() if serialization fails
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Convert tool call result to ToolResultBlock.protected ToolResultBlockHandle null result.protected ToolResultBlockHandle void return type.protected ToolResultBlockSerialize result to JSON string with schema.
-
构造器详细资料
-
DefaultToolResultConverter
public DefaultToolResultConverter()
-
-
方法详细资料
-
convert
从接口复制的说明:ToolResultConverterConvert tool call result to ToolResultBlock.- 指定者:
convert在接口中ToolResultConverter- 参数:
result- the tool call result (may be null)returnType- the return type of the tool method (may be null)- 返回:
- ToolResultBlock containing the converted result (never null)
-
handleNull
Handle null result.- 返回:
- ToolResultBlock with "null" text
-
handleVoid
Handle void return type.- 返回:
- ToolResultBlock with "Done" text
-
serialize
Serialize result to JSON string with schema.- 参数:
result- the result to serializereturnType- the return type- 返回:
- ToolResultBlock with JSON string and schema
-