AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/model/ToolSchema.java:111–181

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

Builder for creating ToolSchema instances.

方法摘要Method Summary

方法Method说明Description
public Builder name(String name)
设置工具名称。
Sets the tool name.
public Builder description(String description)
设置该配置项。
Sets the tool description.
public Builder parameters(Map<String, Object> parameters)
设置工具参数 as JSON 模式。
Sets the tool parameters as a JSON Schema.
public Builder outputSchema(Map<String, Object> outputSchema)
设置可选工具输出模式 as JSON 模式。
Sets the optional tool output schema as a JSON Schema.
public Builder strict(Boolean strict)
设置该配置项。
Sets the strict mode for schema validation.
public ToolSchema build()
构建新的ToolSchema 实例使用设置值。
Builds a new ToolSchema instance with the set values.

方法详情Method Detail

name

public Builder name(String name)

设置工具名称。

Sets the tool name.

参数Parameters
名称Name类型Type说明Description
nameString工具名称。the tool name
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ToolSchema.java:124–127

description

public Builder description(String description)

设置该配置项。

Sets the tool description.

参数Parameters
名称Name类型Type说明Description
descriptionString描述(类型 `String`)。the tool description
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ToolSchema.java:135–138

parameters

public Builder parameters(Map<String, Object> parameters)

设置工具参数 as JSON 模式。

Sets the tool parameters as a JSON Schema.

参数Parameters
名称Name类型Type说明Description
parametersMap<String, Object>参数模式。the parameter schema
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ToolSchema.java:146–149

outputSchema

public Builder outputSchema(Map<String, Object> outputSchema)

设置可选工具输出模式 as JSON 模式。

Sets the optional tool output schema as a JSON Schema.

参数Parameters
名称Name类型Type说明Description
outputSchemaMap<String, Object>输出模式。the output schema
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ToolSchema.java:157–160

strict

public Builder strict(Boolean strict)

设置该配置项。

Sets the strict mode for schema validation.

参数Parameters
名称Name类型Type说明Description
strictBooleanstrict(类型 `Boolean`)。whether to enable strict mode
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ToolSchema.java:168–171

build

public ToolSchema build()

构建新的ToolSchema 实例使用设置值。

Builds a new ToolSchema instance with the set values.

返回Returns ToolSchema
一种新的ToolSchema 实例。a new ToolSchema instance
源码Source io/agentscope/core/model/ToolSchema.java:178–180
基于官方固定版本源码静态生成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.