类 AgentStateMemoryView
- 所有已实现的接口:
Memory
Memory adapter that proxies getMessages() to a live
AgentState.getContext() resolved at call time.
Exists solely so deprecated 1.x hooks and tools (notably
StaticLongTermMemoryHook) keep working after the 2.0 builder dropped agent-owned
Memory. All mutating operations throw UnsupportedOperationException; mutate
context via AgentState.context instead.
The Supplier contract is "best-effort": a null return is interpreted as
"agent not yet bound" and surfaces as an empty message list rather than an exception, so
callers may instantiate the view before the owning ReActAgent is
constructed.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddMessage(Msg message) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Adds a message to the memory.voidclear()已过时, 待删除: 此 API 元素将从以后的版本中删除。Clears all messages from memory.voiddeleteMessage(int index) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Deletes a message at the specified index.已过时, 待删除: 此 API 元素将从以后的版本中删除。Retrieves all messages stored in memory.voidloadFrom(AgentStateStore stateStore, String userId, String sessionId) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Load a previously saved message buffer (no-op when none exists).voidsaveTo(AgentStateStore stateStore, String userId, String sessionId) 已过时, 待删除: 此 API 元素将从以后的版本中删除。Save the message buffer under thememory_messagessession key.
-
构造器详细资料
-
AgentStateMemoryView
已过时, 待删除: 此 API 元素将从以后的版本中删除。
-
-
方法详细资料
-
getMessages
已过时, 待删除: 此 API 元素将从以后的版本中删除。从接口复制的说明:MemoryRetrieves all messages stored in memory.- 指定者:
getMessages在接口中Memory- 返回:
- A list of all messages (may be empty but never null)
-
addMessage
已过时, 待删除: 此 API 元素将从以后的版本中删除。从接口复制的说明:MemoryAdds a message to the memory.- 指定者:
addMessage在接口中Memory- 参数:
message- The message to store in memory
-
deleteMessage
public void deleteMessage(int index) 已过时, 待删除: 此 API 元素将从以后的版本中删除。从接口复制的说明:MemoryDeletes a message at the specified index.If the index is out of bounds (negative or >= size), this operation should be a no-op rather than throwing an exception. This provides safe cleanup even with concurrent modifications.
- 指定者:
deleteMessage在接口中Memory- 参数:
index- The index of the message to delete (0-based)
-
clear
public void clear()已过时, 待删除: 此 API 元素将从以后的版本中删除。从接口复制的说明:MemoryClears all messages from memory.This operation removes all stored conversation history. Use with caution as this action is typically irreversible unless state has been persisted.
-
saveTo
已过时, 待删除: 此 API 元素将从以后的版本中删除。从接口复制的说明:MemorySave the message buffer under thememory_messagessession key. -
loadFrom
已过时, 待删除: 此 API 元素将从以后的版本中删除。从接口复制的说明:MemoryLoad a previously saved message buffer (no-op when none exists).
-
AgentState.getContext().