AS AgentScopeAPI 手册 / API Reference

SelfHostedWorkerController

@RestController @RequestMapping("/api/environments/{id}/sessions/{sessionId}") public class SelfHostedWorkerController
源码Source io/agentscope/builder/web/api/SelfHostedWorkerController.java:47–147

自身托管工作进程控制器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.api 包。核心成员包括 pendingTools、toolResults、skills、SelfHostedWorkerController。

Outbound-worker data plane for self_hosted: pending tool_use listing, tool_result resume, and skills download. Authenticated via X-Builder-Environment-Key.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
ToolResultsRequest记录record
承载工具结果请求数据的记录类型。
Request body for posting tool results.

构造器摘要Constructor Summary

构造器Constructor说明Description
public SelfHostedWorkerController(DataSessionService sessionService, PendingHandsToolService pendingHandsToolService, SkillsBundleService skillsBundleService, SessionTurnRunner turnRunner, SessionEventLog eventLog)
初始化 `SelfHostedWorkerController` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public Mono<List<Map<String, Object>>> pendingTools(String environmentId, String sessionId, Authentication auth)
执行待处理工具相关操作。
Lists pending `agent.tool_use` events awaiting worker results.
public Mono<List<SessionEventDto>> toolResults(String environmentId, String sessionId, ToolResultsRequest body, Authentication auth)
执行工具结果相关操作。
Posts one or more tool results and resumes the suspended turn.
public Mono<Map<String, Object>> skills(String environmentId, String sessionId, Authentication auth)
执行技能相关操作。
Downloads the session agent's skills bundle for local staging on the worker.

构造器详情Constructor Detail

SelfHostedWorkerController

public SelfHostedWorkerController(DataSessionService sessionService, PendingHandsToolService pendingHandsToolService, SkillsBundleService skillsBundleService, SessionTurnRunner turnRunner, SessionEventLog eventLog)

初始化 SelfHostedWorkerController 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
sessionServiceDataSessionService会话服务(类型 `DataSessionService`)。The session service.
pendingHandsToolServicePendingHandsToolService待处理 Hands 工具服务(类型 `PendingHandsToolService`)。The pending hands tool service.
skillsBundleServiceSkillsBundleService技能 Bundle 服务(类型 `SkillsBundleService`)。The skills bundle service.
turnRunnerSessionTurnRunner轮次运行器(类型 `SessionTurnRunner`)。The turn runner.
eventLogSessionEventLog事件日志(类型 `SessionEventLog`)。The event log.
源码Source io/agentscope/builder/web/api/SelfHostedWorkerController.java:57–68

方法详情Method Detail

pendingTools

public Mono<List<Map<String, Object>>> pendingTools(String environmentId, String sessionId, Authentication auth)

执行待处理工具相关操作。

Lists pending agent.tool_use events awaiting worker results.

参数Parameters
名称Name类型Type说明Description
environmentIdString环境标识(类型 `String`)。The environment id.
sessionIdString会话标识(类型 `String`)。The session id.
authAuthentication认证(类型 `Authentication`)。The auth.
返回Returns Mono<List<Map<String, Object>>>
返回Mono>>。Returns mono.
源码Source io/agentscope/builder/web/api/SelfHostedWorkerController.java:71–81

toolResults

public Mono<List<SessionEventDto>> toolResults(String environmentId, String sessionId, ToolResultsRequest body, Authentication auth)

执行工具结果相关操作。

Posts one or more tool results and resumes the suspended turn.

参数Parameters
名称Name类型Type说明Description
environmentIdString环境标识(类型 `String`)。The environment id.
sessionIdString会话标识(类型 `String`)。The session id.
bodyToolResultsRequest正文(类型 `ToolResultsRequest`)。The body.
authAuthentication认证(类型 `Authentication`)。The auth.
返回Returns Mono<List<SessionEventDto>>
返回Mono>。Returns mono.
源码Source io/agentscope/builder/web/api/SelfHostedWorkerController.java:84–112

skills

public Mono<Map<String, Object>> skills(String environmentId, String sessionId, Authentication auth)

执行技能相关操作。

Downloads the session agent's skills bundle for local staging on the worker.

参数Parameters
名称Name类型Type说明Description
environmentIdString环境标识(类型 `String`)。The environment id.
sessionIdString会话标识(类型 `String`)。The session id.
authAuthentication认证(类型 `Authentication`)。The auth.
返回Returns Mono<Map<String, Object>>
返回Mono>。Returns mono.
源码Source io/agentscope/builder/web/api/SelfHostedWorkerController.java:115–125

嵌套类详情Nested Class Detail

ToolResultsRequest

public record ToolResultsRequest(List<Map<String, Object>> results)

承载工具结果请求数据的记录类型。位于 io.agentscope.builder.web.api 包。核心成员包括 results。

Request body for posting tool results.

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