AguiUtil
public final class AguiUtil
源码Source
io/agentscope/core/agui/AguiUtil.java:29–86AGUI Util,在智能体、模型与前端之间传递结构化消息和事件。位于 io.agentscope.core.agui 包。核心成员包括 isHarnessAgent、asReActAgent。
Helpers for inspecting AG-UI agent instances without taking a compile-time dependency on
agentscope-harness.
ReActAgent is AutoCloseable. Values returned by #asReActAgent(Agent)
are live session agents and must not be closed by the caller.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static boolean isHarnessAgent(Agent agent)static | 判断是否 `isHarnessAgent`。 Returns `true` when `agent` is a `HarnessAgent` (or a subclass). |
public static ReActAgent asReActAgent(Agent agent)static | 设置as ReAct 智能体。 Unwraps a `ReActAgent` from `agent` when possible. |
方法详情Method Detail
isHarnessAgent
public static boolean isHarnessAgent(Agent agent)
static
判断是否 isHarnessAgent。
Returns true when agent is a HarnessAgent (or a subclass).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体(类型 `Agent`)。the agent to inspect, may be `null` |
boolean返回布尔值,表示判断结果。`true` if the runtime type is a harness agent
源码Source
io/agentscope/core/agui/AguiUtil.java:45–57asReActAgent
public static ReActAgent asReActAgent(Agent agent)
static
设置as ReAct 智能体。
Unwraps a ReActAgent from agent when possible.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体(类型 `Agent`)。the agent to unwrap, may be `null` |
ReActAgent返回ReActAgent。the ReAct agent, or `null` when it cannot be resolved
源码Source
io/agentscope/core/agui/AguiUtil.java:68–85