类 LegacyStateLoader

java.lang.Object
io.agentscope.core.state.LegacyStateLoader

public final class LegacyStateLoader extends Object
Utility for loading v1 session data into the 2.0 AgentState format.

This class reads the legacy session keys (memory_messages, toolkit_activeGroups) and constructs an equivalent AgentState object. The original session data is not modified or migrated in place; subsequent saves will use the new format automatically.

  • 方法详细资料

    • loadFromLegacySession

      public static AgentState loadFromLegacySession(AgentStateStore stateStore, String userId, String sessionId)
      Load an AgentState from a v1 session.

      Reads:

      • memory_messages — conversation history
      • toolkit_activeGroups — tool activation state
      参数:
      stateStore - the state store to read from
      userId - nullable user identifier
      sessionId - the session identifier (required)
      返回:
      a new AgentState populated with the legacy data