Package org.bsc.langgraph4j.action
Record Class SubCompiledGraphNodeAction<State extends AgentState>
java.lang.Object
java.lang.Record
org.bsc.langgraph4j.action.SubCompiledGraphNodeAction<State>
- Type Parameters:
State- The type of state the subgraph operates on, which must extendAgentState.- Record Components:
subGraph- sub graph instance
- All Implemented Interfaces:
BiFunction<State,,RunnableConfig, CompletableFuture<Map<String, Object>>> AsyncNodeActionWithConfig<State>
public record SubCompiledGraphNodeAction<State extends AgentState>(String nodeId, CompileConfig parentCompileConfig, CompiledGraph<State extends AgentState> subGraph)
extends Record
implements AsyncNodeActionWithConfig<State>
Represents an action to perform a subgraph on a given state with a specific configuration.
This record encapsulates the behavior required to execute a compiled graph using a provided state.
It implements the AsyncNodeActionWithConfig interface, ensuring that the execution is handled asynchronously with the ability to configure settings.
- See Also:
-
Field Summary
Fields inherited from interface org.bsc.langgraph4j.action.AsyncNodeActionWithConfig
NOOP -
Constructor Summary
ConstructorsConstructorDescriptionSubCompiledGraphNodeAction(String nodeId, CompileConfig parentCompileConfig, CompiledGraph<State> subGraph) Creates an instance of aSubCompiledGraphNodeActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapply(State state, RunnableConfig config) Executes the given graph with the provided state and configuration.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.nodeId()Returns the value of thenodeIdrecord component.Returns the value of theparentCompileConfigrecord component.static StringresumeSubGraphId(String nodeId) subGraph()Returns the value of thesubGraphrecord component.static StringsubGraphId(String nodeId) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
SubCompiledGraphNodeAction
public SubCompiledGraphNodeAction(String nodeId, CompileConfig parentCompileConfig, CompiledGraph<State> subGraph) Creates an instance of aSubCompiledGraphNodeActionrecord class.- Parameters:
nodeId- the value for thenodeIdrecord componentparentCompileConfig- the value for theparentCompileConfigrecord componentsubGraph- the value for thesubGraphrecord component
-
-
Method Details
-
subGraphId
-
resumeSubGraphId
-
subGraphId
-
resumeSubGraphId
-
apply
Executes the given graph with the provided state and configuration.- Specified by:
applyin interfaceAsyncNodeActionWithConfig<State extends AgentState>- Specified by:
applyin interfaceBiFunction<State extends AgentState,RunnableConfig, CompletableFuture<Map<String, Object>>> - Parameters:
state- The current state of the system, containing input data and intermediate results.config- The configuration for the graph execution.- Returns:
- A
CompletableFuturethat will complete with a result of typeMap<String, Object>. If an exception occurs during execution, the future will be completed exceptionally.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
nodeId
Returns the value of thenodeIdrecord component.- Returns:
- the value of the
nodeIdrecord component
-
parentCompileConfig
Returns the value of theparentCompileConfigrecord component.- Returns:
- the value of the
parentCompileConfigrecord component
-
subGraph
Returns the value of thesubGraphrecord component.- Returns:
- the value of the
subGraphrecord component
-