AS AgentScopeAPI 手册 / API Reference

PlanModeContextState

@JsonPropertyOrder({"plan_active", "current_plan_file"}) public final class PlanModeContextState
源码Source io/agentscope/core/state/PlanModeContextState.java:36–97

计划模式上下文状态,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.core.state 包。核心成员包括 isPlanActive、setPlanActive、getCurrentPlanFile、setCurrentPlanFile、equals、hashCode。

Persisted plan-mode flag for an agent.

Plan mode is a read-only "design first" phase: while #planActive is true, the PlanModeMiddleware denies mutating tool calls so the agent can investigate and draft a plan without changing anything. #currentPlanFile is the workspace-relative path of the markdown blueprint the agent is editing (if any).

This lives inside AgentState (rather than in volatile in-process memory) precisely because agentscope agents are distributed and resumable: a plan-mode session must survive process restarts and hand-offs across nodes. Toggling the flag and persisting the AgentState is therefore the canonical way to switch modes dynamically at runtime.

构造器摘要Constructor Summary

构造器Constructor说明Description
public PlanModeContextState()
初始化 `PlanModeContextState` 实例。
Creates a new instance.
public PlanModeContextState(boolean planActive, String currentPlanFile)
初始化 `PlanModeContextState` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public boolean isPlanActive()
判断是否 `isPlanActive`。
Returns whether the plan active.
public void setPlanActive(boolean planActive)
设置 `setPlanActive`。
Sets the plan active.
public String getCurrentPlanFile()
获取当前计划文件。
Returns the current plan file.
public void setCurrentPlanFile(String currentPlanFile)
设置当前计划文件。
Sets the current plan file.
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
public int hashCode()
返回 `hashCode` 结果。
Returns the hash code.
public String toString()
返回 `toString` 结果。
Returns the to string.

构造器详情Constructor Detail

PlanModeContextState

public PlanModeContextState()

初始化 PlanModeContextState 实例。

Creates a new instance.

源码Source io/agentscope/core/state/PlanModeContextState.java:42–44

PlanModeContextState

public PlanModeContextState(boolean planActive, String currentPlanFile)

初始化 PlanModeContextState 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
planActiveboolean计划 Active(类型 `boolean`)。The plan active.
currentPlanFileString当前计划文件(类型 `String`)。The current plan file.
源码Source io/agentscope/core/state/PlanModeContextState.java:46–52

方法详情Method Detail

isPlanActive

public boolean isPlanActive()

判断是否 isPlanActive。

Returns whether the plan active.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/state/PlanModeContextState.java:54–57

setPlanActive

public void setPlanActive(boolean planActive)

设置 setPlanActive。

Sets the plan active.

参数Parameters
名称Name类型Type说明Description
planActiveboolean计划 Active(类型 `boolean`)。The plan active.
源码Source io/agentscope/core/state/PlanModeContextState.java:59–61

getCurrentPlanFile

public String getCurrentPlanFile()

获取当前计划文件。

Returns the current plan file.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/PlanModeContextState.java:63–66

setCurrentPlanFile

public void setCurrentPlanFile(String currentPlanFile)

设置当前计划文件。

Sets the current plan file.

参数Parameters
名称Name类型Type说明Description
currentPlanFileString当前计划文件(类型 `String`)。The current plan file.
源码Source io/agentscope/core/state/PlanModeContextState.java:68–70

equals

public boolean equals(Object o)

设置该参数。

Performs the equals operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/core/state/PlanModeContextState.java:72–82

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/state/PlanModeContextState.java:84–87

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/state/PlanModeContextState.java:89–96
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.