Package org.bsc.langgraph4j.agui.sdk
Class AGUINodeOutput<State extends AgentState>
java.lang.Object
org.bsc.langgraph4j.NodeOutput<State>
org.bsc.langgraph4j.agui.sdk.AGUINodeOutput<State>
- Type Parameters:
State- the type of the agent state carried by this output
- All Implemented Interfaces:
HasMetadata
Custom LangGraph4j
NodeOutput implementation that acts as a bridge between the
LangGraph4j output streaming and the AG-UI event model.
Besides the standard node/state information carried by NodeOutput, an
AGUINodeOutput also carries a list of AG-UI Events that a node execution
wants to emit (e.g. text message events, step lifecycle events). Consumers of the graph's
streaming output (see AGUIAgentBase.onNextEvents(com.agui.community.core.agent.RunAgentInput, NodeOutput))
can recognize instances of this class and forward its events() directly to the
AG-UI subscriber.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forAGUINodeOutputinstances, used to accumulate the AG-UIEvents to be carried by the resulting output before binding them to a node id and state viaAGUINodeOutput.Builder.build(String, AgentState). -
Field Summary
Fields inherited from class org.bsc.langgraph4j.NodeOutput
metadataSupplier -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAGUINodeOutput(String node, State state, List<com.agui.community.core.event.Event> events) Creates a new node output carrying the given AG-UI events. -
Method Summary
Modifier and TypeMethodDescriptionstatic <State extends AgentState>
AGUINodeOutput.Builderbuilder()Creates a newAGUINodeOutput.Builderto accumulate AG-UI events before building anAGUINodeOutput.List<com.agui.community.core.event.Event> events()Returns the AG-UI events carried by this node output.Methods inherited from class org.bsc.langgraph4j.NodeOutput
isEND, isSTART, metadata, metadataKeys, node, of, state, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bsc.langgraph4j.HasMetadata
metadata
-
Constructor Details
-
AGUINodeOutput
protected AGUINodeOutput(String node, State state, List<com.agui.community.core.event.Event> events) Creates a new node output carrying the given AG-UI events.- Parameters:
node- the identifier of the node that produced this outputstate- the agent state associated with this outputevents- the AG-UI events to carry; must not benull
-
-
Method Details
-
builder
Creates a newAGUINodeOutput.Builderto accumulate AG-UI events before building anAGUINodeOutput.- Type Parameters:
State- the type of the agent state- Returns:
- a new builder instance
-
events
Returns the AG-UI events carried by this node output.- Returns:
- the list of AG-UI events
-