Package io.agentscope.core.agui
Class AguiUtil
java.lang.Object
io.agentscope.core.agui.AguiUtil
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
Modifier and TypeMethodDescriptionstatic io.agentscope.core.ReActAgentasReActAgent(io.agentscope.core.agent.Agent agent) Unwraps aReActAgentfromagentwhen possible.static booleanisHarnessAgent(io.agentscope.core.agent.Agent agent) Returnstruewhenagentis aHarnessAgent(or a subclass).
-
Method Details
-
isHarnessAgent
public static boolean isHarnessAgent(io.agentscope.core.agent.Agent agent) Returnstruewhenagentis aHarnessAgent(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 benull- Returns:
trueif the runtime type is a harness agent
-
asReActAgent
public static io.agentscope.core.ReActAgent asReActAgent(io.agentscope.core.agent.Agent agent) Unwraps aReActAgentfromagentwhen 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 benull- Returns:
- the ReAct agent, or
nullwhen it cannot be resolved
-