St1ve commited on
Commit
f396c28
·
unverified ·
1 Parent(s): 07feee7

Update json_kv_impl.py

Browse files

There is no delete function in chunks_vdb and text_chunks in lines 1300-1302 of the lightrag.py file:
if chunk_ids:
await self.chunks_vdb.delete(chunk_ids)
await self.text_chunks.delete(chunk_ids)

Files changed (1) hide show
  1. lightrag/kg/json_kv_impl.py +5 -0
lightrag/kg/json_kv_impl.py CHANGED
@@ -47,3 +47,8 @@ class JsonKVStorage(BaseKVStorage):
47
 
48
  async def drop(self) -> None:
49
  self._data = {}
 
 
 
 
 
 
47
 
48
  async def drop(self) -> None:
49
  self._data = {}
50
+
51
+ async def delete(self, ids: list[str]) -> None:
52
+ for doc_id in ids:
53
+ self._data.pop(doc_id, None)
54
+ await self.index_done_callback()