Class InterruptionMetadata<State extends AgentState>

java.lang.Object
org.bsc.langgraph4j.action.InterruptionMetadata<State>
Type Parameters:
State - the type of the agent state, which must extend AgentState
All Implemented Interfaces:
HasMetadata

public final class InterruptionMetadata<State extends AgentState> extends Object implements HasMetadata
Represents the metadata associated with a graph execution interruption. This class is immutable and captures the state of the graph at the point of interruption, the node where the interruption occurred, and any additional custom metadata.
  • Method Details

    • nodeId

      public String nodeId()
      Gets the ID of the node where the interruption occurred.
      Returns:
      the node ID
    • state

      public State state()
      Gets the state of the graph at the time of the interruption.
      Returns:
      the agent state
    • metadata

      public Optional<Object> metadata(String key)
      Retrieves a metadata value associated with the specified key.
      Specified by:
      metadata in interface HasMetadata
      Parameters:
      key - the key whose associated value is to be returned
      Returns:
      an Optional containing the value to which the specified key is mapped, or an empty Optional if this metadata contains no mapping for the key.
    • 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
    • toString

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

      public static <State extends AgentState> InterruptionMetadata.Builder<State> builder(String nodeId, State state)
      Creates a new builder for InterruptionMetadata.
      Type Parameters:
      State - the type of the agent state
      Returns:
      a new InterruptionMetadata.Builder instance