AS AgentScopeAPI 手册 / API Reference

AgentCloner

public class AgentCloner
源码Source io/agentscope/core/training/runner/AgentCloner.java:41–135

智能体 Cloner,对智能体行为进行评测、追踪与可观测性分析。位于 io.agentscope.core.training.runner 包。核心成员包括 cloneWithModel。

Agent Cloning Utility Class

Uses reflection to extract Agent configuration, then rebuilds new Agent instance with Builder

Design philosophy:

  • No shared state (create new memory)

  • Only replace model field

  • Keep all other configurations identical

方法摘要Method Summary

方法Method说明Description
public static Agent cloneWithModel(Agent original, Model newModel)
static
执行 `cloneWithModel` 方法。
Clone Agent and replace model

方法详情Method Detail

cloneWithModel

public static Agent cloneWithModel(Agent original, Model newModel)
static

执行 cloneWithModel 方法。

Clone Agent and replace model

参数Parameters
名称Name类型Type说明Description
originalAgentoriginal(类型 `Agent`)。Original Agent
newModelModel新建模型(类型 `Model`)。New model (e.g. TrinityModelWrapper)
返回Returns Agent
返回智能体。Cloned Agent instance
源码Source io/agentscope/core/training/runner/AgentCloner.java:51–61
基于官方固定版本源码静态生成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.