类的使用
io.agentscope.core.state.AgentState
使用AgentState的程序包
程序包
说明
-
io.agentscope.core中AgentState的使用
返回AgentState的io.agentscope.core中的方法修饰符和类型方法说明ReActAgent.getAgentState()已过时。ReActAgent.getAgentState(RuntimeContext ctx) Returns theAgentStatefor the session identified by the givenRuntimeContext.ReActAgent.getAgentState(String userId, String sessionId) Returns theAgentStatefor the given(userId, sessionId)slot, loading it from the configuredAgentStateStoreon first access and caching it for subsequent calls within this JVM.protected AgentStateReActAgent.stateForCall(Object callScope) -
io.agentscope.core.agent中AgentState的使用
修饰符和类型方法说明default AgentStateAgent.getAgentState()Returns the agent's runtimeAgentState, ornullif this agent type does not maintain one.AgentBase.getAgentState()Returns the agent's mutable runtime state, ornullif this agent type does not maintain anAgentState.RuntimeContext.getAgentState()static AgentStateRuntimeContext.resolveAgentState(RuntimeContext ctx, Agent fallbackAgent) Resolves the liveAgentStatefor the current call, preferring the call-scoped state carried onctx(concurrency-safe) and falling back tofallbackAgent's state only when the context carries none.protected AgentStateAgentBase.stateForCall(Object callScope) Returns theAgentStatewhose conversation buffer should seed the pre-call memory snapshot for this invocation.参数类型为AgentState的io.agentscope.core.agent中的方法修饰符和类型方法说明RuntimeContext.Builder.agentState(AgentState agentState) voidRuntimeContext.setAgentState(AgentState agentState) Installs the call-scopedAgentState. -
io.agentscope.core.memory中AgentState的使用
参数类型为AgentState的io.agentscope.core.memory中的构造器类型变量类型为AgentState的io.agentscope.core.memory中的构造器参数 -
io.agentscope.core.shutdown中AgentState的使用
参数类型为AgentState的io.agentscope.core.shutdown中的方法修饰符和类型方法说明voidGracefulShutdownManager.bindRequestState(String requestId, AgentState state) Bind the per-callAgentStateresolved for the in-flight request identified byrequestId, so shutdown interruption and state-saving target that exact(userId, sessionId)session rather than the agent's no-arg "most-recently-active" accessors.voidShutdownStateSaver.save(AgentState state) Persist the given agent state snapshot. -
io.agentscope.core.state中AgentState的使用
修饰符和类型方法说明AgentState.Builder.build()static AgentStateAgentState.fromJsonString(String json) Deserialize anAgentStatefrom a JSON string produced bytoJson().static AgentStateLegacyStateLoader.loadFromLegacySession(AgentStateStore stateStore, String userId, String sessionId) Load anAgentStatefrom a v1 session. -
io.agentscope.core.tool.builtin中AgentState的使用
修饰符和类型方法说明TodoTools.todoWrite(List<TodoTools.TodoItem> todos, AgentState state) Replaces the session task list withtodos.
ReActAgent.getAgentState(RuntimeContext)orReActAgent.getAgentState(String, String)with explicit session identity.