|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Create dataset |
|
|
## Create dataset |
|
|
|
|
|
|
|
|
**POST** `/api/v1/dataset` |
|
|
|
|
|
|
|
|
**POST** `/api/v1/datasets` |
|
|
|
|
|
|
|
|
Creates a dataset. |
|
|
Creates a dataset. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/dataset` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/dataset \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data '{ |
|
|
--data '{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Delete datasets |
|
|
## Delete datasets |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/dataset` |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/datasets` |
|
|
|
|
|
|
|
|
Deletes datasets by ID. |
|
|
Deletes datasets by ID. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: DELETE |
|
|
- Method: DELETE |
|
|
- URL: `/api/v1/dataset` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/dataset \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data '{"ids": ["test_1", "test_2"]}' |
|
|
--data '{"ids": ["test_1", "test_2"]}' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Update dataset |
|
|
## Update dataset |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/dataset/{dataset_id}` |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/datasets/{dataset_id}` |
|
|
|
|
|
|
|
|
Updates configurations for a specified dataset. |
|
|
Updates configurations for a specified dataset. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: PUT |
|
|
- Method: PUT |
|
|
- URL: `/api/v1/dataset/{dataset_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id} \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## List datasets |
|
|
## List datasets |
|
|
|
|
|
|
|
|
**GET** `/api/v1/dataset?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` |
|
|
|
|
|
|
|
|
**GET** `/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` |
|
|
|
|
|
|
|
|
Lists datasets. |
|
|
Lists datasets. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/dataset?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/dataset?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Upload documents |
|
|
## Upload documents |
|
|
|
|
|
|
|
|
**POST** `/api/v1/dataset/{dataset_id}/document` |
|
|
|
|
|
|
|
|
**POST** `/api/v1/datasets/{dataset_id}/documents` |
|
|
|
|
|
|
|
|
Uploads documents to a specified dataset. |
|
|
Uploads documents to a specified dataset. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Content-Type: multipart/form-data'` |
|
|
- `'Content-Type: multipart/form-data'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/document \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents \ |
|
|
--header 'Content-Type: multipart/form-data' \ |
|
|
--header 'Content-Type: multipart/form-data' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--form 'file=@./test1.txt' \ |
|
|
--form 'file=@./test1.txt' \ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Update document |
|
|
## Update document |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/dataset/{dataset_id}/info/{document_id}` |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/datasets/{dataset_id}/documents/{document_id}` |
|
|
|
|
|
|
|
|
Updates configurations for a specified document. |
|
|
Updates configurations for a specified document. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: PUT |
|
|
- Method: PUT |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document/{document_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/info/{document_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/info/{document_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Download document |
|
|
## Download document |
|
|
|
|
|
|
|
|
**GET** `/api/v1/dataset/{dataset_id}/document/{document_id}` |
|
|
|
|
|
|
|
|
**GET** `/api/v1/datasets/{dataset_id}/documents/{document_id}` |
|
|
|
|
|
|
|
|
Downloads a document from a specified dataset. |
|
|
Downloads a document from a specified dataset. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document/{document_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- Output: |
|
|
- Output: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/document/{document_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--output ./ragflow.txt |
|
|
--output ./ragflow.txt |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## List documents |
|
|
## List documents |
|
|
|
|
|
|
|
|
**GET** `/api/v1/dataset/{dataset_id}/info?offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&keywords={keywords}&id={document_id}` |
|
|
|
|
|
|
|
|
**GET** `/api/v1/datasets/{dataset_id}/documents?offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&keywords={keywords}&id={document_id}` |
|
|
|
|
|
|
|
|
Lists documents in a specified dataset. |
|
|
Lists documents in a specified dataset. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/dataset/{dataset_id}/info?keywords={keyword}&page={page}&page_size={limit}&orderby={orderby}&desc={desc}&name={name}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents?keywords={keyword}&page={page}&page_size={limit}&orderby={orderby}&desc={desc}&name={name}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/info?keywords={keywords}&offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&id={document_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents?keywords={keywords}&offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&id={document_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Delete documents |
|
|
## Delete documents |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/dataset/{dataset_id}/document` |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/datasets/{dataset_id}/documents` |
|
|
|
|
|
|
|
|
Deletes documents by ID. |
|
|
Deletes documents by ID. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: DELETE |
|
|
- Method: DELETE |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Content-Type: application/json'` |
|
|
- `'Content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/document \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Parse documents |
|
|
## Parse documents |
|
|
|
|
|
|
|
|
**POST** `/api/v1/dataset/{dataset_id}/chunk` |
|
|
|
|
|
|
|
|
**POST** `/api/v1/datasets/{dataset_id}/chunks` |
|
|
|
|
|
|
|
|
Parses documents in a specified dataset. |
|
|
Parses documents in a specified dataset. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/dataset/{dataset_id}/chunk` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/chunks` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
- 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/chunk \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Stop parsing documents |
|
|
## Stop parsing documents |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/dataset/{dataset_id}/chunk` |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/datasets/{dataset_id}/chunks` |
|
|
|
|
|
|
|
|
Stops parsing specified documents. |
|
|
Stops parsing specified documents. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: DELETE |
|
|
- Method: DELETE |
|
|
- URL: `/api/v1/dataset/{dataset_id}/chunk` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/chunks` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/chunk \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Add chunks |
|
|
## Add chunks |
|
|
|
|
|
|
|
|
**POST** `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk` |
|
|
|
|
|
|
|
|
**POST** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` |
|
|
|
|
|
|
|
|
Adds a chunk to a specified document in a specified dataset. |
|
|
Adds a chunk to a specified document in a specified dataset. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/document/{document_id}/chunk \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## List chunks |
|
|
## List chunks |
|
|
|
|
|
|
|
|
**GET** `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk?keywords={keywords}&offset={offset}&limit={limit}&id={id}` |
|
|
|
|
|
|
|
|
**GET** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={id}` |
|
|
|
|
|
|
|
|
Lists chunks in a specified document. |
|
|
Lists chunks in a specified document. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/document/{document_id}/chunk?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Delete chunks |
|
|
## Delete chunks |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk` |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` |
|
|
|
|
|
|
|
|
Deletes chunks by ID. |
|
|
Deletes chunks by ID. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: DELETE |
|
|
- Method: DELETE |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/document/{document_id}/chunk \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Update chunk |
|
|
## Update chunk |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk/{chunk_id}` |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` |
|
|
|
|
|
|
|
|
Updates content or configurations for a specified chunk. |
|
|
Updates content or configurations for a specified chunk. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: PUT |
|
|
- Method: PUT |
|
|
- URL: `/api/v1/dataset/{dataset_id}/document/{document_id}/chunk/{chunk_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/dataset/{dataset_id}/document/{document_id}/chunk/{chunk_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id} \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Retrieve chunks |
|
|
## Retrieve chunks |
|
|
|
|
|
|
|
|
**GET** `/api/v1/retrieval` |
|
|
|
|
|
|
|
|
**GET** `/api/v1/retrievals` |
|
|
|
|
|
|
|
|
Retrieves chunks from specified datasets. |
|
|
Retrieves chunks from specified datasets. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/retrieval` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/retrievals` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/retrieval \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/retrievals \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
- `"similarity_threshold"`: (*Body parameter*) |
|
|
- `"similarity_threshold"`: (*Body parameter*) |
|
|
The minimum similarity score. Defaults to `0.2`. |
|
|
The minimum similarity score. Defaults to `0.2`. |
|
|
- `"vector_similarity_weight"`: (*Body parameter*), `float` |
|
|
- `"vector_similarity_weight"`: (*Body parameter*), `float` |
|
|
The weight of vector cosine similarity. Defaults to `0.3`. If x represents the vector cosine similarity, then (1 - x) is the term similarity weight. |
|
|
|
|
|
|
|
|
The weight of vector cosine similarity. Defaults to `0.3`. If x represents the weight of vector cosine similarity, then (1 - x) is the term similarity weight. |
|
|
- `"top_k"`: (*Body parameter*), `integer` |
|
|
- `"top_k"`: (*Body parameter*), `integer` |
|
|
The number of chunks engaged in vector cosine computaton. Defaults to `1024`. |
|
|
The number of chunks engaged in vector cosine computaton. Defaults to `1024`. |
|
|
- `"rerank_id"`: (*Body parameter*), `integer` |
|
|
- `"rerank_id"`: (*Body parameter*), `integer` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Create chat assistant |
|
|
## Create chat assistant |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chat` |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chats` |
|
|
|
|
|
|
|
|
Creates a chat assistant. |
|
|
Creates a chat assistant. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/chat` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```shell |
|
|
```shell |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/chat \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
--data '{ |
|
|
--data '{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Update chat assistant |
|
|
## Update chat assistant |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/chat/{chat_id}` |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/chats/{chat_id}` |
|
|
|
|
|
|
|
|
Updates configurations for a specified chat assistant. |
|
|
Updates configurations for a specified chat assistant. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: PUT |
|
|
- Method: PUT |
|
|
- URL: `/api/v1/chat/{chat_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/chat/{chat_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats/{chat_id} \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Delete chat assistants |
|
|
## Delete chat assistants |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/chat` |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/chats` |
|
|
|
|
|
|
|
|
Deletes chat assistants by ID. |
|
|
Deletes chat assistants by ID. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: DELETE |
|
|
- Method: DELETE |
|
|
- URL: `/api/v1/chat` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/chat \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## List chat assistants |
|
|
## List chat assistants |
|
|
|
|
|
|
|
|
**GET** `/api/v1/chat?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={chat_name}&id={chat_id}` |
|
|
|
|
|
|
|
|
**GET** `/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={chat_name}&id={chat_id}` |
|
|
|
|
|
|
|
|
Lists chat assistants. |
|
|
Lists chat assistants. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/chat?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/chat?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Create session |
|
|
## Create session |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chat/{chat_id}/session` |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chats/{chat_id}/sessions` |
|
|
|
|
|
|
|
|
Creates a chat session. |
|
|
Creates a chat session. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/chat/{chat_id}/session` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/sessions` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/chat/{chat_id}/session \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats/{chat_id}/sessions \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Update session |
|
|
## Update session |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/chat/{chat_id}/session/{session_id}` |
|
|
|
|
|
|
|
|
**PUT** `/api/v1/chats/{chat_id}/sessions/{session_id}` |
|
|
|
|
|
|
|
|
Updates a chat session. |
|
|
Updates a chat session. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: PUT |
|
|
- Method: PUT |
|
|
- URL: `/api/v1/chat/{chat_id}/session/{session_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/sessions/{session_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
#### Request example |
|
|
#### Request example |
|
|
```bash |
|
|
```bash |
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/chat/{chat_id}/session/{session_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats/{chat_id}/sessions/{session_id} \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## List sessions |
|
|
## List sessions |
|
|
|
|
|
|
|
|
**GET** `/api/v1/chat/{chat_id}/session?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}` |
|
|
|
|
|
|
|
|
**GET** `/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}` |
|
|
|
|
|
|
|
|
Lists sessions associated with a specified chat assistant. |
|
|
Lists sessions associated with a specified chat assistant. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/chat/{chat_id}/session?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/chat/{chat_id}/session?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id} \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Delete sessions |
|
|
## Delete sessions |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/chat/{chat_id}/session` |
|
|
|
|
|
|
|
|
**DELETE** `/api/v1/chats/{chat_id}/sessions` |
|
|
|
|
|
|
|
|
Deletes sessions by ID. |
|
|
Deletes sessions by ID. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: DELETE |
|
|
- Method: DELETE |
|
|
- URL: `/api/v1/chat/{chat_id}/session` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/sessions` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
# Either id or name must be provided, but not both. |
|
|
# Either id or name must be provided, but not both. |
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/chat/{chat_id}/session \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats/{chat_id}/sessions \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bear {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bear {YOUR_API_KEY}' \ |
|
|
--data ' |
|
|
--data ' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Converse |
|
|
## Converse |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chat/{chat_id}/completion` |
|
|
|
|
|
|
|
|
**POST** `/api/v1/chats/{chat_id}/completions` |
|
|
|
|
|
|
|
|
Asks a question to start an AI-powered conversation. |
|
|
Asks a question to start an AI-powered conversation. |
|
|
|
|
|
|
|
|
### Request |
|
|
### Request |
|
|
|
|
|
|
|
|
- Method: POST |
|
|
- Method: POST |
|
|
- URL: `/api/v1/chat/{chat_id}/completion` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/completions` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address} /api/v1/chat/{chat_id}/completion \ |
|
|
|
|
|
|
|
|
--url http://{address}/api/v1/chats/{chat_id}/completions \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
--data-binary ' |
|
|
--data-binary ' |