Annotation Interface Output


@Retention(RUNTIME) @Target(METHOD) public @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(outputKey = "plans",
                subAgents = { FoodExpert.class, MovieExpert.class })
        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;
        }
    }