[BREAKING CHANGE] GET to POST: enhance document list capability (#7349)

### What problem does this PR solve?

Enhance capability of `list_docs`.

Breaking change: change method from `GET` to `POST`.

### Type of change

- [x] Refactoring
- [x] Enhancement with breaking change
This commit is contained in:
Yongteng Lei
2025-04-27 16:48:27 +08:00
committed by GitHub
parent 5043143bc5
commit a4be6c50cf
6 changed files with 62 additions and 14 deletions

View File

@ -70,7 +70,8 @@ def upload_file(auth, dataset_id, path):
def list_document(auth, dataset_id):
authorization = {"Authorization": auth}
url = f"{HOST_ADDRESS}/v1/document/list?kb_id={dataset_id}"
res = requests.get(url=url, headers=authorization)
json = {}
res = requests.post(url=url, headers=authorization, json=json)
return res.json()