Interface Planner
- All Known Implementing Classes:
GoalOrientedPlanner, LoopPlanner, P2PPlanner, ParallelPlanner, SequentialPlanner, SupervisorPlanner
public interface Planner
Strategy interface for planning which sub-agent(s) to execute next.
A Planner is used by PlannerAgent to dynamically determine execution order at
runtime. The planning loop works as follows:
init(PlanningContext)is called once before the loop startsfirstAction(PlanningContext)returns the first action to execute- The selected agent(s) execute, producing events and updating session state
nextAction(PlanningContext)is called with updated context to decide what to do next- Steps 3-4 repeat until
PlannerAction.Doneor max iterations
Returns Single<PlannerAction> to support both synchronous planners (wrap in
Single.just()) and asynchronous planners that call an LLM.
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<PlannerAction> firstAction(PlanningContext context) Select the first action to execute.default voidinit(PlanningContext context) Initialize the planner with context and available agents.io.reactivex.rxjava3.core.Single<PlannerAction> nextAction(PlanningContext context) Select the next action based on updated state and events.
-
Method Details
-
init
Initialize the planner with context and available agents. Called once before the planning loop starts.Default implementation is a no-op. Override to perform setup like building dependency graphs.
-
firstAction
Select the first action to execute. -
nextAction
Select the next action based on updated state and events.
-