Class NodeOutput<State extends AgentState>

java.lang.Object
org.bsc.langgraph4j.NodeOutput<State>
Type Parameters:
State - the type of the state associated with the node output
All Implemented Interfaces:
HasMetadata
Direct Known Subclasses:
StateSnapshot, StreamingOutput, SubGraphOutput

public class NodeOutput<State extends AgentState> extends Object implements HasMetadata
Represents the output of a node in a graph.
  • Field Details

    • metadataSupplier

      protected final transient HasMetadata metadataSupplier
  • Constructor Details

  • Method Details

    • of

      public static <State extends AgentState> NodeOutput<State> of(String node, State state)
    • node

      public String node()
      Returns the node name.
      Returns:
      the node name
    • state

      public State state()
    • isSTART

      public boolean isSTART()
      Checks if the current node refers to the start of the graph processing.
      Returns:
      true if the current node refers to the start of the graph processing
    • isEND

      public boolean isEND()
      Checks if the current node refers to the end of the graph processing. useful to understand if the workflow has been interrupted.
      Returns:
      true if the current node refers to the end of the graph processing
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • metadata

      public Optional<Object> metadata(String key)
      Description copied from interface: HasMetadata
      return metadata value for key
      Specified by:
      metadata in interface HasMetadata
      Parameters:
      key - given metadata key
      Returns:
      metadata value for key if any
    • metadataKeys

      public Set<String> metadataKeys()
      Description copied from interface: HasMetadata
      return metadata keys
      Specified by:
      metadataKeys in interface HasMetadata
      Returns:
      metadata keys if any or empty set