AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/training/runner/TrainingRunner.java:231–291

TrainingRunner的构建器。位于 io.agentscope.core.training.runner 包。核心成员包括 config、trinityEndpoint、modelName、selectionStrategy、rewardCalculator、commitIntervalSeconds。

Builder for TrainingRunner

方法摘要Method Summary

方法Method说明Description
public Builder config(TrainingConfig config)
设置配置。
Performs the config operation.
public Builder trinityEndpoint(String endpoint)
设置该配置项。
Performs the trinity endpoint operation.
public Builder modelName(String modelName)
设置模型名称。
Performs the model name operation.
public Builder selectionStrategy(TrainingSelectionStrategy strategy)
设置该配置项。
Performs the selection strategy operation.
public Builder rewardCalculator(RewardCalculator calculator)
设置该配置项。
Performs the reward calculator operation.
public Builder commitIntervalSeconds(long seconds)
设置提交间隔秒。
Performs the commit interval seconds operation.
public Builder repeatTime(int repeatTime)
设置该配置项。
Performs the repeat time operation.
public TrainingRunner build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

config

public Builder config(TrainingConfig config)

设置配置。

Performs the config operation.

参数Parameters
名称Name类型Type说明Description
configTrainingConfig配置对象(类型 `TrainingConfig`)。The config.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:235–238

trinityEndpoint

public Builder trinityEndpoint(String endpoint)

设置该配置项。

Performs the trinity endpoint operation.

参数Parameters
名称Name类型Type说明Description
endpointString端点地址(类型 `String`)。The endpoint.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:240–243

modelName

public Builder modelName(String modelName)

设置模型名称。

Performs the model name operation.

参数Parameters
名称Name类型Type说明Description
modelNameString模型名称(类型 `String`)。The model name.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:245–248

selectionStrategy

public Builder selectionStrategy(TrainingSelectionStrategy strategy)

设置该配置项。

Performs the selection strategy operation.

参数Parameters
名称Name类型Type说明Description
strategyTrainingSelectionStrategystrategy(类型 `TrainingSelectionStrategy`)。The strategy.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:250–253

rewardCalculator

public Builder rewardCalculator(RewardCalculator calculator)

设置该配置项。

Performs the reward calculator operation.

参数Parameters
名称Name类型Type说明Description
calculatorRewardCalculatorcalculator(类型 `RewardCalculator`)。The calculator.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:255–258

commitIntervalSeconds

public Builder commitIntervalSeconds(long seconds)

设置提交间隔秒。

Performs the commit interval seconds operation.

参数Parameters
名称Name类型Type说明Description
secondslong秒(类型 `long`)。The seconds.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:260–263

repeatTime

public Builder repeatTime(int repeatTime)

设置该配置项。

Performs the repeat time operation.

参数Parameters
名称Name类型Type说明Description
repeatTimeintrepeat 时间(类型 `int`)。The repeat time.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:265–268

build

public TrainingRunner build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns TrainingRunner
返回TrainingRunner。Returns training runner.
源码Source io/agentscope/core/training/runner/TrainingRunner.java:281–290
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.