@@ -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,11 @@ 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
+
132
+
124
133
// --------- Tasks ------ //
125
134
public static Consumer <AgentDoTaskBuilder > doTasks (AgentTaskConfigurer ... steps ) {
126
135
Objects .requireNonNull (steps , "Steps in a tasks are required" );
@@ -144,14 +153,6 @@ public static AgentTaskConfigurer conditional(Predicate<?> predicate, Object age
144
153
return list -> list .agent (agent ).when (predicate );
145
154
}
146
155
147
- public static AgentTaskConfigurer conditionalSequence (Predicate <?> predicate , Object ... agents ) {
148
- return list -> list .sequence (agents ).when (predicate );
149
- }
150
-
151
- public static AgentTaskConfigurer conditionalParallel (Predicate <?> predicate , Object ... agents ) {
152
- return list -> list .parallel (agents ).when (predicate );
153
- }
154
-
155
156
public static AgentTaskConfigurer emit (Consumer <FuncEmitTaskBuilder > event ) {
156
157
return list -> list .emit (event );
157
158
}
0 commit comments