File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
experimental/fluent/agentic/src/main/java/io/serverlessworkflow/fluent/agentic/dsl Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,10 @@ public static AgentTaskConfigurer sequence(Object... agents) {
113
113
return list -> list .sequence (agents );
114
114
}
115
115
116
+ public static AgentTaskConfigurer sequence (Predicate <?> predicate , Object ... agents ) {
117
+ return list -> list .sequence (agents ).when (predicate );
118
+ }
119
+
116
120
public static AgentTaskConfigurer loop (Predicate <AgenticScope > exitCondition , Object ... agents ) {
117
121
return list -> list .loop (l -> l .subAgents (agents ).exitCondition (exitCondition ));
118
122
}
@@ -121,6 +125,10 @@ public static AgentTaskConfigurer parallel(Object... agents) {
121
125
return list -> list .parallel (agents );
122
126
}
123
127
128
+ public static AgentTaskConfigurer parallel (Predicate <?> predicate , Object ... agents ) {
129
+ return list -> list .parallel (agents ).when (predicate );
130
+ }
131
+
124
132
// --------- Tasks ------ //
125
133
public static Consumer <AgentDoTaskBuilder > doTasks (AgentTaskConfigurer ... steps ) {
126
134
Objects .requireNonNull (steps , "Steps in a tasks are required" );
@@ -140,6 +148,10 @@ public static AgentTaskConfigurer agent(Object agent) {
140
148
return list -> list .agent (agent );
141
149
}
142
150
151
+ public static AgentTaskConfigurer conditional (Predicate <?> predicate , Object agent ) {
152
+ return list -> list .agent (agent ).when (predicate );
153
+ }
154
+
143
155
public static AgentTaskConfigurer emit (Consumer <FuncEmitTaskBuilder > event ) {
144
156
return list -> list .emit (event );
145
157
}
You can’t perform that action at this time.
0 commit comments