类 AgentState
- 所有已实现的接口:
State
Carries everything a single agent needs to resume mid-conversation: the conversation buffer, a rolling summary, the per-iteration reply identifier, the permission/tool/task sub-contexts, and a counter for the current reasoning iteration.
The context list is exposed as a defensive copy via getContext() and as a
live, mutable handle via contextMutable(), mirroring the pattern used by
TaskContextState. Storage layers may swap whole AgentState instances or mutate the
inner collections in place.
summary is modelled as a free-form String; richer structured forms are left
for future iterations once context-compression strategies require them.
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static AgentState.Builderbuilder()Live, mutable handle for components that append/replace messages in place.booleanstatic AgentStatefromJsonString(String json) Deserialize anAgentStatefrom a JSON string produced bytoJson().Defensive copy of the conversation buffer.intNullable;null= anonymous / single-tenant context.inthashCode()The per-session interrupt signal for this state, created on first access.booleanvoidsetCurIter(int curIter) voidsetPermissionContext(PermissionContextState permissionContext) Replaces the permission context for this session.voidsetReplyId(String replyId) voidsetShutdownInterrupted(boolean shutdownInterrupted) voidsetSummary(String summary) toJson()Serialize this state to a pretty-printed JSON string.toString()
-
方法详细资料
-
getSessionId
-
getUserId
Nullable;null= anonymous / single-tenant context. -
getSummary
-
setSummary
-
getContext
Defensive copy of the conversation buffer. -
contextMutable
Live, mutable handle for components that append/replace messages in place. -
getReplyId
-
setReplyId
-
getCurIter
public int getCurIter() -
setCurIter
public void setCurIter(int curIter) -
isShutdownInterrupted
public boolean isShutdownInterrupted() -
setShutdownInterrupted
public void setShutdownInterrupted(boolean shutdownInterrupted) -
getPermissionContext
-
setPermissionContext
Replaces the permission context for this session. Used to change the evaluation mode at runtime (e.g. switching intoPermissionMode.BYPASS). Callers that cache aPermissionEngineper session must rebuild it after this call.- 参数:
permissionContext- the new (non-null) permission context
-
getToolContext
-
getTasksContext
-
getPlanModeContext
-
interruptControl
The per-session interrupt signal for this state, created on first access. Runtime-only and not serialized. -
builder
-
toJson
Serialize this state to a pretty-printed JSON string.Intended for external storage stores to persist the entire agent state as a single JSON document (e.g.,
agent_state.json). -
fromJsonString
Deserialize anAgentStatefrom a JSON string produced bytoJson(). -
equals
-
hashCode
public int hashCode() -
toString
-