AgentVersionService
@Service @Transactional public class AgentVersionService
io/agentscope/builder/web/managed/service/AgentVersionService.java:37–255智能体版本服务,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed.service 包。核心成员包括 snapshotFromStoredEntry、snapshotFromEntity、toJson、fromJson、createInitialVersion、appendVersion。
Manages immutable version snapshots for user-custom agents.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
GLOBAL_OWNERstaticfinal | String | GLOBAL 所有者字段。 Synthetic owner id used to key version rows for global (project-level) agents, which have
no `ownerId` of their own. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentVersionService(AgentVersionEntityRepository versionRepository, AgentEntityRepository agentRepository) | 初始化 `AgentVersionService` 实例。 Creates a new instance. |
方法摘要Method Summary
字段详情Field Detail
GLOBAL_OWNER
public static final String GLOBAL_OWNER
GLOBAL 所有者字段。声明为 public static final String GLOBAL_OWNER。
Synthetic owner id used to key version rows for global (project-level) agents, which have no ownerId of their own.
io/agentscope/builder/web/managed/service/AgentVersionService.java:46构造器详情Constructor Detail
AgentVersionService
public AgentVersionService(AgentVersionEntityRepository versionRepository, AgentEntityRepository agentRepository)
初始化 AgentVersionService 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
versionRepository | AgentVersionEntityRepository | 版本仓库(类型 `AgentVersionEntityRepository`)。The version repository. |
agentRepository | AgentEntityRepository | 智能体仓库(类型 `AgentEntityRepository`)。The agent repository. |
io/agentscope/builder/web/managed/service/AgentVersionService.java:56–60方法详情Method Detail
snapshotFromStoredEntry
public AgentVersionSnapshot snapshotFromStoredEntry(UserAgentDefinitionStore.StoredEntry entry)
构建快照来自已存储目录条目。
Builds a snapshot from a stored catalog entry.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
entry | UserAgentDefinitionStore.StoredEntry | 条目(类型 `UserAgentDefinitionStore.StoredEntry`)。The entry. |
AgentVersionSnapshotio/agentscope/builder/web/managed/service/AgentVersionService.java:63–82snapshotFromEntity
public AgentVersionSnapshot snapshotFromEntity(AgentEntity entity)
设置该参数。
Builds a snapshot from a persisted agent entity.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
entity | AgentEntity | entity(类型 `AgentEntity`)。The entity. |
AgentVersionSnapshotio/agentscope/builder/web/managed/service/AgentVersionService.java:86–104toJson
public String toJson(AgentVersionSnapshot snapshot)
设置到 JSON。
Serializes a snapshot to JSON.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshot | AgentVersionSnapshot | 快照(类型 `AgentVersionSnapshot`)。The snapshot. |
Stringio/agentscope/builder/web/managed/service/AgentVersionService.java:107–114fromJson
public AgentVersionSnapshot fromJson(String json)
设置来自 JSON。
Deserializes a snapshot from JSON.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
json | String | JSON(类型 `String`)。The json. |
AgentVersionSnapshotio/agentscope/builder/web/managed/service/AgentVersionService.java:117–123createInitialVersion
public int createInitialVersion(String ownerId, String agentId, AgentVersionSnapshot snapshot)
创建 createInitialVersion。
Creates version 1 for a newly created agent and bumps the head pointer.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
snapshot | AgentVersionSnapshot | 快照(类型 `AgentVersionSnapshot`)。The snapshot. |
intio/agentscope/builder/web/managed/service/AgentVersionService.java:126–146appendVersion
public int appendVersion(String ownerId, String agentId, AgentVersionSnapshot snapshot)
追加版本。
Appends a new version when the snapshot changed.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
snapshot | AgentVersionSnapshot | 快照(类型 `AgentVersionSnapshot`)。The snapshot. |
intio/agentscope/builder/web/managed/service/AgentVersionService.java:152–180ensureGlobalVersion
public int ensureGlobalVersion(String agentId, AgentVersionSnapshot snapshot)
执行 ensureGlobalVersion 方法。
Ensures a global agent has a version row.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentId | String | 智能体标识(类型 `String`)。The agent id. |
snapshot | AgentVersionSnapshot | 快照(类型 `AgentVersionSnapshot`)。The snapshot. |
intio/agentscope/builder/web/managed/service/AgentVersionService.java:187–214listVersions
public List<AgentVersionEntity> listVersions(String ownerId, String agentId)
列出 listVersions。
Lists all versions for an agent in ascending order.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
List<AgentVersionEntity>io/agentscope/builder/web/managed/service/AgentVersionService.java:217–220getVersion
public AgentVersionEntity getVersion(String ownerId, String agentId, int version)
获取版本。
Returns a specific version snapshot row.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
version | int | 版本(类型 `int`)。The version. |
AgentVersionEntityio/agentscope/builder/web/managed/service/AgentVersionService.java:223–232