MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / remove_by_doc_name

Method remove_by_doc_name

openkb/state.py:86–93  ·  view source on GitHub ↗

Remove the entry whose metadata['doc_name'] matches. Returns True if removed.

(self, doc_name: str)

Source from the content-addressed store, hash-verified

84 self._persist()
85
86 def remove_by_doc_name(self, doc_name: str) -> bool:
87 """Remove the entry whose metadata['doc_name'] matches. Returns True if removed."""
88 for file_hash, meta in list(self._data.items()):
89 if meta.get("doc_name") == doc_name:
90 del self._data[file_hash]
91 self._persist()
92 return True
93 return False
94
95 def remove_by_hash(self, file_hash: str) -> bool:
96 """Remove the entry keyed by ``file_hash``. Returns True if removed.

Calls 2

_persistMethod · 0.95
getMethod · 0.45

Tested by 1