Consolidateion of document upload API (#14106)

### What problem does this PR solve?

Consolidation WEB API & HTTP API for document upload

Before consolidation
Web API: POST /v1/document/upload
Http API - POST /api/v1/datasets/<dataset_id>/documents

After consolidation, Restful API -- POST
/api/v1/datasets/<dataset_id>/documents

### Type of change

- [x] Refactoring
This commit is contained in:
Jack
2026-04-15 11:27:43 +08:00
committed by GitHub
parent e1dede1366
commit bc5f78996b
13 changed files with 339 additions and 319 deletions

View File

@@ -1393,14 +1393,14 @@ class RAGFlowClient:
headers = {"Content-Type": encoder.content_type}
response = self.http_client.request(
"POST",
"/document/upload",
f"/datasets/{dataset_id}/documents?return_raw_files=true",
headers=headers,
data=encoder,
json_body=None,
params=None,
stream=False,
auth_kind="web",
use_api_base=False
use_api_base=True
)
res = response.json()
if res.get("code") == 0: