Builder
public static class Builder
源码Source
io/agentscope/core/training/backend/TrinityModelAdapter.java:125–184TrinityModelAdapter的构建器。位于 io.agentscope.core.training.backend 包。核心成员包括 baseUrl、modelName、apiKey、executionContext、build。
Builder for TrinityModelAdapter
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder baseUrl(String baseUrl) | 设置基类 URL。 Performs the base url operation. |
public Builder modelName(String modelName) | 设置模型名称。 Performs the model name operation. |
public Builder apiKey(String apiKey) | 设置API 键。 Performs the api key operation. |
public Builder executionContext(RunExecutionContext context) | 设置任务执行上下文(内部方法,不可见到用户)。 Set task execution context (internal method, not visible to users) |
public TrinityModelAdapter build() | 构建TrinityModelAdapter。 Build TrinityModelAdapter |
方法详情Method Detail
baseUrl
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/core/training/backend/TrinityModelAdapter.java:131–134modelName
public Builder modelName(String modelName)
设置模型名称。
Performs the model name operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称(类型 `String`)。The model name. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/training/backend/TrinityModelAdapter.java:136–139apiKey
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/core/training/backend/TrinityModelAdapter.java:141–144executionContext
public Builder executionContext(RunExecutionContext context)
设置任务执行上下文(内部方法,不可见到用户)。
Set task execution context (internal method, not visible to users) Called by TrainingRouter for automatic msg_ids collection.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
context | RunExecutionContext | 上下文(类型 `RunExecutionContext`)。Task execution context |
Builder返回当前实例,以支持链式调用。this
源码Source
io/agentscope/core/training/backend/TrinityModelAdapter.java:154–157build
public TrinityModelAdapter build()
构建TrinityModelAdapter。
Build TrinityModelAdapter
TrinityModelAdapter返回TrinityModelAdapter。TrinityModelAdapter instance
源码Source
io/agentscope/core/training/backend/TrinityModelAdapter.java:164–183