AS AgentScopeAPI 手册 / API Reference

RuntimeAgentConfig

public class RuntimeAgentConfig extends AgentConfig
源码Source io/agentscope/extensions/scheduler/config/RuntimeAgentConfig.java:75–253

运行时智能体配置,保存相关配置项。位于 io.agentscope.extensions.scheduler.config 包,继承自 AgentConfig。核心成员包括 builder、getToolkit、getHooks、getModel、equals、hashCode。

Runtime Agent configuration that extends AgentConfig with non-serializable runtime objects.

This subclass adds runtime objects like Toolkit and Hooks that cannot be serialized. Use this class when you need to configure agents with tools and lifecycle hooks in the same JVM process.

When to Use:

  • RuntimeAgentConfig - When scheduling in the same JVM with toolkit/hooks

  • AgentConfig - When persisting config or using distributed scheduling

Usage Example:

`// Create toolkit
Toolkit toolkit = new Toolkit();
toolkit.registerTool(new WeatherTool());

// Create hooks
List<Hook> hooks = Arrays.asList(
new LoggingHook(),
new MetricsHook()
);

// Create runtime configuration
RuntimeAgentConfig config = RuntimeAgentConfig.builder()
.name("MyAgent")
.modelConfig(modelConfig)
.sysPrompt("You are a helpful assistant.")
.toolkit(toolkit) // Runtime object
.hooks(hooks) // Runtime object
.build();

// Schedule with runtime configuration
ScheduleAgentTask task = scheduler.schedule(config, scheduleConfig);
`

Design Notes:

  • Extends AgentConfig to inherit serializable configuration

  • Adds toolkit and hooks as runtime-only properties

  • Not suitable for serialization or distributed scenarios

  • Immutable after construction

嵌套类摘要Nested Class Summary

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

方法摘要Method Summary

方法Method说明Description
public static Builder builder()
static
创建新的构建器实例。
Create a new builder instance.
public Toolkit getToolkit()
获取工具包。
Get the toolkit.
public List<Hook> getHooks()
获取 `getHooks`。
Get the hooks.
public Model getModel()
获取模型。
Get the pre-created Model instance.
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
public int hashCode()
返回 `hashCode` 结果。
Returns the hash code.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

builder

public static Builder builder()
static

创建新的构建器实例。

Create a new builder instance.

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

getToolkit

public Toolkit getToolkit()

获取工具包。

Get the toolkit.

返回Returns Toolkit
返回工具包。The toolkit instance, may be null
源码Source io/agentscope/extensions/scheduler/config/RuntimeAgentConfig.java:102–104

getHooks

public List<Hook> getHooks()

获取 getHooks。

Get the hooks.

返回Returns List<Hook>
返回列出。The list of hooks, never null but may be empty
源码Source io/agentscope/extensions/scheduler/config/RuntimeAgentConfig.java:111–113

getModel

public Model getModel()

获取模型。

Get the pre-created Model instance.

返回Returns Model
返回模型。The Model instance, may be null if not set
源码Source io/agentscope/extensions/scheduler/config/RuntimeAgentConfig.java:123–125

equals

public boolean equals(Object o)

设置该参数。

Performs the equals operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/scheduler/config/RuntimeAgentConfig.java:127–136

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/scheduler/config/RuntimeAgentConfig.java:138–141

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/scheduler/config/RuntimeAgentConfig.java:143–161

嵌套类详情Nested Class Detail

Builder

public static class Builder extends AgentConfig.Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.scheduler.config 包,继承自 AgentConfig.Builder。核心成员包括 name、modelConfig、sysPrompt、toolkit、hooks、build。

Builder for creating RuntimeAgentConfig instances.

继承成员Inherited Members

继承自Methods inherited from AgentConfig
基于官方固定版本源码静态生成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.