mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-05 08:06:15 +00:00
bug fix: deal with empty pickle dict, reverse _key_id_dict changes
This commit is contained in:
parent
e6a0872185
commit
88946c19e2
2 changed files with 9 additions and 2 deletions
|
|
@ -189,9 +189,14 @@ class LlamaIndexEsMemoryStore(BaseMemoryStore):
|
|||
Returns:
|
||||
MemoryNode: The converted MemoryNode with text and metadata from the NodeWithScore.
|
||||
"""
|
||||
key_vector = pickle.loads(text_node.metadata["key_vector"].encode('latin1'))
|
||||
|
||||
if text_node.metadata["key_vector"]:
|
||||
key_vector = pickle.loads(text_node.metadata["key_vector"].encode('latin1'))
|
||||
else:
|
||||
key_vector = []
|
||||
text_node.metadata["key_vector"] = key_vector
|
||||
|
||||
text_node.metadata["vector"] = text_node.embedding if text_node.embedding else []
|
||||
text_node.metadata["score_recall"] = text_node.score
|
||||
text_node.metadata["key_vector"] = key_vector
|
||||
|
||||
return MemoryNode(content=text_node.text, **text_node.metadata)
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ class MemoryManager(object):
|
|||
self.logger.info(f"add to memory context memory id={node.memory_id} content={node.content} "
|
||||
f"store_status={node.store_status} action_status={node.action_status}")
|
||||
|
||||
self._key_id_dict[key] = [n.memory_id for n in nodes]
|
||||
|
||||
if nodes:
|
||||
self.logger.info(
|
||||
self.logger.wrap_in_box(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue