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 |
|---|---|---|
name | String | 工具名称。the tool name |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/model/ToolSchema.java:124–127description
public Builder description(String description)
设置该配置项。
Sets the tool description.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
description | String | 描述(类型 `String`)。the tool description |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/model/ToolSchema.java:135–138parameters
public Builder parameters(Map<String, Object> parameters)
设置工具参数 as JSON 模式。
Sets the tool parameters as a JSON Schema.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
parameters | Map<String, Object> | 参数模式。the parameter schema |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/model/ToolSchema.java:146–149outputSchema
public Builder outputSchema(Map<String, Object> outputSchema)
设置可选工具输出模式 as JSON 模式。
Sets the optional tool output schema as a JSON Schema.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
outputSchema | Map<String, Object> | 输出模式。the output schema |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/model/ToolSchema.java:157–160strict
public Builder strict(Boolean strict)
设置该配置项。
Sets the strict mode for schema validation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
strict | Boolean | strict(类型 `Boolean`)。whether to enable strict mode |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/model/ToolSchema.java:168–171build
public ToolSchema build()
构建新的ToolSchema 实例使用设置值。
Builds a new ToolSchema instance with the set values.
ToolSchema一种新的ToolSchema 实例。a new ToolSchema instance
源码Source
io/agentscope/core/model/ToolSchema.java:178–180