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 @@ -113,6 +113,10 @@ public static AgentTaskConfigurer sequence(Object... agents) {
return list -> list.sequence(agents);
}

public static AgentTaskConfigurer sequence(Predicate<?> predicate, Object... agents) {
return list -> list.sequence(agents).when(predicate);
}

public static AgentTaskConfigurer loop(Predicate<AgenticScope> exitCondition, Object... agents) {
return list -> list.loop(l -> l.subAgents(agents).exitCondition(exitCondition));
}
Expand All @@ -121,6 +125,10 @@ public static AgentTaskConfigurer parallel(Object... agents) {
return list -> list.parallel(agents);
}

public static AgentTaskConfigurer parallel(Predicate<?> predicate, Object... agents) {
return list -> list.parallel(agents).when(predicate);
}

// --------- Tasks ------ //
public static Consumer<AgentDoTaskBuilder> doTasks(AgentTaskConfigurer... steps) {
Objects.requireNonNull(steps, "Steps in a tasks are required");
Expand All @@ -140,6 +148,10 @@ public static AgentTaskConfigurer agent(Object agent) {
return list -> list.agent(agent);
}

public static AgentTaskConfigurer conditional(Predicate<?> predicate, Object agent) {
return list -> list.agent(agent).when(predicate);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new overload conditional(predicate, agents..) in case we can call a sequence of agents under a certain condition.


public static AgentTaskConfigurer emit(Consumer<FuncEmitTaskBuilder> event) {
return list -> list.emit(event);
}
Expand Down