AS AgentScopeAPI 手册 / API Reference

AguiUtil

public final class AguiUtil
源码Source io/agentscope/core/agui/AguiUtil.java:29–86

AGUI 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
agentAgent智能体(类型 `Agent`)。the agent to inspect, may be `null`
返回Returns boolean
返回布尔值,表示判断结果。`true` if the runtime type is a harness agent
源码Source io/agentscope/core/agui/AguiUtil.java:45–57

asReActAgent

public static ReActAgent asReActAgent(Agent agent)
static

设置as ReAct 智能体。

Unwraps a ReActAgent from agent when possible.

参数Parameters
名称Name类型Type说明Description
agentAgent智能体(类型 `Agent`)。the agent to unwrap, may be `null`
返回Returns ReActAgent
返回ReActAgent。the ReAct agent, or `null` when it cannot be resolved
源码Source io/agentscope/core/agui/AguiUtil.java:68–85
基于官方固定版本源码静态生成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.