AS AgentScopeAPI 手册 / API Reference

WorkbenchStateRegistry

@Component public class WorkbenchStateRegistry
源码Source io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:31–62

Workbench 状态注册表,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.examples.copilotkit.workbench 包。核心成员包括 forThread、forContext、forState、remove。

Keeps one WorkbenchState per AG-UI thread.

The AG-UI adapter sets RuntimeContext.sessionId to the thread id, so tools and middlewares can resolve the right state without any extra plumbing.

方法摘要Method Summary

方法Method说明Description
public WorkbenchState forThread(String threadId)
设置用于会话线程。
Performs the for thread operation.
public WorkbenchState forContext(RuntimeContext ctx)
设置用于上下文。
Performs the for context operation.
public WorkbenchState forState(AgentState state)
设置用于状态。
Resolves the state for a tool call.
public void remove(String threadId)
设置移除。
Performs the remove operation.

方法详情Method Detail

forThread

public WorkbenchState forThread(String threadId)

设置用于会话线程。

Performs the for thread operation.

参数Parameters
名称Name类型Type说明Description
threadIdString会话线程标识(类型 `String`)。The thread id.
返回Returns WorkbenchState
返回WorkbenchState。Returns workbench state.
源码Source io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:38–41

forContext

public WorkbenchState forContext(RuntimeContext ctx)

设置用于上下文。

Performs the for context operation.

参数Parameters
名称Name类型Type说明Description
ctxRuntimeContext运行时上下文(类型 `RuntimeContext`)。The ctx.
返回Returns WorkbenchState
返回WorkbenchState。Returns workbench state.
源码Source io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:43–45

forState

public WorkbenchState forState(AgentState state)

设置用于状态。

Resolves the state for a tool call.

参数Parameters
名称Name类型Type说明Description
stateAgentState状态对象(类型 `AgentState`)。The state.
返回Returns WorkbenchState
返回WorkbenchState。Returns workbench state.
源码Source io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:53–55

remove

public void remove(String threadId)

设置移除。

Performs the remove operation.

参数Parameters
名称Name类型Type说明Description
threadIdString会话线程标识(类型 `String`)。The thread id.
源码Source io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:57–61
基于官方固定版本源码静态生成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.