Annotation Interface ParallelAgent
Marks a method as a definition of a parallel agent, used to orchestrate the agentic workflow
by invoking a series of sub-agents in parallel.
Each sub-agent is defined using the
SubAgent
annotation, which specifies the sub-agent's type
and its output variable name.
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);
}
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDescription of the agent.Name of the agent.Name of the output variable that will hold the result of the agent invocation.
-
Element Details
-
name
String nameName of the agent. If not provided, method name will be used.- Returns:
- name of the agent.
- Default:
""
-
description
String descriptionDescription of the agent. It should be clear and descriptive to allow language model to understand the agent's purpose and its intended use.- Returns:
- description of the agent.
- Default:
""
-
outputName
String outputNameName of the output variable that will hold the result of the agent invocation.- Returns:
- name of the output variable.
- Default:
""
-
subAgents
SubAgent[] subAgentsArray of sub-agents that will be invoked in parallel.- Returns:
- array of sub-agents.
-