`ClassPlanningContext`
java.lang.Object
com.google.adk.agents.PlanningContext
提供给……的上下文信息。
Planner 在规划阶段(即“规划循环”期间)。
用于包装(或封装)其他内容…… InvocationContext 为了暴露会话状态(即整个系统的状态)、发生的事件以及可用的子代理(sub-agents),规划器(planners)会利用这些信息来检查当前的系统状态,并决定接下来应该运行哪个(哪些)代理。
-
构造函数概述
ConstructorsConstructorDescriptionPlanningContext(InvocationContext invocationContext, com.google.common.collect.ImmutableList<BaseAgent> availableAgents) -
方法概述
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<BaseAgent> 返回可供规划者选择的子代理(sub-agents)。events()返回当前会话中的所有事件。根据名称查找可用的代理。返回完整的(内容)。InvocationContext适用于高级使用场景。state()返回会话状态(session state)——即所有代理程序(agents)都可以读取和写入的共享“全局状态”(shared “world state”)。Optional<com.google.genai.types.Content> 如果存在的话,该函数会返回触发此次调用的用户内容。
-
构造函数详细信息
-
PlanningContext
public PlanningContext(InvocationContext invocationContext, com.google.common.collect.ImmutableList<BaseAgent> availableAgents)
-
-
方法详细信息(Method Details)
-
state
-
events
-
availableAgents
返回可供规划者选择的子代理(sub-agents)。 -
userContent
如果存在的话,该函数会返回触发此次调用的用户内容。 -
findAgent
根据名称查找可用的代理。- Throws:
IllegalArgumentException- if no agent with the given name is found.
-
invocationContext
返回完整的(内容)。InvocationContext适用于高级使用场景。
-