AS AgentScopeAPI 手册 / API Reference

AgentScopeContractController

@RestController @RequestMapping("/agentscope") public class AgentScopeContractController
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:54–471

AgentScope 契约控制器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.api 包。核心成员包括 info、health、sessions、compress、terminate、context。

aistio data-plane HTTP contract (/agentscope/*). Public so the control-plane poller can probe without a console JWT. Session rows come from the control plane; transcripts from the local event log.

构造器摘要Constructor Summary

构造器Constructor说明Description
public AgentScopeContractController(ControlPlaneClient controlPlaneClient, DataSessionService sessionService, SessionEventLog eventLog, SessionEventEntityRepository eventRepository, ManagedJsonHelper jsonHelper, int serverPort, String agentName, String version)
初始化 `AgentScopeContractController` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public Map<String, Object> info()
返回信息。
Level-1 metadata for discovery / registry aggregation.
public Map<String, String> health()
返回健康状态。
Level-1 health probe.
public Map<String, Object> sessions()
返回会话。
Level-2 session snapshots for the aistiod poller.
public Map<String, String> compress(String id)
设置压缩。
Level-3 compress command (best-effort; no harness compact API yet).
public Map<String, String> terminate(String id)
设置该参数。
Level-3 terminate command.
public Map<String, Object> context(String id)
设置上下文。
Level-4 effective context exported from the event log + agent snapshot.
public Map<String, Object> messages(String id, int offset, int limit)
执行消息相关操作。
Level-3 paginated full-history messages from the event log.

构造器详情Constructor Detail

AgentScopeContractController

public AgentScopeContractController(ControlPlaneClient controlPlaneClient, DataSessionService sessionService, SessionEventLog eventLog, SessionEventEntityRepository eventRepository, ManagedJsonHelper jsonHelper, int serverPort, String agentName, String version)

初始化 AgentScopeContractController 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
controlPlaneClientControlPlaneClient控制面客户端(类型 `ControlPlaneClient`)。The control plane client.
sessionServiceDataSessionService会话服务(类型 `DataSessionService`)。The session service.
eventLogSessionEventLog事件日志(类型 `SessionEventLog`)。The event log.
eventRepositorySessionEventEntityRepository事件仓库(类型 `SessionEventEntityRepository`)。The event repository.
jsonHelperManagedJsonHelperJSON Helper(类型 `ManagedJsonHelper`)。The json helper.
serverPortint服务端 Port(类型 `int`)。The server port.
agentNameString智能体名称(类型 `String`)。The agent name.
versionString版本(类型 `String`)。The version.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:93–110

方法详情Method Detail

info

public Map<String, Object> info()

返回信息。

Level-1 metadata for discovery / registry aggregation.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:113–123

health

public Map<String, String> health()

返回健康状态。

Level-1 health probe.

返回Returns Map<String, String>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:126–129

sessions

public Map<String, Object> sessions()

返回会话。

Level-2 session snapshots for the aistiod poller.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:132–152

compress

public Map<String, String> compress(String id)

设置压缩。

Level-3 compress command (best-effort; no harness compact API yet).

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
返回Returns Map<String, String>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:155–168

terminate

public Map<String, String> terminate(String id)

设置该参数。

Level-3 terminate command.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
返回Returns Map<String, String>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:171–178

context

public Map<String, Object> context(String id)

设置上下文。

Level-4 effective context exported from the event log + agent snapshot.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:181–210

messages

public Map<String, Object> messages(String id, int offset, int limit)

执行消息相关操作。

Level-3 paginated full-history messages from the event log.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
offsetint偏移量(类型 `int`)。The offset.
limitint数量上限(类型 `int`)。The limit.
返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/AgentScopeContractController.java:213–241
基于官方固定版本源码静态生成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.