File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
experimental/fluent/agentic/src/main/java/io/serverlessworkflow/fluent/agentic Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ public class LoopAgentsBuilder {
3131 private final FuncTaskItemListBuilder funcDelegate ;
3232 private final ForTaskFunction forTask ;
3333
34+ private int maxIterations = 1024 ;
35+
3436 public LoopAgentsBuilder () {
3537 this .forTask = new ForTaskFunction ();
3638 this .forTask .setFor (new ForTaskConfiguration ());
@@ -56,7 +58,7 @@ public LoopAgentsBuilder subAgents(Object... agents) {
5658 }
5759
5860 public LoopAgentsBuilder maxIterations (int maxIterations ) {
59- this .forTask . withCollection ( ignored -> IntStream . range ( 0 , maxIterations ). boxed (). toList ()) ;
61+ this .maxIterations = maxIterations ;
6062 return this ;
6163 }
6264
@@ -67,6 +69,7 @@ public LoopAgentsBuilder exitCondition(Predicate<AgenticScope> exitCondition) {
6769
6870 public ForTaskFunction build () {
6971 this .forTask .setDo (this .funcDelegate .build ());
72+ this .forTask .withCollection (ignored -> IntStream .range (0 , maxIterations ).boxed ().toList ());
7073 return this .forTask ;
7174 }
7275}
You can’t perform that action at this time.
0 commit comments