Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class LoopAgentsBuilder {
private final FuncTaskItemListBuilder funcDelegate;
private final ForTaskFunction forTask;

private int maxIterations = 1024;

public LoopAgentsBuilder() {
this.forTask = new ForTaskFunction();
this.forTask.setFor(new ForTaskConfiguration());
Expand All @@ -56,7 +58,7 @@ public LoopAgentsBuilder subAgents(Object... agents) {
}

public LoopAgentsBuilder maxIterations(int maxIterations) {
this.forTask.withCollection(ignored -> IntStream.range(0, maxIterations).boxed().toList());
this.maxIterations = maxIterations;
return this;
}

Expand All @@ -67,6 +69,7 @@ public LoopAgentsBuilder exitCondition(Predicate<AgenticScope> exitCondition) {

public ForTaskFunction build() {
this.forTask.setDo(this.funcDelegate.build());
this.forTask.withCollection(ignored -> IntStream.range(0, maxIterations).boxed().toList());
return this.forTask;
}
}