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 {
31
31
private final FuncTaskItemListBuilder funcDelegate ;
32
32
private final ForTaskFunction forTask ;
33
33
34
+ private int maxIterations = 1024 ;
35
+
34
36
public LoopAgentsBuilder () {
35
37
this .forTask = new ForTaskFunction ();
36
38
this .forTask .setFor (new ForTaskConfiguration ());
@@ -56,7 +58,7 @@ public LoopAgentsBuilder subAgents(Object... agents) {
56
58
}
57
59
58
60
public LoopAgentsBuilder maxIterations (int maxIterations ) {
59
- this .forTask . withCollection ( ignored -> IntStream . range ( 0 , maxIterations ). boxed (). toList ()) ;
61
+ this .maxIterations = maxIterations ;
60
62
return this ;
61
63
}
62
64
@@ -67,6 +69,7 @@ public LoopAgentsBuilder exitCondition(Predicate<AgenticScope> exitCondition) {
67
69
68
70
public ForTaskFunction build () {
69
71
this .forTask .setDo (this .funcDelegate .build ());
72
+ this .forTask .withCollection (ignored -> IntStream .range (0 , maxIterations ).boxed ().toList ());
70
73
return this .forTask ;
71
74
}
72
75
}
You can’t perform that action at this time.
0 commit comments