AS AgentScopeAPI 手册 / API Reference

AgentStateEntity

@Entity @Table( name = "builder_agent_state", uniqueConstraints = @UniqueConstraint( name = "uk_builder_agent_state_slot", columnNames = {"user_id", "session_id", "state_key"}), indexes = { @Index(name = "ix_builder_agent_state_user", columnList = "user_id"), @Index(name = "ix_builder_agent_state_user_session", columnList = "user_id,session_id") }) public class AgentStateEntity
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:34–127

智能体状态 Entity,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.builder.web.persistence.jpa 包。核心成员包括 getRowId、setRowId、getUserId、setUserId、getSessionId、setSessionId。

One row of persisted io.agentscope.core.state.AgentStateStore data.

list_kind=false stores a single JSON object; list_kind=true stores a JSON array (full list replacement).

方法摘要Method Summary

方法Method说明Description
public Long getRowId()
获取 `getRowId`。
Returns the row id.
public void setRowId(Long rowId)
设置 `setRowId`。
Sets the row id.
public String getUserId()
获取用户标识。
Returns the user id.
public void setUserId(String userId)
设置用户标识。
Sets the user id.
public String getSessionId()
获取会话标识。
Returns the session id.
public void setSessionId(String sessionId)
设置会话标识。
Sets the session id.
public String getStateKey()
获取状态键。
Returns the state key.
public void setStateKey(String stateKey)
设置状态键。
Sets the state key.
public boolean isListKind()
判断是否列表种类。
Returns whether the list kind.
public void setListKind(boolean listKind)
设置列表种类。
Sets the list kind.
public String getStateData()
获取状态数据。
Returns the state data.
public void setStateData(String stateData)
设置状态数据。
Sets the state data.
public long getUpdatedAt()
获取已更新 At。
Returns the updated at.
public void setUpdatedAt(long updatedAt)
设置已更新 At。
Sets the updated at.

方法详情Method Detail

getRowId

public Long getRowId()

获取 getRowId。

Returns the row id.

返回Returns Long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:72–74

setRowId

public void setRowId(Long rowId)

设置 setRowId。

Sets the row id.

参数Parameters
名称Name类型Type说明Description
rowIdLongrow 标识(类型 `Long`)。The row id.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:76–78

getUserId

public String getUserId()

获取用户标识。

Returns the user id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:80–82

setUserId

public void setUserId(String userId)

设置用户标识。

Sets the user id.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:84–86

getSessionId

public String getSessionId()

获取会话标识。

Returns the session id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:88–90

setSessionId

public void setSessionId(String sessionId)

设置会话标识。

Sets the session id.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:92–94

getStateKey

public String getStateKey()

获取状态键。

Returns the state key.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:96–98

setStateKey

public void setStateKey(String stateKey)

设置状态键。

Sets the state key.

参数Parameters
名称Name类型Type说明Description
stateKeyString状态键(类型 `String`)。The state key.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:100–102

isListKind

public boolean isListKind()

判断是否列表种类。

Returns whether the list kind.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:104–106

setListKind

public void setListKind(boolean listKind)

设置列表种类。

Sets the list kind.

参数Parameters
名称Name类型Type说明Description
listKindboolean列表种类(类型 `boolean`)。The list kind.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:108–110

getStateData

public String getStateData()

获取状态数据。

Returns the state data.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:112–114

setStateData

public void setStateData(String stateData)

设置状态数据。

Sets the state data.

参数Parameters
名称Name类型Type说明Description
stateDataString状态数据(类型 `String`)。The state data.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:116–118

getUpdatedAt

public long getUpdatedAt()

获取已更新 At。

Returns the updated at.

返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:120–122

setUpdatedAt

public void setUpdatedAt(long updatedAt)

设置已更新 At。

Sets the updated at.

参数Parameters
名称Name类型Type说明Description
updatedAtlong已更新 At(类型 `long`)。The updated at.
源码Source io/agentscope/builder/web/persistence/jpa/AgentStateEntity.java:124–126
基于官方固定版本源码静态生成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.