Skip to content

Commit

Permalink
feat(SubGraphNode.java): introduce SubGraphNode interface
Browse files Browse the repository at this point in the history
Add a new interface `SubGraphNode` in package `org.bsc.langgraph4j`, which defines methods related to managing sub-graph nodes with specific states.
This interface includes a method for obtaining the sub-graph and a static utility method for formatting node IDs to distinct subgraph nodes from standard ones

work on #73
  • Loading branch information
bsorrentino committed Feb 11, 2025
1 parent ab83ffc commit 5ef408c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/src/main/java/org/bsc/langgraph4j/SubGraphNode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.bsc.langgraph4j;

import org.bsc.langgraph4j.state.AgentState;

import static java.lang.String.format;

interface SubGraphNode<State extends AgentState> {
String PREFIX_FORMAT = "(%s)%s";

StateGraph<State> subGraph();

static String formatId(String subGraphNodeId, String nodeId ) {
return format(PREFIX_FORMAT, subGraphNodeId, nodeId );
}

}

0 comments on commit 5ef408c

Please sign in to comment.