@@ -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" );
@@ -144,14 +152,6 @@ public static AgentTaskConfigurer conditional(Predicate<?> predicate, Object age
144
152
return list -> list .agent (agent ).when (predicate );
145
153
}
146
154
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
155
public static AgentTaskConfigurer emit (Consumer <FuncEmitTaskBuilder > event ) {
156
156
return list -> list .emit (event );
157
157
}
0 commit comments