WorkbenchStateRegistry
@Component public class WorkbenchStateRegistry
源码Source
io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:31–62Workbench 状态注册表,把智能体接入外部消息渠道与企业平台。位于 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 |
|---|---|---|
threadId | String | 会话线程标识(类型 `String`)。The thread id. |
WorkbenchState返回WorkbenchState。Returns workbench state.
源码Source
io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:38–41forContext
public WorkbenchState forContext(RuntimeContext ctx)
设置用于上下文。
Performs the for context operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ctx | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The ctx. |
WorkbenchState返回WorkbenchState。Returns workbench state.
源码Source
io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:43–45forState
public WorkbenchState forState(AgentState state)
设置用于状态。
Resolves the state for a tool call.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
state | AgentState | 状态对象(类型 `AgentState`)。The state. |
WorkbenchState返回WorkbenchState。Returns workbench state.
源码Source
io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:53–55remove
public void remove(String threadId)
设置移除。
Performs the remove operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
threadId | String | 会话线程标识(类型 `String`)。The thread id. |
源码Source
io/agentscope/examples/copilotkit/workbench/WorkbenchStateRegistry.java:57–61