Builder
public static final class Builder
源码Source
io/agentscope/extensions/model/openaiofficial/credential/OpenAIOfficialCredential.java:95–126构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.model.openaiofficial.credential 包。核心成员包括 id、apiKey、organization、baseUrl、build。
A class in io.agentscope.extensions.model.openaiofficial.credential that talks to model services and returns generated or embedded output. Declared in io.agentscope.extensions.model.openaiofficial.credential.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder id(String id) | 设置标识。 Performs the id operation. |
public Builder apiKey(String apiKey) | 设置API 键。 Performs the api key operation. |
public Builder organization(String organization) | 设置该配置项。 Performs the organization operation. |
public Builder baseUrl(String baseUrl) | 设置基类 URL。 Performs the base url operation. |
public OpenAIOfficialCredential build() | 构建并返回最终实例。 Creates and returns an instance. |
方法详情Method Detail
id
public Builder id(String id)
设置标识。
Performs the id operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/extensions/model/openaiofficial/credential/OpenAIOfficialCredential.java:103–106apiKey
public Builder apiKey(String apiKey)
设置API 键。
Performs the api key operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 键(类型 `String`)。The api key. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/extensions/model/openaiofficial/credential/OpenAIOfficialCredential.java:108–111organization
public Builder organization(String organization)
设置该配置项。
Performs the organization operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
organization | String | organization(类型 `String`)。The organization. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/extensions/model/openaiofficial/credential/OpenAIOfficialCredential.java:113–116baseUrl
public Builder baseUrl(String baseUrl)
设置基类 URL。
Performs the base url operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL(类型 `String`)。The base url. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/extensions/model/openaiofficial/credential/OpenAIOfficialCredential.java:118–121build
public OpenAIOfficialCredential build()
构建并返回最终实例。
Creates and returns an instance.
OpenAIOfficialCredential返回OpenAIOfficialCredential。Returns OpenAI official credential.
源码Source
io/agentscope/extensions/model/openaiofficial/credential/OpenAIOfficialCredential.java:123–125