AgentResolver
public final class AgentResolver
源码Source
io/agentscope/spring/boot/admin/registry/AgentResolver.java:31–50智能体解析器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.spring.boot.admin.registry 包。核心成员包括 unwrapReActAgent。
Small unwrap helper that hides the HarnessAgent composition from admin call sites.
HarnessAgent wraps a ReActAgent delegate via composition, so agent
instanceof ReActAgent returns false for harness-built agents. Every read-only accessor
the admin surface needs (model, AgentState, maxIters, permission engine, session, sessionKey,
middlewares) is either defined on the delegate or forwarded by HarnessAgent to the
delegate, so unwrapping once at the boundary is the simplest correct treatment.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static ReActAgent unwrapReActAgent(Agent agent)static | 设置该参数。 Returns the underlying `ReActAgent` for both bare `ReActAgent` instances and for
`HarnessAgent`-wrapped agents (via `HarnessAgent#getDelegate()`). |
方法详情Method Detail
unwrapReActAgent
public static ReActAgent unwrapReActAgent(Agent agent)
static
设置该参数。
Returns the underlying ReActAgent for both bare ReActAgent instances and for HarnessAgent-wrapped agents (via HarnessAgent#getDelegate()).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体(类型 `Agent`)。The agent. |
ReActAgent返回ReActAgent。Returns ReAct agent.
源码Source
io/agentscope/spring/boot/admin/registry/AgentResolver.java:41–49