Merge pull request #906 from konrad-woj/fix-insert-custom-chunks

fix insert_custom_chunks skipping every new doc
This commit is contained in:
zrguo 2025-02-21 18:45:40 +08:00 committed by GitHub
commit 6ed81ed1c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -528,7 +528,7 @@ class LightRAG:
doc_key = compute_mdhash_id(full_text.strip(), prefix="doc-")
new_docs = {doc_key: {"content": full_text.strip()}}
_add_doc_keys = await self.full_docs.filter_keys(set(doc_key))
_add_doc_keys = await self.full_docs.filter_keys({doc_key})
new_docs = {k: v for k, v in new_docs.items() if k in _add_doc_keys}
if not len(new_docs):
logger.warning("This document is already in the storage.")