mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-07 08:26:06 +00:00
fix: use attribute access for VectorNode in DeleteMemoryOp
This commit is contained in:
parent
b8c1b4844b
commit
e5b1ee152a
1 changed files with 4 additions and 3 deletions
|
|
@ -48,10 +48,11 @@ class DeleteMemoryOp(BaseAsyncOp):
|
|||
|
||||
deleted_memory_ids = []
|
||||
for node in nodes:
|
||||
freq = node["metadata"]["metadata"]["freq"]
|
||||
utility = node["metadata"]["metadata"]["utility"]
|
||||
# VectorNode 对象需要使用属性访问,不是字典访问
|
||||
freq = node.metadata.get("freq", 0)
|
||||
utility = node.metadata.get("utility", 0)
|
||||
if freq >= freq_threshold:
|
||||
if utility * 1.0 / freq < utility_threshold:
|
||||
deleted_memory_ids.append(node["unique_id"])
|
||||
deleted_memory_ids.append(node.unique_id)
|
||||
|
||||
self.context.deleted_memory_ids = deleted_memory_ids
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue