writinwaters
commited on
Commit
·
2343334
1
Parent(s):
a627cc4
Fixed a docusaurus display issue (#3120)
Browse files### What problem does this PR solve?
### Type of change
- [x] Documentation Update
docs/references/http_api_reference.md
CHANGED
@@ -27,7 +27,7 @@ Creates a dataset.
|
|
27 |
- URL: `/api/v1/datasets`
|
28 |
- Headers:
|
29 |
- `'content-Type: application/json'`
|
30 |
-
- `'Authorization: Bearer
|
31 |
- Body:
|
32 |
- `"name"`: `string`
|
33 |
- `"avatar"`: `string`
|
@@ -44,7 +44,7 @@ Creates a dataset.
|
|
44 |
curl --request POST \
|
45 |
--url http://{address}/api/v1/datasets \
|
46 |
--header 'Content-Type: application/json' \
|
47 |
-
--header 'Authorization: Bearer
|
48 |
--data '{
|
49 |
"name": "test_1"
|
50 |
}'
|
@@ -175,7 +175,7 @@ Deletes datasets by ID.
|
|
175 |
- URL: `/api/v1/datasets`
|
176 |
- Headers:
|
177 |
- `'content-Type: application/json'`
|
178 |
-
- `'Authorization: Bearer
|
179 |
- Body:
|
180 |
- `"ids"`: `list[string]`
|
181 |
|
@@ -185,7 +185,7 @@ Deletes datasets by ID.
|
|
185 |
curl --request DELETE \
|
186 |
--url http://{address}/api/v1/datasets \
|
187 |
--header 'Content-Type: application/json' \
|
188 |
-
--header 'Authorization: Bearer
|
189 |
--data '{"ids": ["test_1", "test_2"]}'
|
190 |
```
|
191 |
|
@@ -227,7 +227,7 @@ Updates configurations for a specified dataset.
|
|
227 |
- URL: `/api/v1/datasets/{dataset_id}`
|
228 |
- Headers:
|
229 |
- `'content-Type: application/json'`
|
230 |
-
- `'Authorization: Bearer
|
231 |
- Body:
|
232 |
- `"name"`: `string`
|
233 |
- `"embedding_model"`: `string`
|
@@ -239,7 +239,7 @@ Updates configurations for a specified dataset.
|
|
239 |
curl --request PUT \
|
240 |
--url http://{address}/api/v1/datasets/{dataset_id} \
|
241 |
--header 'Content-Type: application/json' \
|
242 |
-
--header 'Authorization: Bearer
|
243 |
--data '
|
244 |
{
|
245 |
"name": "updated_dataset",
|
@@ -301,14 +301,14 @@ Lists datasets.
|
|
301 |
- Method: GET
|
302 |
- URL: `/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}`
|
303 |
- Headers:
|
304 |
-
- `'Authorization: Bearer
|
305 |
|
306 |
#### Request example
|
307 |
|
308 |
```bash
|
309 |
curl --request GET \
|
310 |
--url http://{address}/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \
|
311 |
-
--header 'Authorization: Bearer
|
312 |
```
|
313 |
|
314 |
#### Request parameters
|
@@ -402,7 +402,7 @@ Uploads documents to a specified dataset.
|
|
402 |
- URL: `/api/v1/datasets/{dataset_id}/documents`
|
403 |
- Headers:
|
404 |
- `'Content-Type: multipart/form-data'`
|
405 |
-
- `'Authorization: Bearer
|
406 |
- Form:
|
407 |
- `'file=@{FILE_PATH}'`
|
408 |
|
@@ -412,7 +412,7 @@ Uploads documents to a specified dataset.
|
|
412 |
curl --request POST \
|
413 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents \
|
414 |
--header 'Content-Type: multipart/form-data' \
|
415 |
-
--header 'Authorization: Bearer
|
416 |
--form 'file=@./test1.txt' \
|
417 |
--form 'file=@./test2.pdf'
|
418 |
```
|
@@ -480,7 +480,7 @@ Updates configurations for a specified document.
|
|
480 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}`
|
481 |
- Headers:
|
482 |
- `'content-Type: application/json'`
|
483 |
-
- `'Authorization: Bearer
|
484 |
- Body:
|
485 |
- `"name"`:`string`
|
486 |
- `"chunk_method"`:`string`
|
@@ -491,7 +491,7 @@ Updates configurations for a specified document.
|
|
491 |
```bash
|
492 |
curl --request PUT \
|
493 |
--url http://{address}/api/v1/datasets/{dataset_id}/info/{document_id} \
|
494 |
-
--header 'Authorization: Bearer
|
495 |
--header 'Content-Type: application/json' \
|
496 |
--data '
|
497 |
{
|
@@ -572,7 +572,7 @@ Downloads a document from a specified dataset.
|
|
572 |
- Method: GET
|
573 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}`
|
574 |
- Headers:
|
575 |
-
- `'Authorization: Bearer
|
576 |
- Output:
|
577 |
- `'{PATH_TO_THE_FILE}'`
|
578 |
|
@@ -581,7 +581,7 @@ Downloads a document from a specified dataset.
|
|
581 |
```bash
|
582 |
curl --request GET \
|
583 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id} \
|
584 |
-
--header 'Authorization: Bearer
|
585 |
--output ./ragflow.txt
|
586 |
```
|
587 |
|
@@ -623,14 +623,14 @@ Lists documents in a specified dataset.
|
|
623 |
- URL: `/api/v1/datasets/{dataset_id}/documents?keywords={keyword}&page={page}&page_size={limit}&orderby={orderby}&desc={desc}&name={name}`
|
624 |
- Headers:
|
625 |
- `'content-Type: application/json'`
|
626 |
-
- `'Authorization: Bearer
|
627 |
|
628 |
#### Request example
|
629 |
|
630 |
```bash
|
631 |
curl --request GET \
|
632 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents?keywords={keywords}&offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&id={document_id} \
|
633 |
-
--header 'Authorization: Bearer
|
634 |
```
|
635 |
|
636 |
#### Request parameters
|
@@ -720,7 +720,7 @@ Deletes documents by ID.
|
|
720 |
- URL: `/api/v1/datasets/{dataset_id}/documents`
|
721 |
- Headers:
|
722 |
- `'Content-Type: application/json'`
|
723 |
-
- `'Authorization: Bearer
|
724 |
- Body:
|
725 |
- `"ids"`: `list[string]`
|
726 |
|
@@ -730,7 +730,7 @@ Deletes documents by ID.
|
|
730 |
curl --request DELETE \
|
731 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents \
|
732 |
--header 'Content-Type: application/json' \
|
733 |
-
--header 'Authorization:
|
734 |
--data '
|
735 |
{
|
736 |
"ids": ["id_1","id_2"]
|
@@ -777,7 +777,7 @@ Parses documents in a specified dataset.
|
|
777 |
- URL: `/api/v1/datasets/{dataset_id}/chunks`
|
778 |
- Headers:
|
779 |
- `'content-Type: application/json'`
|
780 |
-
- 'Authorization: Bearer
|
781 |
- Body:
|
782 |
- `"document_ids"`: `list[string]`
|
783 |
|
@@ -787,7 +787,7 @@ Parses documents in a specified dataset.
|
|
787 |
curl --request POST \
|
788 |
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \
|
789 |
--header 'Content-Type: application/json' \
|
790 |
-
--header 'Authorization: Bearer
|
791 |
--data '
|
792 |
{
|
793 |
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"]
|
@@ -834,7 +834,7 @@ Stops parsing specified documents.
|
|
834 |
- URL: `/api/v1/datasets/{dataset_id}/chunks`
|
835 |
- Headers:
|
836 |
- `'content-Type: application/json'`
|
837 |
-
- `'Authorization: Bearer
|
838 |
- Body:
|
839 |
- `"document_ids"`: `list[string]`
|
840 |
|
@@ -844,7 +844,7 @@ Stops parsing specified documents.
|
|
844 |
curl --request DELETE \
|
845 |
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \
|
846 |
--header 'Content-Type: application/json' \
|
847 |
-
--header 'Authorization: Bearer
|
848 |
--data '
|
849 |
{
|
850 |
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"]
|
@@ -891,7 +891,7 @@ Adds a chunk to a specified document in a specified dataset.
|
|
891 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks`
|
892 |
- Headers:
|
893 |
- `'content-Type: application/json'`
|
894 |
-
- `'Authorization: Bearer
|
895 |
- Body:
|
896 |
- `"content"`: `string`
|
897 |
- `"important_keywords"`: `list[string]`
|
@@ -902,7 +902,7 @@ Adds a chunk to a specified document in a specified dataset.
|
|
902 |
curl --request POST \
|
903 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \
|
904 |
--header 'Content-Type: application/json' \
|
905 |
-
--header 'Authorization: Bearer
|
906 |
--data '
|
907 |
{
|
908 |
"content": "<SOME_CHUNK_CONTENT_HERE>"
|
@@ -965,14 +965,14 @@ Lists chunks in a specified document.
|
|
965 |
- Method: GET
|
966 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id}`
|
967 |
- Headers:
|
968 |
-
- `'Authorization: Bearer
|
969 |
|
970 |
#### Request example
|
971 |
|
972 |
```bash
|
973 |
curl --request GET \
|
974 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id} \
|
975 |
-
--header 'Authorization: Bearer
|
976 |
```
|
977 |
|
978 |
#### Request parameters
|
@@ -1073,7 +1073,7 @@ Deletes chunks by ID.
|
|
1073 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks`
|
1074 |
- Headers:
|
1075 |
- `'content-Type: application/json'`
|
1076 |
-
- `'Authorization: Bearer
|
1077 |
- Body:
|
1078 |
- `"chunk_ids"`: `list[string]`
|
1079 |
|
@@ -1083,7 +1083,7 @@ Deletes chunks by ID.
|
|
1083 |
curl --request DELETE \
|
1084 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \
|
1085 |
--header 'Content-Type: application/json' \
|
1086 |
-
--header 'Authorization: Bearer
|
1087 |
--data '
|
1088 |
{
|
1089 |
"chunk_ids": ["test_1", "test_2"]
|
@@ -1132,7 +1132,7 @@ Updates content or configurations for a specified chunk.
|
|
1132 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}`
|
1133 |
- Headers:
|
1134 |
- `'content-Type: application/json'`
|
1135 |
-
- `'Authorization: Bearer
|
1136 |
- Body:
|
1137 |
- `"content"`: `string`
|
1138 |
- `"important_keywords"`: `string`
|
@@ -1144,7 +1144,7 @@ Updates content or configurations for a specified chunk.
|
|
1144 |
curl --request PUT \
|
1145 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id} \
|
1146 |
--header 'Content-Type: application/json' \
|
1147 |
-
--header 'Authorization:
|
1148 |
--data '
|
1149 |
{
|
1150 |
"content": "ragflow123",
|
@@ -1202,7 +1202,7 @@ Retrieves chunks from specified datasets.
|
|
1202 |
- URL: `/api/v1/retrieval`
|
1203 |
- Headers:
|
1204 |
- `'content-Type: application/json'`
|
1205 |
-
- `'Authorization: Bearer
|
1206 |
- Body:
|
1207 |
- `"question"`: `string`
|
1208 |
- `"dataset_ids"`: `list[string]`
|
@@ -1222,7 +1222,7 @@ Retrieves chunks from specified datasets.
|
|
1222 |
curl --request POST \
|
1223 |
--url http://{address}/api/v1/retrieval \
|
1224 |
--header 'Content-Type: application/json' \
|
1225 |
-
--header 'Authorization:
|
1226 |
--data '
|
1227 |
{
|
1228 |
"question": "What is advantage of ragflow?",
|
@@ -1330,7 +1330,7 @@ Creates a chat assistant.
|
|
1330 |
- URL: `/api/v1/chats`
|
1331 |
- Headers:
|
1332 |
- `'content-Type: application/json'`
|
1333 |
-
- `'Authorization: Bearer
|
1334 |
- Body:
|
1335 |
- `"name"`: `string`
|
1336 |
- `"avatar"`: `string`
|
@@ -1344,7 +1344,7 @@ Creates a chat assistant.
|
|
1344 |
curl --request POST \
|
1345 |
--url http://{address}/api/v1/chats \
|
1346 |
--header 'Content-Type: application/json' \
|
1347 |
-
--header 'Authorization: Bearer
|
1348 |
--data '{
|
1349 |
"dataset_ids": ["0b2cbc8c877f11ef89070242ac120005"],
|
1350 |
"name":"new_chat_1"
|
@@ -1466,7 +1466,7 @@ Updates configurations for a specified chat assistant.
|
|
1466 |
- URL: `/api/v1/chats/{chat_id}`
|
1467 |
- Headers:
|
1468 |
- `'content-Type: application/json'`
|
1469 |
-
- `'Authorization: Bearer
|
1470 |
- Body:
|
1471 |
- `"name"`: `string`
|
1472 |
- `"avatar"`: `string`
|
@@ -1480,7 +1480,7 @@ Updates configurations for a specified chat assistant.
|
|
1480 |
curl --request PUT \
|
1481 |
--url http://{address}/api/v1/chats/{chat_id} \
|
1482 |
--header 'Content-Type: application/json' \
|
1483 |
-
--header 'Authorization: Bearer
|
1484 |
--data '
|
1485 |
{
|
1486 |
"name":"Test"
|
@@ -1562,7 +1562,7 @@ Deletes chat assistants by ID.
|
|
1562 |
- URL: `/api/v1/chats`
|
1563 |
- Headers:
|
1564 |
- `'content-Type: application/json'`
|
1565 |
-
- `'Authorization: Bearer
|
1566 |
- Body:
|
1567 |
- `"ids"`: `list[string]`
|
1568 |
|
@@ -1572,7 +1572,7 @@ Deletes chat assistants by ID.
|
|
1572 |
curl --request DELETE \
|
1573 |
--url http://{address}/api/v1/chats \
|
1574 |
--header 'Content-Type: application/json' \
|
1575 |
-
--header 'Authorization: Bearer
|
1576 |
--data '
|
1577 |
{
|
1578 |
"ids": ["test_1", "test_2"]
|
@@ -1616,14 +1616,14 @@ Lists chat assistants.
|
|
1616 |
- Method: GET
|
1617 |
- URL: `/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}`
|
1618 |
- Headers:
|
1619 |
-
- `'Authorization: Bearer
|
1620 |
|
1621 |
#### Request example
|
1622 |
|
1623 |
```bash
|
1624 |
curl --request GET \
|
1625 |
--url http://{address}/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \
|
1626 |
-
--header 'Authorization: Bearer
|
1627 |
```
|
1628 |
|
1629 |
#### Request parameters
|
@@ -1716,7 +1716,7 @@ Creates a chat session.
|
|
1716 |
- URL: `/api/v1/chats/{chat_id}/sessions`
|
1717 |
- Headers:
|
1718 |
- `'content-Type: application/json'`
|
1719 |
-
- `'Authorization: Bearer
|
1720 |
- Body:
|
1721 |
- `"name"`: `string`
|
1722 |
|
@@ -1726,7 +1726,7 @@ Creates a chat session.
|
|
1726 |
curl --request POST \
|
1727 |
--url http://{address}/api/v1/chats/{chat_id}/sessions \
|
1728 |
--header 'Content-Type: application/json' \
|
1729 |
-
--header 'Authorization: Bearer
|
1730 |
--data '
|
1731 |
{
|
1732 |
"name": "new session"
|
@@ -1788,7 +1788,7 @@ Updates a chat session.
|
|
1788 |
- URL: `/api/v1/chats/{chat_id}/sessions/{session_id}`
|
1789 |
- Headers:
|
1790 |
- `'content-Type: application/json'`
|
1791 |
-
- `'Authorization: Bearer
|
1792 |
- Body:
|
1793 |
- `"name`: string
|
1794 |
|
@@ -1797,7 +1797,7 @@ Updates a chat session.
|
|
1797 |
curl --request PUT \
|
1798 |
--url http://{address}/api/v1/chats/{chat_id}/sessions/{session_id} \
|
1799 |
--header 'Content-Type: application/json' \
|
1800 |
-
--header 'Authorization: Bearer
|
1801 |
--data '
|
1802 |
{
|
1803 |
"name": "<REVISED_SESSION_NAME_HERE>"
|
@@ -1845,14 +1845,14 @@ Lists sessions associated with a specified chat assistant.
|
|
1845 |
- Method: GET
|
1846 |
- URL: `/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}`
|
1847 |
- Headers:
|
1848 |
-
- `'Authorization: Bearer
|
1849 |
|
1850 |
#### Request example
|
1851 |
|
1852 |
```bash
|
1853 |
curl --request GET \
|
1854 |
--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} \
|
1855 |
-
--header 'Authorization: Bearer
|
1856 |
```
|
1857 |
|
1858 |
#### Request Parameters
|
@@ -1924,7 +1924,7 @@ Deletes sessions by ID.
|
|
1924 |
- URL: `/api/v1/chats/{chat_id}/sessions`
|
1925 |
- Headers:
|
1926 |
- `'content-Type: application/json'`
|
1927 |
-
- `'Authorization: Bearer
|
1928 |
- Body:
|
1929 |
- `"ids"`: `list[string]`
|
1930 |
|
@@ -1935,7 +1935,7 @@ Deletes sessions by ID.
|
|
1935 |
curl --request DELETE \
|
1936 |
--url http://{address}/api/v1/chats/{chat_id}/sessions \
|
1937 |
--header 'Content-Type: application/json' \
|
1938 |
-
--header 'Authorization: Bear
|
1939 |
--data '
|
1940 |
{
|
1941 |
"ids": ["test_1", "test_2"]
|
@@ -1982,7 +1982,7 @@ Asks a question to start an AI-powered conversation.
|
|
1982 |
- URL: `/api/v1/chats/{chat_id}/completions`
|
1983 |
- Headers:
|
1984 |
- `'content-Type: application/json'`
|
1985 |
-
- `'Authorization: Bearer
|
1986 |
- Body:
|
1987 |
- `"question"`: `string`
|
1988 |
- `"stream"`: `boolean`
|
@@ -1994,7 +1994,7 @@ Asks a question to start an AI-powered conversation.
|
|
1994 |
curl --request POST \
|
1995 |
--url http://{address}/api/v1/chats/{chat_id}/completions \
|
1996 |
--header 'Content-Type: application/json' \
|
1997 |
-
--header 'Authorization: Bearer
|
1998 |
--data-binary '
|
1999 |
{
|
2000 |
"question": "What is RAGFlow?",
|
|
|
27 |
- URL: `/api/v1/datasets`
|
28 |
- Headers:
|
29 |
- `'content-Type: application/json'`
|
30 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
31 |
- Body:
|
32 |
- `"name"`: `string`
|
33 |
- `"avatar"`: `string`
|
|
|
44 |
curl --request POST \
|
45 |
--url http://{address}/api/v1/datasets \
|
46 |
--header 'Content-Type: application/json' \
|
47 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
48 |
--data '{
|
49 |
"name": "test_1"
|
50 |
}'
|
|
|
175 |
- URL: `/api/v1/datasets`
|
176 |
- Headers:
|
177 |
- `'content-Type: application/json'`
|
178 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
179 |
- Body:
|
180 |
- `"ids"`: `list[string]`
|
181 |
|
|
|
185 |
curl --request DELETE \
|
186 |
--url http://{address}/api/v1/datasets \
|
187 |
--header 'Content-Type: application/json' \
|
188 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
189 |
--data '{"ids": ["test_1", "test_2"]}'
|
190 |
```
|
191 |
|
|
|
227 |
- URL: `/api/v1/datasets/{dataset_id}`
|
228 |
- Headers:
|
229 |
- `'content-Type: application/json'`
|
230 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
231 |
- Body:
|
232 |
- `"name"`: `string`
|
233 |
- `"embedding_model"`: `string`
|
|
|
239 |
curl --request PUT \
|
240 |
--url http://{address}/api/v1/datasets/{dataset_id} \
|
241 |
--header 'Content-Type: application/json' \
|
242 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
243 |
--data '
|
244 |
{
|
245 |
"name": "updated_dataset",
|
|
|
301 |
- Method: GET
|
302 |
- URL: `/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}`
|
303 |
- Headers:
|
304 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
305 |
|
306 |
#### Request example
|
307 |
|
308 |
```bash
|
309 |
curl --request GET \
|
310 |
--url http://{address}/api/v1/datasets?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \
|
311 |
+
--header 'Authorization: Bearer <YOUR_API_KE>'
|
312 |
```
|
313 |
|
314 |
#### Request parameters
|
|
|
402 |
- URL: `/api/v1/datasets/{dataset_id}/documents`
|
403 |
- Headers:
|
404 |
- `'Content-Type: multipart/form-data'`
|
405 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
406 |
- Form:
|
407 |
- `'file=@{FILE_PATH}'`
|
408 |
|
|
|
412 |
curl --request POST \
|
413 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents \
|
414 |
--header 'Content-Type: multipart/form-data' \
|
415 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
416 |
--form 'file=@./test1.txt' \
|
417 |
--form 'file=@./test2.pdf'
|
418 |
```
|
|
|
480 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}`
|
481 |
- Headers:
|
482 |
- `'content-Type: application/json'`
|
483 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
484 |
- Body:
|
485 |
- `"name"`:`string`
|
486 |
- `"chunk_method"`:`string`
|
|
|
491 |
```bash
|
492 |
curl --request PUT \
|
493 |
--url http://{address}/api/v1/datasets/{dataset_id}/info/{document_id} \
|
494 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
495 |
--header 'Content-Type: application/json' \
|
496 |
--data '
|
497 |
{
|
|
|
572 |
- Method: GET
|
573 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}`
|
574 |
- Headers:
|
575 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
576 |
- Output:
|
577 |
- `'{PATH_TO_THE_FILE}'`
|
578 |
|
|
|
581 |
```bash
|
582 |
curl --request GET \
|
583 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id} \
|
584 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
585 |
--output ./ragflow.txt
|
586 |
```
|
587 |
|
|
|
623 |
- URL: `/api/v1/datasets/{dataset_id}/documents?keywords={keyword}&page={page}&page_size={limit}&orderby={orderby}&desc={desc}&name={name}`
|
624 |
- Headers:
|
625 |
- `'content-Type: application/json'`
|
626 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
627 |
|
628 |
#### Request example
|
629 |
|
630 |
```bash
|
631 |
curl --request GET \
|
632 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents?keywords={keywords}&offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&id={document_id} \
|
633 |
+
--header 'Authorization: Bearer <YOUR_API_KE>'
|
634 |
```
|
635 |
|
636 |
#### Request parameters
|
|
|
720 |
- URL: `/api/v1/datasets/{dataset_id}/documents`
|
721 |
- Headers:
|
722 |
- `'Content-Type: application/json'`
|
723 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
724 |
- Body:
|
725 |
- `"ids"`: `list[string]`
|
726 |
|
|
|
730 |
curl --request DELETE \
|
731 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents \
|
732 |
--header 'Content-Type: application/json' \
|
733 |
+
--header 'Authorization: <YOUR_API_KE>' \
|
734 |
--data '
|
735 |
{
|
736 |
"ids": ["id_1","id_2"]
|
|
|
777 |
- URL: `/api/v1/datasets/{dataset_id}/chunks`
|
778 |
- Headers:
|
779 |
- `'content-Type: application/json'`
|
780 |
+
- 'Authorization: Bearer <YOUR_API_KE>'
|
781 |
- Body:
|
782 |
- `"document_ids"`: `list[string]`
|
783 |
|
|
|
787 |
curl --request POST \
|
788 |
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \
|
789 |
--header 'Content-Type: application/json' \
|
790 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
791 |
--data '
|
792 |
{
|
793 |
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"]
|
|
|
834 |
- URL: `/api/v1/datasets/{dataset_id}/chunks`
|
835 |
- Headers:
|
836 |
- `'content-Type: application/json'`
|
837 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
838 |
- Body:
|
839 |
- `"document_ids"`: `list[string]`
|
840 |
|
|
|
844 |
curl --request DELETE \
|
845 |
--url http://{address}/api/v1/datasets/{dataset_id}/chunks \
|
846 |
--header 'Content-Type: application/json' \
|
847 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
848 |
--data '
|
849 |
{
|
850 |
"document_ids": ["97a5f1c2759811efaa500242ac120004","97ad64b6759811ef9fc30242ac120004"]
|
|
|
891 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks`
|
892 |
- Headers:
|
893 |
- `'content-Type: application/json'`
|
894 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
895 |
- Body:
|
896 |
- `"content"`: `string`
|
897 |
- `"important_keywords"`: `list[string]`
|
|
|
902 |
curl --request POST \
|
903 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \
|
904 |
--header 'Content-Type: application/json' \
|
905 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
906 |
--data '
|
907 |
{
|
908 |
"content": "<SOME_CHUNK_CONTENT_HERE>"
|
|
|
965 |
- Method: GET
|
966 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id}`
|
967 |
- Headers:
|
968 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
969 |
|
970 |
#### Request example
|
971 |
|
972 |
```bash
|
973 |
curl --request GET \
|
974 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&offset={offset}&limit={limit}&id={chunk_id} \
|
975 |
+
--header 'Authorization: Bearer <YOUR_API_KE>'
|
976 |
```
|
977 |
|
978 |
#### Request parameters
|
|
|
1073 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks`
|
1074 |
- Headers:
|
1075 |
- `'content-Type: application/json'`
|
1076 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1077 |
- Body:
|
1078 |
- `"chunk_ids"`: `list[string]`
|
1079 |
|
|
|
1083 |
curl --request DELETE \
|
1084 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks \
|
1085 |
--header 'Content-Type: application/json' \
|
1086 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
1087 |
--data '
|
1088 |
{
|
1089 |
"chunk_ids": ["test_1", "test_2"]
|
|
|
1132 |
- URL: `/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}`
|
1133 |
- Headers:
|
1134 |
- `'content-Type: application/json'`
|
1135 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1136 |
- Body:
|
1137 |
- `"content"`: `string`
|
1138 |
- `"important_keywords"`: `string`
|
|
|
1144 |
curl --request PUT \
|
1145 |
--url http://{address}/api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id} \
|
1146 |
--header 'Content-Type: application/json' \
|
1147 |
+
--header 'Authorization: <YOUR_API_KE>' \
|
1148 |
--data '
|
1149 |
{
|
1150 |
"content": "ragflow123",
|
|
|
1202 |
- URL: `/api/v1/retrieval`
|
1203 |
- Headers:
|
1204 |
- `'content-Type: application/json'`
|
1205 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1206 |
- Body:
|
1207 |
- `"question"`: `string`
|
1208 |
- `"dataset_ids"`: `list[string]`
|
|
|
1222 |
curl --request POST \
|
1223 |
--url http://{address}/api/v1/retrieval \
|
1224 |
--header 'Content-Type: application/json' \
|
1225 |
+
--header 'Authorization: <YOUR_API_KE>' \
|
1226 |
--data '
|
1227 |
{
|
1228 |
"question": "What is advantage of ragflow?",
|
|
|
1330 |
- URL: `/api/v1/chats`
|
1331 |
- Headers:
|
1332 |
- `'content-Type: application/json'`
|
1333 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1334 |
- Body:
|
1335 |
- `"name"`: `string`
|
1336 |
- `"avatar"`: `string`
|
|
|
1344 |
curl --request POST \
|
1345 |
--url http://{address}/api/v1/chats \
|
1346 |
--header 'Content-Type: application/json' \
|
1347 |
+
--header 'Authorization: Bearer <YOUR_API_KE>'
|
1348 |
--data '{
|
1349 |
"dataset_ids": ["0b2cbc8c877f11ef89070242ac120005"],
|
1350 |
"name":"new_chat_1"
|
|
|
1466 |
- URL: `/api/v1/chats/{chat_id}`
|
1467 |
- Headers:
|
1468 |
- `'content-Type: application/json'`
|
1469 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1470 |
- Body:
|
1471 |
- `"name"`: `string`
|
1472 |
- `"avatar"`: `string`
|
|
|
1480 |
curl --request PUT \
|
1481 |
--url http://{address}/api/v1/chats/{chat_id} \
|
1482 |
--header 'Content-Type: application/json' \
|
1483 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
1484 |
--data '
|
1485 |
{
|
1486 |
"name":"Test"
|
|
|
1562 |
- URL: `/api/v1/chats`
|
1563 |
- Headers:
|
1564 |
- `'content-Type: application/json'`
|
1565 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1566 |
- Body:
|
1567 |
- `"ids"`: `list[string]`
|
1568 |
|
|
|
1572 |
curl --request DELETE \
|
1573 |
--url http://{address}/api/v1/chats \
|
1574 |
--header 'Content-Type: application/json' \
|
1575 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
1576 |
--data '
|
1577 |
{
|
1578 |
"ids": ["test_1", "test_2"]
|
|
|
1616 |
- Method: GET
|
1617 |
- URL: `/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id}`
|
1618 |
- Headers:
|
1619 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1620 |
|
1621 |
#### Request example
|
1622 |
|
1623 |
```bash
|
1624 |
curl --request GET \
|
1625 |
--url http://{address}/api/v1/chats?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={dataset_name}&id={dataset_id} \
|
1626 |
+
--header 'Authorization: Bearer <YOUR_API_KE>'
|
1627 |
```
|
1628 |
|
1629 |
#### Request parameters
|
|
|
1716 |
- URL: `/api/v1/chats/{chat_id}/sessions`
|
1717 |
- Headers:
|
1718 |
- `'content-Type: application/json'`
|
1719 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1720 |
- Body:
|
1721 |
- `"name"`: `string`
|
1722 |
|
|
|
1726 |
curl --request POST \
|
1727 |
--url http://{address}/api/v1/chats/{chat_id}/sessions \
|
1728 |
--header 'Content-Type: application/json' \
|
1729 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
1730 |
--data '
|
1731 |
{
|
1732 |
"name": "new session"
|
|
|
1788 |
- URL: `/api/v1/chats/{chat_id}/sessions/{session_id}`
|
1789 |
- Headers:
|
1790 |
- `'content-Type: application/json'`
|
1791 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1792 |
- Body:
|
1793 |
- `"name`: string
|
1794 |
|
|
|
1797 |
curl --request PUT \
|
1798 |
--url http://{address}/api/v1/chats/{chat_id}/sessions/{session_id} \
|
1799 |
--header 'Content-Type: application/json' \
|
1800 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
1801 |
--data '
|
1802 |
{
|
1803 |
"name": "<REVISED_SESSION_NAME_HERE>"
|
|
|
1845 |
- Method: GET
|
1846 |
- URL: `/api/v1/chats/{chat_id}/sessions?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={session_name}&id={session_id}`
|
1847 |
- Headers:
|
1848 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1849 |
|
1850 |
#### Request example
|
1851 |
|
1852 |
```bash
|
1853 |
curl --request GET \
|
1854 |
--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} \
|
1855 |
+
--header 'Authorization: Bearer <YOUR_API_KE>'
|
1856 |
```
|
1857 |
|
1858 |
#### Request Parameters
|
|
|
1924 |
- URL: `/api/v1/chats/{chat_id}/sessions`
|
1925 |
- Headers:
|
1926 |
- `'content-Type: application/json'`
|
1927 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1928 |
- Body:
|
1929 |
- `"ids"`: `list[string]`
|
1930 |
|
|
|
1935 |
curl --request DELETE \
|
1936 |
--url http://{address}/api/v1/chats/{chat_id}/sessions \
|
1937 |
--header 'Content-Type: application/json' \
|
1938 |
+
--header 'Authorization: Bear <YOUR_API_KE>' \
|
1939 |
--data '
|
1940 |
{
|
1941 |
"ids": ["test_1", "test_2"]
|
|
|
1982 |
- URL: `/api/v1/chats/{chat_id}/completions`
|
1983 |
- Headers:
|
1984 |
- `'content-Type: application/json'`
|
1985 |
+
- `'Authorization: Bearer <YOUR_API_KE>'`
|
1986 |
- Body:
|
1987 |
- `"question"`: `string`
|
1988 |
- `"stream"`: `boolean`
|
|
|
1994 |
curl --request POST \
|
1995 |
--url http://{address}/api/v1/chats/{chat_id}/completions \
|
1996 |
--header 'Content-Type: application/json' \
|
1997 |
+
--header 'Authorization: Bearer <YOUR_API_KE>' \
|
1998 |
--data-binary '
|
1999 |
{
|
2000 |
"question": "What is RAGFlow?",
|
docs/references/python_api_reference.md
CHANGED
@@ -961,10 +961,7 @@ Instructions for the LLM to follow. A `Prompt` object contains the following at
|
|
961 |
- `empty_response`: `str` If nothing is retrieved in the dataset for the user's question, this will be used as the response. To allow the LLM to improvise when nothing is found, leave this blank. Defaults to `None`.
|
962 |
- `opener`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
|
963 |
- `show_quote`: `bool` Indicates whether the source of text should be displayed. Defaults to `True`.
|
964 |
-
- `prompt`: `str` The prompt content.
|
965 |
-
Here is the knowledge base:
|
966 |
-
{knowledge}
|
967 |
-
The above is the knowledge base.`
|
968 |
|
969 |
### Returns
|
970 |
|
@@ -1022,10 +1019,7 @@ A dictionary representing the attributes to update, with the following keys:
|
|
1022 |
- `"empty_response"`: `str` If nothing is retrieved in the dataset for the user's question, this will be used as the response. To allow the LLM to improvise when nothing is retrieved, leave this blank. Defaults to `None`.
|
1023 |
- `"opener"`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
|
1024 |
- `"show_quote`: `bool` Indicates whether the source of text should be displayed Defaults to `True`.
|
1025 |
-
- `"prompt"`: `str` The prompt content.
|
1026 |
-
Here is the knowledge base:
|
1027 |
-
{knowledge}
|
1028 |
-
The above is the knowledge base.`.
|
1029 |
|
1030 |
### Returns
|
1031 |
|
|
|
961 |
- `empty_response`: `str` If nothing is retrieved in the dataset for the user's question, this will be used as the response. To allow the LLM to improvise when nothing is found, leave this blank. Defaults to `None`.
|
962 |
- `opener`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
|
963 |
- `show_quote`: `bool` Indicates whether the source of text should be displayed. Defaults to `True`.
|
964 |
+
- `prompt`: `str` The prompt content.
|
|
|
|
|
|
|
965 |
|
966 |
### Returns
|
967 |
|
|
|
1019 |
- `"empty_response"`: `str` If nothing is retrieved in the dataset for the user's question, this will be used as the response. To allow the LLM to improvise when nothing is retrieved, leave this blank. Defaults to `None`.
|
1020 |
- `"opener"`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
|
1021 |
- `"show_quote`: `bool` Indicates whether the source of text should be displayed Defaults to `True`.
|
1022 |
+
- `"prompt"`: `str` The prompt content.
|
|
|
|
|
|
|
1023 |
|
1024 |
### Returns
|
1025 |
|