Class PlanningContext
java.lang.Object
com.google.adk.agents.PlanningContext
Context provided to a
Planner during the planning loop.
Wraps an InvocationContext to expose the session state (world state), events, and
available sub-agents. Planners use this to inspect the current state and decide which agent(s) to
run next.
-
Constructor Summary
ConstructorsConstructorDescriptionPlanningContext(InvocationContext invocationContext, com.google.common.collect.ImmutableList<BaseAgent> availableAgents) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<BaseAgent> Returns the sub-agents available for the planner to select from.events()Returns all events in the current session.Finds an available agent by name.Returns the fullInvocationContextfor advanced use cases.state()Returns the session state — the shared "world state" that agents read and write.Optional<com.google.genai.types.Content> Returns the user content that initiated this invocation, if any.
-
Constructor Details
-
PlanningContext
public PlanningContext(InvocationContext invocationContext, com.google.common.collect.ImmutableList<BaseAgent> availableAgents)
-
-
Method Details
-
state
-
events
-
availableAgents
Returns the sub-agents available for the planner to select from. -
userContent
Returns the user content that initiated this invocation, if any. -
findAgent
Finds an available agent by name.- Throws:
IllegalArgumentException- if no agent with the given name is found.
-
invocationContext
Returns the fullInvocationContextfor advanced use cases.
-