MCPcopy Create free account
hub / github.com/Spinachead/arg / clear

Method clear

app/knowledge_base/kb_cache/faiss_cache.py:43–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41 return ret
42
43 def clear(self):
44 ret = []
45 with self.acquire():
46 ids = list(self._obj.docstore._dict.keys())
47 if ids:
48 ret = self._obj.delete(ids)
49 assert len(self._obj.docstore._dict) == 0
50 # logger.info(f"已将向量库 {self.key} 清空")
51 return ret
52
53
54class _FaissPool(CachePool):

Callers 2

clear_allMethod · 0.80
start_loadingMethod · 0.80

Calls 2

keysMethod · 0.80
acquireMethod · 0.45

Tested by

no test coverage detected