mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 06:46:40 +08:00
Fix: Python SDK retrieve document_name is empty (#12062)
### What problem does this PR solve? https://github.com/infiniflow/ragflow/issues/12056 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -33,6 +33,7 @@ class Chunk(Base):
|
||||
self.create_timestamp = 0.0
|
||||
self.dataset_id = None
|
||||
self.document_name = ""
|
||||
self.documnet_keyword = ""
|
||||
self.document_id = ""
|
||||
self.available = True
|
||||
# Additional fields for retrieval results
|
||||
@ -46,6 +47,11 @@ class Chunk(Base):
|
||||
res_dict.pop(k)
|
||||
super().__init__(rag, res_dict)
|
||||
|
||||
#for backward compatibility
|
||||
if not self.document_name:
|
||||
self.document_name = self.documnet_keyword
|
||||
|
||||
|
||||
def update(self, update_message: dict):
|
||||
res = self.put(f"/datasets/{self.dataset_id}/documents/{self.document_id}/chunks/{self.id}", update_message)
|
||||
res = res.json()
|
||||
|
||||
Reference in New Issue
Block a user