AS AgentScopeAPI 手册 / API Reference

ToolSchema

public class ToolSchema
源码Source io/agentscope/core/model/ToolSchema.java:28–182

工具模式,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.model 包。核心成员包括 getName、getDescription、getParameters、getOutputSchema、getStrict、builder。

Immutable tool schema definition. Describes a tool's interface using JSON Schema for parameters.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
Builder for creating ToolSchema instances.

方法摘要Method Summary

方法Method说明Description
public String getName()
获取工具名称。
Gets the tool name.
public String getDescription()
获取 `getDescription`。
Gets the tool description.
public Map<String, Object> getParameters()
获取工具参数 as JSON 模式。
Gets the tool parameters as a JSON Schema.
public Map<String, Object> getOutputSchema()
获取可选工具输出模式 as JSON 模式。
Gets the optional tool output schema as a JSON Schema.
public Boolean getStrict()
获取 `getStrict`。
Gets the strict mode flag for schema validation.
public static Builder builder()
static
创建新的构建器用于 ToolSchema。
Creates a new builder for ToolSchema.

方法详情Method Detail

getName

public String getName()

获取工具名称。

Gets the tool name.

返回Returns String
工具名称。the tool name
源码Source io/agentscope/core/model/ToolSchema.java:59–61

getDescription

public String getDescription()

获取 getDescription。

Gets the tool description.

返回Returns String
返回字符串结果。the tool description
源码Source io/agentscope/core/model/ToolSchema.java:68–70

getParameters

public Map<String, Object> getParameters()

获取工具参数 as JSON 模式。

Gets the tool parameters as a JSON Schema.

返回Returns Map<String, Object>
返回映射。an unmodifiable map containing the parameter schema
源码Source io/agentscope/core/model/ToolSchema.java:77–79

getOutputSchema

public Map<String, Object> getOutputSchema()

获取可选工具输出模式 as JSON 模式。

Gets the optional tool output schema as a JSON Schema.

返回Returns Map<String, Object>
返回映射。an unmodifiable map containing the output schema, or null if unspecified
源码Source io/agentscope/core/model/ToolSchema.java:86–88

getStrict

public Boolean getStrict()

获取 getStrict。

Gets the strict mode flag for schema validation.

返回Returns Boolean
返回布尔值,表示判断结果。true if strict mode is enabled, false otherwise, or null if not specified
源码Source io/agentscope/core/model/ToolSchema.java:95–97

builder

public static Builder builder()
static

创建新的构建器用于 ToolSchema。

Creates a new builder for ToolSchema.

返回Returns Builder
一种新的构建器实例。a new Builder instance
源码Source io/agentscope/core/model/ToolSchema.java:104–106

嵌套类详情Nested Class Detail

Builder

public static class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.core.model 包。核心成员包括 name、description、parameters、outputSchema、strict、build。

Builder for creating ToolSchema instances.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.