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
方法摘要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 |
|---|---|---|
sessionService | DataSessionService | 会话服务(类型 `DataSessionService`)。The session service. |
pendingHandsToolService | PendingHandsToolService | 待处理 Hands 工具服务(类型 `PendingHandsToolService`)。The pending hands tool service. |
skillsBundleService | SkillsBundleService | 技能 Bundle 服务(类型 `SkillsBundleService`)。The skills bundle service. |
turnRunner | SessionTurnRunner | 轮次运行器(类型 `SessionTurnRunner`)。The turn runner. |
eventLog | SessionEventLog | 事件日志(类型 `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 |
|---|---|---|
environmentId | String | 环境标识(类型 `String`)。The environment id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
auth | Authentication | 认证(类型 `Authentication`)。The auth. |
Mono<List<Map<String, Object>>>返回Mono>>。Returns mono.
源码Source
io/agentscope/builder/web/api/SelfHostedWorkerController.java:71–81toolResults
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 |
|---|---|---|
environmentId | String | 环境标识(类型 `String`)。The environment id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
body | ToolResultsRequest | 正文(类型 `ToolResultsRequest`)。The body. |
auth | Authentication | 认证(类型 `Authentication`)。The auth. |
Mono<List<SessionEventDto>>返回Mono>。Returns mono.
源码Source
io/agentscope/builder/web/api/SelfHostedWorkerController.java:84–112skills
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 |
|---|---|---|
environmentId | String | 环境标识(类型 `String`)。The environment id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
auth | Authentication | 认证(类型 `Authentication`)。The auth. |
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.