mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Guard /datasets/{dataset_id}/chunks cannot parse ingestion pipeline, use /documents/ingest instead (#16395)
This commit is contained in:
@@ -1952,7 +1952,11 @@ Failure:
|
||||
|
||||
**POST** `/api/v1/datasets/{dataset_id}/chunks`
|
||||
|
||||
Parses documents in a specified dataset.
|
||||
Parses documents in a specified dataset using the built-in chunking pipeline.
|
||||
|
||||
:::note
|
||||
This endpoint only supports datasets that use the built-in chunking pipeline. For datasets configured with an ingestion pipeline, use `POST /api/v1/documents/ingest` instead.
|
||||
:::
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -2005,6 +2009,70 @@ Failure:
|
||||
|
||||
---
|
||||
|
||||
### Ingest documents
|
||||
|
||||
**POST** `/api/v1/documents/ingest`
|
||||
|
||||
Starts, cancels, or reruns ingestion for documents. Use this endpoint for documents in datasets configured with an ingestion pipeline.
|
||||
|
||||
#### Request
|
||||
|
||||
- Method: POST
|
||||
- URL: `/api/v1/documents/ingest`
|
||||
- Headers:
|
||||
- `'Content-Type: application/json'`
|
||||
- `'Authorization: Bearer <YOUR_API_KEY>'`
|
||||
- Body:
|
||||
- `"doc_ids"`: `list[string]`
|
||||
- `"run"`: `string`
|
||||
- `"delete"`: `boolean`
|
||||
|
||||
##### Request example
|
||||
|
||||
```bash
|
||||
curl --request POST \
|
||||
--url http://{address}/api/v1/documents/ingest \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--data '
|
||||
{
|
||||
"doc_ids": ["97a5f1c2759811efaa500242ac120004"],
|
||||
"run": "1",
|
||||
"delete": true
|
||||
}'
|
||||
```
|
||||
|
||||
##### Request parameters
|
||||
|
||||
- `"doc_ids"`: (*Body parameter*), `list[string]`, *Required*
|
||||
The IDs of the documents to ingest.
|
||||
- `"run"`: (*Body parameter*), `string`, *Required*
|
||||
The ingestion action. Use `"1"` to start ingestion and `"2"` to cancel ingestion.
|
||||
- `"delete"`: (*Body parameter*), `boolean`
|
||||
Whether to delete existing tasks and chunks before rerunning. Defaults to `false`.
|
||||
|
||||
#### Response
|
||||
|
||||
Success:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 0,
|
||||
"data": true
|
||||
}
|
||||
```
|
||||
|
||||
Failure:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 102,
|
||||
"message": "Document not found!"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Stop parsing documents
|
||||
|
||||
**DELETE** `/api/v1/datasets/{dataset_id}/chunks`
|
||||
|
||||
Reference in New Issue
Block a user