|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets` |
|
|
- URL: `/api/v1/datasets` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
- `'Authorization: Bearer <YOUR_API_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"name"`: `string` |
|
|
- `"name"`: `string` |
|
|
- `"avatar"`: `string` |
|
|
- `"avatar"`: `string` |
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/datasets \ |
|
|
--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_KE>' \ |
|
|
--data '{ |
|
|
--data '{ |
|
|
"name": "test_1" |
|
|
"name": "test_1" |
|
|
}' |
|
|
}' |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets` |
|
|
- URL: `/api/v1/datasets` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
- `'Authorization: Bearer <YOUR_API_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"ids"`: `list[string]` |
|
|
- `"ids"`: `list[string]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/datasets \ |
|
|
--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_KE>' \ |
|
|
--data '{"ids": ["test_1", "test_2"]}' |
|
|
--data '{"ids": ["test_1", "test_2"]}' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"name"`: `string` |
|
|
- `"name"`: `string` |
|
|
- `"embedding_model"`: `string` |
|
|
- `"embedding_model"`: `string` |
|
|
|
|
|
|
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/datasets/{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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"name": "updated_dataset", |
|
|
"name": "updated_dataset", |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/datasets?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_KE>'` |
|
|
|
|
|
|
|
|
#### Request example |
|
|
#### Request example |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/datasets?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_KE>' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
#### Request parameters |
|
|
#### Request parameters |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents` |
|
|
- 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_KE>'` |
|
|
- Form: |
|
|
- Form: |
|
|
- `'file=@{FILE_PATH}'` |
|
|
- `'file=@{FILE_PATH}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents \ |
|
|
--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_KE>' \ |
|
|
--form 'file=@./test1.txt' \ |
|
|
--form 'file=@./test1.txt' \ |
|
|
--form 'file=@./test2.pdf' |
|
|
--form 'file=@./test2.pdf' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"name"`:`string` |
|
|
- `"name"`:`string` |
|
|
- `"chunk_method"`:`string` |
|
|
- `"chunk_method"`:`string` |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/datasets/{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_KE>' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}` |
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
- `'Authorization: Bearer <YOUR_API_KE>'` |
|
|
- Output: |
|
|
- Output: |
|
|
- `'{PATH_TO_THE_FILE}'` |
|
|
- `'{PATH_TO_THE_FILE}'` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id} \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id} \ |
|
|
--header 'Authorization: Bearer {YOUR_API_KEY}' \ |
|
|
|
|
|
|
|
|
--header 'Authorization: Bearer <YOUR_API_KE>' \ |
|
|
--output ./ragflow.txt |
|
|
--output ./ragflow.txt |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents?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_KE>'` |
|
|
|
|
|
|
|
|
#### Request example |
|
|
#### Request example |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents?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_KE>' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
#### Request parameters |
|
|
#### Request parameters |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents` |
|
|
- 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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"ids"`: `list[string]` |
|
|
- `"ids"`: `list[string]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"ids": ["id_1","id_2"] |
|
|
"ids": ["id_1","id_2"] |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/chunks` |
|
|
- 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_KE>' |
|
|
- Body: |
|
|
- Body: |
|
|
- `"document_ids"`: `list[string]` |
|
|
- `"document_ids"`: `list[string]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"] |
|
|
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"] |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/chunks` |
|
|
- 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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"document_ids"`: `list[string]` |
|
|
- `"document_ids"`: `list[string]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"] |
|
|
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"] |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` |
|
|
- 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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"content"`: `string` |
|
|
- `"content"`: `string` |
|
|
- `"important_keywords"`: `list[string]` |
|
|
- `"important_keywords"`: `list[string]` |
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"content": "<SOME_CHUNK_CONTENT_HERE>" |
|
|
"content": "<SOME_CHUNK_CONTENT_HERE>" |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?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_KE>'` |
|
|
|
|
|
|
|
|
#### Request example |
|
|
#### Request example |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?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_KE>' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
#### Request parameters |
|
|
#### Request parameters |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks` |
|
|
- 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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"chunk_ids"`: `list[string]` |
|
|
- `"chunk_ids"`: `list[string]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"chunk_ids": ["test_1", "test_2"] |
|
|
"chunk_ids": ["test_1", "test_2"] |
|
|
|
|
|
|
|
|
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"content"`: `string` |
|
|
- `"content"`: `string` |
|
|
- `"important_keywords"`: `string` |
|
|
- `"important_keywords"`: `string` |
|
|
|
|
|
|
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"content": "ragflow123", |
|
|
"content": "ragflow123", |
|
|
|
|
|
|
|
|
- URL: `/api/v1/retrieval` |
|
|
- URL: `/api/v1/retrieval` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
- `'Authorization: Bearer <YOUR_API_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"question"`: `string` |
|
|
- `"question"`: `string` |
|
|
- `"dataset_ids"`: `list[string]` |
|
|
- `"dataset_ids"`: `list[string]` |
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/retrieval \ |
|
|
--url http://{address}/api/v1/retrieval \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Content-Type: application/json' \ |
|
|
--header 'Authorization: {YOUR_API_KEY}' \ |
|
|
|
|
|
|
|
|
--header 'Authorization: <YOUR_API_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"question": "What is advantage of ragflow?", |
|
|
"question": "What is advantage of ragflow?", |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats` |
|
|
- URL: `/api/v1/chats` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
- `'Authorization: Bearer <YOUR_API_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"name"`: `string` |
|
|
- `"name"`: `string` |
|
|
- `"avatar"`: `string` |
|
|
- `"avatar"`: `string` |
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/chats \ |
|
|
--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_KE>' |
|
|
--data '{ |
|
|
--data '{ |
|
|
"dataset_ids": ["0b2cbc8c877f11ef89070242ac120005"], |
|
|
"dataset_ids": ["0b2cbc8c877f11ef89070242ac120005"], |
|
|
"name":"new_chat_1" |
|
|
"name":"new_chat_1" |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"name"`: `string` |
|
|
- `"name"`: `string` |
|
|
- `"avatar"`: `string` |
|
|
- `"avatar"`: `string` |
|
|
|
|
|
|
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/chats/{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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"name":"Test" |
|
|
"name":"Test" |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats` |
|
|
- URL: `/api/v1/chats` |
|
|
- Headers: |
|
|
- Headers: |
|
|
- `'content-Type: application/json'` |
|
|
- `'content-Type: application/json'` |
|
|
- `'Authorization: Bearer {YOUR_API_KEY}'` |
|
|
|
|
|
|
|
|
- `'Authorization: Bearer <YOUR_API_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"ids"`: `list[string]` |
|
|
- `"ids"`: `list[string]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/chats \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"ids": ["test_1", "test_2"] |
|
|
"ids": ["test_1", "test_2"] |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/chats?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_KE>'` |
|
|
|
|
|
|
|
|
#### Request example |
|
|
#### Request example |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--url http://{address}/api/v1/chats?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_KE>' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
#### Request parameters |
|
|
#### Request parameters |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/sessions` |
|
|
- 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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"name"`: `string` |
|
|
- `"name"`: `string` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/chats/{chat_id}/sessions \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"name": "new session" |
|
|
"name": "new session" |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/sessions/{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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"name`: string |
|
|
- `"name`: string |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request PUT \ |
|
|
curl --request PUT \ |
|
|
--url http://{address}/api/v1/chats/{chat_id}/sessions/{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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"name": "<REVISED_SESSION_NAME_HERE>" |
|
|
"name": "<REVISED_SESSION_NAME_HERE>" |
|
|
|
|
|
|
|
|
- Method: GET |
|
|
- Method: GET |
|
|
- URL: `/api/v1/chats/{chat_id}/sessions?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_KE>'` |
|
|
|
|
|
|
|
|
#### Request example |
|
|
#### Request example |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
curl --request GET \ |
|
|
curl --request GET \ |
|
|
--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} \ |
|
|
--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_KE>' |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
#### Request Parameters |
|
|
#### Request Parameters |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/sessions` |
|
|
- 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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"ids"`: `list[string]` |
|
|
- `"ids"`: `list[string]` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl --request DELETE \ |
|
|
curl --request DELETE \ |
|
|
--url http://{address}/api/v1/chats/{chat_id}/sessions \ |
|
|
--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_KE>' \ |
|
|
--data ' |
|
|
--data ' |
|
|
{ |
|
|
{ |
|
|
"ids": ["test_1", "test_2"] |
|
|
"ids": ["test_1", "test_2"] |
|
|
|
|
|
|
|
|
- URL: `/api/v1/chats/{chat_id}/completions` |
|
|
- 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_KE>'` |
|
|
- Body: |
|
|
- Body: |
|
|
- `"question"`: `string` |
|
|
- `"question"`: `string` |
|
|
- `"stream"`: `boolean` |
|
|
- `"stream"`: `boolean` |
|
|
|
|
|
|
|
|
curl --request POST \ |
|
|
curl --request POST \ |
|
|
--url http://{address}/api/v1/chats/{chat_id}/completions \ |
|
|
--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_KE>' \ |
|
|
--data-binary ' |
|
|
--data-binary ' |
|
|
{ |
|
|
{ |
|
|
"question": "What is RAGFlow?", |
|
|
"question": "What is RAGFlow?", |