AS AgentScopeAPI 手册 / API Reference

AgentRuntimeSource

public interface AgentRuntimeSource
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:29–65

定义智能体运行时来源契约的接口。位于 io.agentscope.extensions.aistio.adapter 包。核心成员包括 listSubagents、listWorkspaces、listSubagentTasks、cancelSubagentTask、enrichAgentConfig、readPlanExcerpt。

Optional harness-/app-specific hooks kept out of agentscope-extensions-aistio so the extension stays free of an agentscope-harness dependency. Wire from the host app (e.g. paw) after the AgentScopeAdapter bean is created.

方法摘要Method Summary

方法Method说明Description
default public List<Inventory.SubagentInfo> listSubagents(Agent agent)
default
列出 `listSubagents`。
Lists the subagents.
default public List<Inventory.WorkspaceInfo> listWorkspaces(Agent agent)
default
列出 `listWorkspaces`。
Lists the workspaces.
default public List<Map<String, Object>> listSubagentTasks(Agent agent, String sessionId, String userId)
default
列出子智能体任务。
Lists the subagent tasks.
default public boolean cancelSubagentTask(Agent agent, String sessionId, String userId, String taskId)
default
执行取消子智能体任务相关操作。
Performs the cancel subagent task operation.
default public void enrichAgentConfig(Agent agent, Map<String, Object> agentConfig)
default
执行 `enrichAgentConfig` 方法。
Enrich the Definition snapshot (`GET /agentscope/info` → `agentConfig`).
default public Optional<String> readPlanExcerpt(Agent agent, String sessionId, String userId, String planFile)
default
执行 `readPlanExcerpt` 方法。
Optional plan-file excerpt for Context `frameworkState`.
default public boolean setPlanMode(Agent agent, String sessionId, String userId, boolean active)
default
设置计划模式。
Enter/exit plan mode for a session.

方法详情Method Detail

listSubagents

default public List<Inventory.SubagentInfo> listSubagents(Agent agent)
default

列出 listSubagents。

Lists the subagents.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
返回Returns List<Inventory.SubagentInfo>
返回列出。Returns list.
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:31–33

listWorkspaces

default public List<Inventory.WorkspaceInfo> listWorkspaces(Agent agent)
default

列出 listWorkspaces。

Lists the workspaces.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
返回Returns List<Inventory.WorkspaceInfo>
返回列出。Returns list.
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:35–37

listSubagentTasks

default public List<Map<String, Object>> listSubagentTasks(Agent agent, String sessionId, String userId)
default

列出子智能体任务。

Lists the subagent tasks.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
sessionIdString会话标识(类型 `String`)。The session id.
userIdString用户标识(类型 `String`)。The user id.
返回Returns List<Map<String, Object>>
返回列出>。Returns list.
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:39–42

cancelSubagentTask

default public boolean cancelSubagentTask(Agent agent, String sessionId, String userId, String taskId)
default

执行取消子智能体任务相关操作。

Performs the cancel subagent task operation.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
sessionIdString会话标识(类型 `String`)。The session id.
userIdString用户标识(类型 `String`)。The user id.
taskIdString任务标识(类型 `String`)。The task id.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:44–47

enrichAgentConfig

default public void enrichAgentConfig(Agent agent, Map<String, Object> agentConfig)
default

执行 enrichAgentConfig 方法。

Enrich the Definition snapshot (GET /agentscope/info → agentConfig).

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
agentConfigMap<String, Object>智能体配置(类型 `Map`)。The agent config.
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:50

readPlanExcerpt

default public Optional<String> readPlanExcerpt(Agent agent, String sessionId, String userId, String planFile)
default

执行 readPlanExcerpt 方法。

Optional plan-file excerpt for Context frameworkState.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
sessionIdString会话标识(类型 `String`)。The session id.
userIdString用户标识(类型 `String`)。The user id.
planFileString计划文件(类型 `String`)。The plan file.
返回Returns Optional<String>
返回可选。Returns optional.
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:53–56

setPlanMode

default public boolean setPlanMode(Agent agent, String sessionId, String userId, boolean active)
default

设置计划模式。

Enter/exit plan mode for a session.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。The agent.
sessionIdString会话标识(类型 `String`)。The session id.
userIdString用户标识(类型 `String`)。The user id.
activebooleanactive(类型 `boolean`)。The active.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/aistio/adapter/AgentRuntimeSource.java:62–64
基于官方固定版本源码静态生成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.