File tree 1 file changed +1
-20
lines changed
core-jdk8/src/main/java/org/bsc/langgraph4j
1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change 11
11
import org .bsc .langgraph4j .serializer .MapSerializer ;
12
12
import org .bsc .langgraph4j .state .AgentState ;
13
13
import org .bsc .langgraph4j .state .StateSnapshot ;
14
+ import org .bsc .langgraph4j .utils .TryConsumer ;
14
15
15
16
import java .io .IOException ;
16
17
import java .util .*;
24
25
import static org .bsc .langgraph4j .StateGraph .END ;
25
26
import static org .bsc .langgraph4j .StateGraph .START ;
26
27
27
-
28
- @ FunctionalInterface
29
- interface TryConsumer <T , Ex extends Throwable > extends Consumer <T > {
30
-
31
- void tryAccept ( T t ) throws Ex ;
32
-
33
- default void accept ( T t ) {
34
- try {
35
- tryAccept (t );
36
- } catch (Throwable ex ) {
37
- throw new RuntimeException (ex );
38
- }
39
- }
40
-
41
- static <T ,Ex extends Throwable > Consumer <T > Try ( TryConsumer <T , Ex > consumer ) {
42
- return consumer ;
43
- }
44
- }
45
-
46
-
47
28
/**
48
29
* Represents a compiled graph of nodes and edges.
49
30
* This class manage the StateGraph execution
You can’t perform that action at this time.
0 commit comments