mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: Add support for document meta fields update through api (#5120)
### What problem does this PR solve? add support for update document meta data through api ### Type of change - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: wenju.li <wenju.li@deepctr.cn> Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
@ -49,6 +49,9 @@ class Document(Base):
|
||||
super().__init__(rag, res_dict)
|
||||
|
||||
def update(self, update_message: dict):
|
||||
if "meta_fields" in update_message:
|
||||
if not isinstance(update_message["meta_fields"], dict):
|
||||
raise Exception("meta_fields must be a dictionary")
|
||||
res = self.put(f'/datasets/{self.dataset_id}/documents/{self.id}',
|
||||
update_message)
|
||||
res = res.json()
|
||||
|
||||
Reference in New Issue
Block a user