Builder
public static class Builder
源码Source
io/agentscope/core/formatter/JsonSchema.java:103–129构建器,用于构建并配置目标实例。位于 io.agentscope.core.formatter 包。核心成员包括 name、description、schema、strict、build。
A class in io.agentscope.core.formatter that carries structured messages and events between agents, models and UIs. Declared in io.agentscope.core.formatter.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder name(String name) | 设置名称。 Performs the name operation. |
public Builder description(String description) | 设置该配置项。 Performs the description operation. |
public Builder schema(Map<String, Object> schemaMap) | 设置模式。 Performs the schema operation. |
public Builder strict(Boolean strict) | 设置该配置项。 Performs the strict operation. |
public JsonSchema build() | 构建并返回最终实例。 Creates and returns an instance. |
方法详情Method Detail
name
public Builder name(String name)
设置名称。
Performs the name operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/formatter/JsonSchema.java:106–109description
public Builder description(String description)
设置该配置项。
Performs the description operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
description | String | 描述(类型 `String`)。The description. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/formatter/JsonSchema.java:111–114schema
public Builder schema(Map<String, Object> schemaMap)
设置模式。
Performs the schema operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
schemaMap | Map<String, Object> | 模式映射(类型 `Map`)。The schema map. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/formatter/JsonSchema.java:116–119strict
public Builder strict(Boolean strict)
设置该配置项。
Performs the strict operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
strict | Boolean | strict(类型 `Boolean`)。The strict. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/formatter/JsonSchema.java:121–124build
public JsonSchema build()
构建并返回最终实例。
Creates and returns an instance.
JsonSchema返回JsonSchema。Returns json schema.
源码Source
io/agentscope/core/formatter/JsonSchema.java:126–128