From ad412380cbba91660dd654bc2dee7ab0082e15e5 Mon Sep 17 00:00:00 2001 From: Stephen Hu Date: Mon, 12 May 2025 11:05:32 +0800 Subject: [PATCH] Fix:Discrepancy between Document.list_chunks() API documentation and implementation (#7575) ### What problem does this PR solve? Close #7567 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/apps/sdk/doc.py | 6 ++++++ sdk/python/ragflow_sdk/modules/document.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/api/apps/sdk/doc.py b/api/apps/sdk/doc.py index a71cc7328..f76065c1c 100644 --- a/api/apps/sdk/doc.py +++ b/api/apps/sdk/doc.py @@ -856,6 +856,12 @@ def list_chunks(tenant_id, dataset_id, document_id): required: false default: 30 description: Number of items per page. + - in: query + name: id + type: string + required: false + default: "" + description: Chunk Id. - in: header name: Authorization type: string diff --git a/sdk/python/ragflow_sdk/modules/document.py b/sdk/python/ragflow_sdk/modules/document.py index 60a6e064b..187d08901 100644 --- a/sdk/python/ragflow_sdk/modules/document.py +++ b/sdk/python/ragflow_sdk/modules/document.py @@ -66,8 +66,8 @@ class Document(Base): except json.JSONDecodeError: return res.content - def list_chunks(self, page=1, page_size=30, keywords=""): - data = {"keywords": keywords, "page": page, "page_size": page_size} + def list_chunks(self, page=1, page_size=30, keywords="", id = ""): + data = {"keywords": keywords, "page": page, "page_size": page_size, "id": id} res = self.get(f'/datasets/{self.dataset_id}/documents/{self.id}/chunks', data) res = res.json() if res.get("code") == 0: