mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-07 16:11:16 +08:00
Refactor: migrate chunk retrieval_test and knowledge_graph to REST API endpoints (#14402)
### What problem does this PR solve? ## Summary Migrate two web API endpoints to REST-style HTTP API endpoints, following the pattern established in #14222: | Old Endpoint | New Endpoint | |---|---| | `POST /v1/chunk/retrieval_test` | `POST /api/v1/datasets/<dataset_id>/search` | | `GET /v1/chunk/knowledge_graph` | `GET /api/v1/datasets/<dataset_id>/graph` |
This commit is contained in:
@@ -517,3 +517,12 @@ def get_flattened_metadata(auth, dataset_ids, *, headers=HEADERS):
|
||||
url = f"{HOST_ADDRESS}{DATASETS_API_URL}/metadata/flattened"
|
||||
res = requests.get(url=url, headers=headers, auth=auth, params={"dataset_ids": ",".join(dataset_ids)})
|
||||
return res.json()
|
||||
|
||||
|
||||
def search_dataset(auth, dataset_id, payload=None, *, headers=HEADERS):
|
||||
url = f"{HOST_ADDRESS}{DATASETS_API_URL}/{dataset_id}/search"
|
||||
res = requests.post(url=url, headers=headers, auth=auth, json=payload)
|
||||
return res.json()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user