Builder
public static class Builder
io/agentscope/core/training/runner/TrainingConfig.java:125–258构建器,用于构建并配置目标实例。位于 io.agentscope.core.training.runner 包。核心成员包括 trinityEndpoint、trinityApiKey、modelName、selectionStrategy、sampleRate、rewardCalculator。
A class in io.agentscope.core.training.runner that evaluates agent behaviour and records tracing and telemetry data. Declared in io.agentscope.core.training.runner.
方法摘要Method Summary
方法详情Method Detail
trinityEndpoint
public Builder trinityEndpoint(String endpoint)
设置该配置项。
Performs the trinity endpoint operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
endpoint | String | 端点地址(类型 `String`)。The endpoint. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:139–142trinityApiKey
public Builder trinityApiKey(String apiKey)
设置该配置项。
Performs the trinity api key operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 键(类型 `String`)。The api key. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:144–147modelName
public Builder modelName(String modelName)
设置模型名称。
Performs the model name operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称(类型 `String`)。The model name. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:149–152selectionStrategy
public Builder selectionStrategy(TrainingSelectionStrategy strategy)
设置该配置项。
Set training request filtering strategy Supports multiple strategies: - SamplingRateStrategy - Based on sampling rate - io.agentscope.core.training.strategy.ExplicitMarkingStrategy - Based on user explicit marking - Custom strategy - Implement TrainingSelectionStrategy
| 名称Name | 类型Type | 说明Description |
|---|---|---|
strategy | TrainingSelectionStrategy | strategy(类型 `TrainingSelectionStrategy`)。Filtering strategy |
Builderio/agentscope/core/training/runner/TrainingConfig.java:167–170sampleRate
public Builder sampleRate(double sampleRate)
设置该配置项。
Shortcut method: Set simple sampling rate strategy
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sampleRate | double | sample 速率(类型 `double`)。Sampling rate (0.0 ~ 1.0) |
Builderio/agentscope/core/training/runner/TrainingConfig.java:179–186rewardCalculator
public Builder rewardCalculator(RewardCalculator calculator)
设置该配置项。
Performs the reward calculator operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
calculator | RewardCalculator | calculator(类型 `RewardCalculator`)。The calculator. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:188–191commitIntervalSeconds
public Builder commitIntervalSeconds(long seconds)
设置提交间隔秒。
Performs the commit interval seconds operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
seconds | long | 秒(类型 `long`)。The seconds. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:193–196httpTimeout
public Builder httpTimeout(Duration timeout)
设置HTTP 超时。
Performs the http timeout operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
timeout | Duration | 超时时间(类型 `Duration`)。The timeout. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:198–201enableAutoCommit
public Builder enableAutoCommit(boolean enable)
启用该配置。
Enables the auto commit.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
enable | boolean | 启用(类型 `boolean`)。The enable. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:203–206shadowPoolSize
public Builder shadowPoolSize(int size)
设置该配置项。
Performs the shadow pool size operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
size | int | 大小(类型 `int`)。The size. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:208–211shadowPoolCapacity
public Builder shadowPoolCapacity(int capacity)
设置该配置项。
Performs the shadow pool capacity operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
capacity | int | capacity(类型 `int`)。The capacity. |
Builderio/agentscope/core/training/runner/TrainingConfig.java:213–216repeatTime
public Builder repeatTime(int repeatTime)
设置该配置项。
Set repeat execution count for each task When a request is selected for training, it will run repeatTime times with the same taskId, each run will be assigned an incrementing runId (0, 1, 2, ...).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
repeatTime | int | repeat 时间(类型 `int`)。Repeat execution count, must be >= 1, defaults to 1 |
BuilderIllegalArgumentException可能抛出 `IllegalArgumentException`。if repeatTime < 1
io/agentscope/core/training/runner/TrainingConfig.java:235–241build
public TrainingConfig build()
构建并返回最终实例。
Creates and returns an instance.
TrainingConfigio/agentscope/core/training/runner/TrainingConfig.java:243–257