Annotation Interface Output
Marks a method as the output definition of a workflow agent,
generally combining results from different states of the
AgenticScope
.
The method must be static and return the output of the agent.
Example:
public interface EveningPlannerAgent {
@ParallelAgent(outputName = "plans", subAgents = {
@SubAgent(type = FoodExpert.class, outputName = "meals"),
@SubAgent(type = MovieExpert.class, outputName = "movies")
})
List<EveningPlan> plan(@V("mood") String mood);
@Output
static List<EveningPlan> createPlans(@V("movies") List<String> movies, @V("meals") List<String> meals) {
List<EveningPlan> moviesAndMeals = new ArrayList<>();
for (int i = 0; i < movies.size(); i++) {
if (i >= meals.size()) {
break;
}
moviesAndMeals.add(new EveningPlan(movies.get(i), meals.get(i)));
}
return moviesAndMeals;
}
}