Bläddra i källkod

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)
tags/v0.19.0
Stephen Hu 5 månader sedan
förälder
incheckning
ad412380cb
Inget konto är kopplat till bidragsgivarens mejladress
2 ändrade filer med 8 tillägg och 2 borttagningar
  1. 6
    0
      api/apps/sdk/doc.py
  2. 2
    2
      sdk/python/ragflow_sdk/modules/document.py

+ 6
- 0
api/apps/sdk/doc.py Visa fil

@@ -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

+ 2
- 2
sdk/python/ragflow_sdk/modules/document.py Visa fil

@@ -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:

Laddar…
Avbryt
Spara