AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/model/ExecutionConfig.java:294–387

ExecutionConfig的构建器。位于 io.agentscope.core.model 包。核心成员包括 timeout、maxAttempts、initialBackoff、maxBackoff、backoffMultiplier、retryOn。

Builder for ExecutionConfig.

方法摘要Method Summary

方法Method说明Description
public Builder timeout(Duration timeout)
设置超时。
Sets the timeout duration for a single execution.
public Builder maxAttempts(Integer maxAttempts)
设置最大尝试次数。
Sets the maximum number of attempts (including the initial attempt).
public Builder initialBackoff(Duration initialBackoff)
设置该配置项。
Sets the initial backoff duration for the first retry.
public Builder maxBackoff(Duration maxBackoff)
设置最大退避。
Sets the maximum backoff duration between retries.
public Builder backoffMultiplier(Double backoffMultiplier)
设置该配置项。
Sets the backoff multiplier applied after each retry.
public Builder retryOn(Predicate<Throwable> retryOn)
设置重试 On。
Sets the predicate to determine if an error should trigger a retry.
public ExecutionConfig build()
构建新的ExecutionConfig 实例。
Builds a new ExecutionConfig instance.

方法详情Method Detail

timeout

public Builder timeout(Duration timeout)

设置超时。

Sets the timeout duration for a single execution.

参数Parameters
名称Name类型Type说明Description
timeoutDuration超时时间(类型 `Duration`)。the timeout duration, or null for no timeout
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ExecutionConfig.java:308–311

maxAttempts

public Builder maxAttempts(Integer maxAttempts)

设置最大尝试次数。

Sets the maximum number of attempts (including the initial attempt).

参数Parameters
名称Name类型Type说明Description
maxAttemptsInteger最大尝试次数(类型 `Integer`)。the max attempts (must be >= 1), or null
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ExecutionConfig.java:321–327

initialBackoff

public Builder initialBackoff(Duration initialBackoff)

设置该配置项。

Sets the initial backoff duration for the first retry.

参数Parameters
名称Name类型Type说明Description
initialBackoffDurationinitial 退避(类型 `Duration`)。the initial backoff duration, or null
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ExecutionConfig.java:335–338

maxBackoff

public Builder maxBackoff(Duration maxBackoff)

设置最大退避。

Sets the maximum backoff duration between retries.

参数Parameters
名称Name类型Type说明Description
maxBackoffDuration最大退避(类型 `Duration`)。the max backoff duration, or null
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ExecutionConfig.java:346–349

backoffMultiplier

public Builder backoffMultiplier(Double backoffMultiplier)

设置该配置项。

Sets the backoff multiplier applied after each retry.

参数Parameters
名称Name类型Type说明Description
backoffMultiplierDouble退避 Multiplier(类型 `Double`)。the backoff multiplier (must be >= 1.0), or null
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ExecutionConfig.java:360–366

retryOn

public Builder retryOn(Predicate<Throwable> retryOn)

设置重试 On。

Sets the predicate to determine if an error should trigger a retry.

参数Parameters
名称Name类型Type说明Description
retryOnPredicate<Throwable>重试 On(类型 `Predicate`)。the retry predicate (returns true to retry), or null
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/model/ExecutionConfig.java:374–377

build

public ExecutionConfig build()

构建新的ExecutionConfig 实例。

Builds a new ExecutionConfig instance.

返回Returns ExecutionConfig
一种新的ExecutionConfig 实例。a new ExecutionConfig instance
源码Source io/agentscope/core/model/ExecutionConfig.java:384–386
基于官方固定版本源码静态生成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.