# Class SupervisorPlanner

java.lang.Object
com.google.adk.planner.SupervisorPlanner

All Implemented Interfaces:
  `Planner`

public final class SupervisorPlanner extends Object implements Planner
A planner that uses an LLM to dynamically decide which sub-agent(s) to run next.

The LLM is given a system prompt describing the available agents and their descriptions, the current state, and recent events. It responds with the agent name(s) to run, "DONE", or "DONE: summary".

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SupervisorPlanner(BaseLlm llm)`
  `SupervisorPlanner(BaseLlm llm, String systemInstruction)`
  `SupervisorPlanner(BaseLlm llm, String systemInstruction, int maxEvents)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `io.reactivex.rxjava3.core.Single<PlannerAction>`
  `firstAction(PlanningContext context)`
  Select the first action to execute.
  `io.reactivex.rxjava3.core.Single<PlannerAction>`
  `nextAction(PlanningContext context)`
  Select the next action based on updated state and events.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface Planner

  `init`
  Modifier and Type
  Method
  Description
  `default void`
  `init(PlanningContext context)`
  Initialize the planner with context and available agents.

- ## Constructor Details

  - ### SupervisorPlanner

    public SupervisorPlanner(BaseLlm llm, String systemInstruction, int maxEvents)

  - ### SupervisorPlanner

    public SupervisorPlanner(BaseLlm llm, String systemInstruction)

  - ### SupervisorPlanner

    public SupervisorPlanner(BaseLlm llm)

- ## Method Details

  - ### firstAction

    public io.reactivex.rxjava3.core.Single<PlannerAction> firstAction(PlanningContext context)
    Description copied from interface: `Planner`
    Select the first action to execute.
    Specified by:
      `firstAction` in interface `Planner`

  - ### nextAction

    public io.reactivex.rxjava3.core.Single<PlannerAction> nextAction(PlanningContext context)
    Description copied from interface: `Planner`
    Select the next action based on updated state and events.
    Specified by:
      `nextAction` in interface `Planner`