fix(storage): 修复了Bot/src/memory_graph/storage/vector_store.py 中 get_node_by_id 函数的逻辑问题。通过将 if result["ids"]: 修改为 if result and result["ids"]:,解决了当 chromadb 返回 numpy 数组时可能引发的 ValueError,确保了程序在处理节点查询时的健壮性。
This commit is contained in:
@@ -367,7 +367,7 @@ class VectorStore:
|
||||
try:
|
||||
result = self.collection.get(ids=[node_id], include=["metadatas", "embeddings"])
|
||||
|
||||
if result["ids"]:
|
||||
if result and result["ids"]:
|
||||
return {
|
||||
"id": result["ids"][0],
|
||||
"metadata": result["metadatas"][0] if result["metadatas"] else {},
|
||||
|
||||
Reference in New Issue
Block a user