Package org.bsc.langgraph4j.action
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 extendAgentState
- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInterruptionMetadata.Builder<State extends AgentState>A builder for creating instances ofInterruptionMetadata. -
Method Summary
Modifier and TypeMethodDescriptionstatic <State extends AgentState>
InterruptionMetadata.Builder<State>Creates a new builder forInterruptionMetadata.Retrieves a metadata value associated with the specified key.return metadata keysnodeId()Gets the ID of the node where the interruption occurred.state()Gets the state of the graph at the time of the interruption.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bsc.langgraph4j.HasMetadata
metadata
-
Method Details
-
nodeId
Gets the ID of the node where the interruption occurred.- Returns:
- the node ID
-
state
Gets the state of the graph at the time of the interruption.- Returns:
- the agent state
-
metadata
Retrieves a metadata value associated with the specified key.- Specified by:
metadatain interfaceHasMetadata- Parameters:
key- the key whose associated value is to be returned- Returns:
- an
Optionalcontaining the value to which the specified key is mapped, or an emptyOptionalif this metadata contains no mapping for the key.
-
metadataKeys
Description copied from interface:HasMetadatareturn metadata keys- Specified by:
metadataKeysin interfaceHasMetadata- Returns:
- metadata keys if any or empty set
-
toString
-
builder
public static <State extends AgentState> InterruptionMetadata.Builder<State> builder(String nodeId, State state) Creates a new builder forInterruptionMetadata.- Type Parameters:
State- the type of the agent state- Returns:
- a new
InterruptionMetadata.Builderinstance
-