mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-02-06 23:15:53 +08:00
fix: incorrect variable usage in update_doc_by_ids method (#4048)
Co-authored-by: saf <saf@zjuici.com>
This commit is contained in:
parent
8ca9e8ff28
commit
b9827529aa
@ -194,14 +194,14 @@ class KBService(ABC):
|
|||||||
如果对应 doc_id 的值为 None,或其 page_content 为空,则删除该文档
|
如果对应 doc_id 的值为 None,或其 page_content 为空,则删除该文档
|
||||||
'''
|
'''
|
||||||
self.del_doc_by_ids(list(docs.keys()))
|
self.del_doc_by_ids(list(docs.keys()))
|
||||||
docs = []
|
pending_docs = []
|
||||||
ids = []
|
ids = []
|
||||||
for k, v in docs.items():
|
for _id, doc in docs.items():
|
||||||
if not v or not v.page_content.strip():
|
if not doc or not doc.page_content.strip():
|
||||||
continue
|
continue
|
||||||
ids.append(k)
|
ids.append(_id)
|
||||||
docs.append(v)
|
pending_docs.append(doc)
|
||||||
self.do_add_doc(docs=docs, ids=ids)
|
self.do_add_doc(docs=pending_docs, ids=ids)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def list_docs(self, file_name: str = None, metadata: Dict = {}) -> List[DocumentWithVSId]:
|
def list_docs(self, file_name: str = None, metadata: Dict = {}) -> List[DocumentWithVSId]:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user