mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
Refactor: migrate document run api (#14351)
### What problem does this PR solve? Before migration: POST /v1/document/run After migration: POST /api/v1/documents/ingest/ ### Type of change - [x] Refactoring
This commit is contained in:
@@ -1325,7 +1325,7 @@ class RAGFlowClient:
|
||||
print(f"Documents {document_names} not found in {dataset_name}")
|
||||
|
||||
payload = {"doc_ids": document_ids, "run": 1}
|
||||
response = self.http_client.request("POST", "/document/run", json_body=payload, use_api_base=False,
|
||||
response = self.http_client.request("POST", "/documents/ingest", json_body=payload, use_api_base=True,
|
||||
auth_kind="web")
|
||||
res_json = response.json()
|
||||
if response.status_code == 200 and res_json["code"] == 0:
|
||||
@@ -1351,7 +1351,7 @@ class RAGFlowClient:
|
||||
document_ids.append(doc["id"])
|
||||
|
||||
payload = {"doc_ids": document_ids, "run": 1}
|
||||
response = self.http_client.request("POST", "/document/run", json_body=payload, use_api_base=False,
|
||||
response = self.http_client.request("POST", "/documents/ingest", json_body=payload, use_api_base=True,
|
||||
auth_kind="web")
|
||||
res_json = response.json()
|
||||
if response.status_code == 200 and res_json["code"] == 0:
|
||||
|
||||
Reference in New Issue
Block a user