AS AgentScopeAPI 手册 / API Reference

ScheduleConfig

public class ScheduleConfig
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:58–293

用于已调度智能体任务的配置。位于 io.agentscope.extensions.scheduler.config 包。核心成员包括 builder、getScheduleMode、getCronExpression、getFixedRate、getFixedDelay、getInitialDelay。

Configuration for scheduled agent tasks.

This class defines the scheduling parameters for an agent, including the scheduling type (cron, fixed rate, or fixed delay) and associated timing settings.

Supported Scheduling Modes:

  • NONE - No automatic scheduling (default mode, manual execution only)

  • CRON - Schedule using a cron expression (e.g., "0 0 8 * * ?" for daily at 8 AM)

  • FIXED_RATE - Execute at a fixed rate (e.g., every 5 minutes, regardless of execution time)

  • FIXED_DELAY - Execute with a fixed delay between completion and next start

Usage Examples:

`// Cron-based scheduling
ScheduleConfig config1 = ScheduleConfig.builder()
.cron("0 0 8 * * ?")
.zoneId("Asia/Shanghai")
.build();

// Fixed rate scheduling (every 5 minutes)
ScheduleConfig config2 = ScheduleConfig.builder()
.fixedRate(5L)
.initialDelay(10L)
.build();

// Fixed delay scheduling (5 minutes after completion)
ScheduleConfig config3 = ScheduleConfig.builder()
.fixedDelay(5L)
.build();
`

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
Builder for creating ScheduleConfig instances.

方法摘要Method Summary

方法Method说明Description
public static Builder builder()
static
创建新的构建器实例。
Create a new builder instance.
public ScheduleMode getScheduleMode()
获取调度模式。
Get the schedule mode.
public String getCronExpression()
获取 `getCronExpression`。
Get the cron expression (only applicable for CRON type).
public Long getFixedRate()
获取 `getFixedRate`。
Get the fixed rate duration in milliseconds (only applicable for FIXED_RATE type).
public Long getFixedDelay()
获取 `getFixedDelay`。
Get the fixed delay duration in milliseconds (only applicable for FIXED_DELAY type).
public Long getInitialDelay()
获取 `getInitialDelay`。
Get the initial delay in milliseconds before the first execution.
public String getZoneId()
获取可用区标识。
Get the time zone ID for cron expression evaluation.

方法详情Method Detail

builder

public static Builder builder()
static

创建新的构建器实例。

Create a new builder instance.

返回Returns Builder
一种新的ScheduleConfig.构建器。A new ScheduleConfig.Builder
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:112–114

getScheduleMode

public ScheduleMode getScheduleMode()

获取调度模式。

Get the schedule mode.

返回Returns ScheduleMode
调度模式。The schedule mode
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:121–123

getCronExpression

public String getCronExpression()

获取 getCronExpression。

Get the cron expression (only applicable for CRON type).

返回Returns String
返回字符串结果。The cron expression, or null if not a CRON schedule
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:130–132

getFixedRate

public Long getFixedRate()

获取 getFixedRate。

Get the fixed rate duration in milliseconds (only applicable for FIXED_RATE type).

返回Returns Long
返回数值结果。The fixed rate duration in milliseconds, or null if not a FIXED_RATE schedule
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:139–141

getFixedDelay

public Long getFixedDelay()

获取 getFixedDelay。

Get the fixed delay duration in milliseconds (only applicable for FIXED_DELAY type).

返回Returns Long
返回数值结果。The fixed delay duration in milliseconds, or null if not a FIXED_DELAY schedule
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:148–150

getInitialDelay

public Long getInitialDelay()

获取 getInitialDelay。

Get the initial delay in milliseconds before the first execution.

返回Returns Long
返回数值结果。The initial delay in milliseconds, or null if no initial delay is configured
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:157–159

getZoneId

public String getZoneId()

获取可用区标识。

Get the time zone ID for cron expression evaluation.

返回Returns String
返回字符串结果。The time zone ID string (e.g., "Asia/Shanghai"), or null to use system default
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:168–170

嵌套类详情Nested Class Detail

Builder

public static class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.scheduler.config 包。核心成员包括 cron、fixedRate、fixedDelay、initialDelay、zoneId、build。

Builder for creating ScheduleConfig instances.

基于官方固定版本源码静态生成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.