Skip to content
Merged
Changes from 2 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 @@ -140,6 +140,18 @@ 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 conditionalSequence(Predicate<?> predicate, Object... agents) {
Copy link
Member

Choose a reason for hiding this comment

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

We can keep this as "sequence" or "conditional". Too long :)

return list -> list.sequence(agents).when(predicate);
}

public static AgentTaskConfigurer conditionalParallel(Predicate<?> predicate, Object... agents) {
Copy link
Member

Choose a reason for hiding this comment

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

Same thing. We can name this just parallel.

return list -> list.parallel(agents).when(predicate);
}

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