Class AguiUtil

java.lang.Object
io.agentscope.core.agui.AguiUtil

public final class AguiUtil extends Object
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 Details

    • isHarnessAgent

      public static boolean isHarnessAgent(io.agentscope.core.agent.Agent agent)
      Returns true when agent is a HarnessAgent (or a subclass).

      Class-name matching is used so the AG-UI module can stream harness agents without depending on the harness artifact.

      Parameters:
      agent - the agent to inspect, may be null
      Returns:
      true if the runtime type is a harness agent
    • asReActAgent

      public static io.agentscope.core.ReActAgent asReActAgent(io.agentscope.core.agent.Agent agent)
      Unwraps a ReActAgent from agent when possible.

      Harness agents expose the inner ReAct delegate via a public getDelegate() method. The returned instance is the live agent used by the session; callers must not close it.

      Parameters:
      agent - the agent to unwrap, may be null
      Returns:
      the ReAct agent, or null when it cannot be resolved