writinwaters commited on
Commit
7af2206
·
1 Parent(s): 2885106

DRAFT: miscellaneous updates to HTTP API Reference (#3005)

Browse files

### What problem does this PR solve?



### Type of change

- [x] Documentation Update

api/http_api_reference.md CHANGED
@@ -61,10 +61,10 @@ curl --request POST \
61
  - Case-insensitive.
62
 
63
  - `"avatar"`: (*Body parameter*), `string`
64
- Base64 encoding of the avatar. Defaults to `""`.
65
 
66
  - `"description"`: (*Body parameter*), `string`
67
- A brief description of the dataset to create. Defaults to `""`.
68
 
69
  - `"language"`: (*Body parameter*), `string`
70
  The language setting of the dataset to create. Available options:
@@ -178,8 +178,8 @@ curl --request DELETE \
178
 
179
  #### Request parameters
180
 
181
- - `"ids"`: (*Body parameter*), `list[string]`, *Required*
182
- The IDs of the datasets to delete.
183
 
184
  ### Response
185
 
@@ -407,10 +407,10 @@ curl --request POST \
407
 
408
  #### Request parameters
409
 
410
- - `"dataset_id"`: (*Path parameter*)
411
  The ID of the dataset to which the documents will be uploaded.
412
- - `"file"`: (*Body parameter*)
413
- The document to upload.
414
 
415
  ### Response
416
 
@@ -469,6 +469,10 @@ curl --request PUT \
469
 
470
  #### Request parameters
471
 
 
 
 
 
472
  - `"name"`: (*Body parameter*), `string`
473
  - `"chunk_method"`: (*Body parameter*), `string`
474
  The parsing method to apply to the document:
@@ -538,9 +542,9 @@ curl --request GET \
538
 
539
  #### Request parameters
540
 
541
- - `"dataset_id"`: (*Path parameter*)
542
- The dataset ID.
543
- - `"documents_id"`: (*Path parameter*)
544
  The ID of the document to download.
545
 
546
  ### Response
@@ -580,27 +584,27 @@ Lists documents in a specified dataset.
580
 
581
  ```bash
582
  curl --request GET \
583
- --url http://{address}/api/v1/dataset/{dataset_id}/info?offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&keywords={keywords}&id={document_id} \
584
  --header 'Authorization: Bearer {YOUR_API_KEY}'
585
  ```
586
 
587
  #### Request parameters
588
 
589
- - `"dataset_id"`: (*Path parameter*)
590
- The dataset ID.
591
- - `"keywords"`: (*Filter parameter*), `string`
592
  The keywords used to match document titles.
593
- - `"offset"`: (*Filter parameter*), `integer`
594
  The starting index for the documents to retrieve. Typically used in conjunction with `limit`. Defaults to `1`.
595
- - `"limit"`: (*Filter parameter*), `integer`
596
  The maximum number of documents to retrieve. Defaults to `1024`.
597
- - `"orderby"`: (*Filter parameter*), `string`
598
  The field by which documents should be sorted. Available options:
599
- - `"create_time"` (default)
600
- - `"update_time"`
601
- - `"desc"`: (*Filter parameter*), `boolean`
602
  Indicates whether the retrieved documents should be sorted in descending order. Defaults to `true`.
603
- - `"id"`: (*Filter parameter*), `string`
604
  The ID of the document to retrieve.
605
 
606
  ### Response
@@ -690,10 +694,10 @@ curl --request DELETE \
690
 
691
  #### Request parameters
692
 
693
- - `"dataset_id"`: (*Path parameter*)
694
- The dataset ID.
695
  - `"ids"`: (*Body parameter*), `list[string]`
696
- The IDs of the documents to delete. If not specified, all documents in the dataset will be deleted.
697
 
698
  ### Response
699
 
@@ -747,7 +751,7 @@ curl --request POST \
747
 
748
  #### Request parameters
749
 
750
- - `"dataset_id"`: (*Path parameter*)
751
  The dataset ID.
752
  - `"document_ids"`: (*Body parameter*), `list[string]`, *Required*
753
  The IDs of the documents to parse.
@@ -804,9 +808,9 @@ curl --request DELETE \
804
 
805
  #### Request parameters
806
 
807
- - `"dataset_id"`: (*Path parameter*)
808
- The dataset ID
809
- - `"document_ids"`: (*Body parameter*)
810
  The IDs of the documents for which the parsing should be stopped.
811
 
812
  ### Response
@@ -862,9 +866,13 @@ curl --request POST \
862
 
863
  #### Request parameters
864
 
 
 
 
 
865
  - `"content"`: (*Body parameter*), `string`, *Required*
866
  The text content of the chunk.
867
- - `"important_keywords`(*Body parameter*)
868
  The key terms or phrases to tag with the chunk.
869
 
870
  ### Response
@@ -924,18 +932,18 @@ curl --request GET \
924
 
925
  #### Request parameters
926
 
927
- - `"dataset_id"`: (*Path parameter*)
928
- The dataset ID.
929
- - `"document_id"`: (*Path parameter*)
930
- The document ID.
931
  - `"keywords"`(*Filter parameter*), `string`
932
- The keywords used to match chunk content. Defaults to `None`
933
  - `"offset"`(*Filter parameter*), `string`
934
  The starting index for the chunks to retrieve. Defaults to `1`.
935
  - `"limit"`(*Filter parameter*), `integer`
936
  The maximum number of chunks to retrieve. Default: `1024`
937
  - `"id"`(*Filter parameter*), `string`
938
- The ID of the chunk to retrieve. Default: `None`
939
 
940
  ### Response
941
 
@@ -1025,8 +1033,12 @@ curl --request DELETE \
1025
 
1026
  #### Request parameters
1027
 
1028
- - `"chunk_ids"`: (*Body parameter*)
1029
- The IDs of the chunks to delete. If not specified, all chunks of the current document will be deleted.
 
 
 
 
1030
 
1031
  ### Response
1032
 
@@ -1083,13 +1095,19 @@ curl --request PUT \
1083
 
1084
  #### Request parameters
1085
 
 
 
 
 
 
 
1086
  - `"content"`: (*Body parameter*), `string`
1087
  The text content of the chunk.
1088
  - `"important_keywords"`: (*Body parameter*), `list[string]`
1089
  A list of key terms or phrases to tag with the chunk.
1090
  - `"available"`: (*Body parameter*) `boolean`
1091
  The chunk's availability status in the dataset. Value options:
1092
- - `true`: Available
1093
  - `false`: Unavailable
1094
 
1095
  ### Response
@@ -1157,7 +1175,7 @@ curl --request POST \
1157
  #### Request parameter
1158
 
1159
  - `"question"`: (*Body parameter*), `string`, *Required*
1160
- The user query or query keywords. Defaults to `""`.
1161
  - `"dataset_ids"`: (*Body parameter*) `list[string]`, *Required*
1162
  The IDs of the datasets to search from.
1163
  - `"document_ids"`: (*Body parameter*), `list[string]`
@@ -1300,14 +1318,14 @@ curl --request POST \
1300
 
1301
  - `"name"`: (*Body parameter*), `string`, *Required*
1302
  The name of the chat assistant.
1303
- - `"avatar"`: (*Body parameter*)
1304
- Base64 encoding of the avatar. Defaults to `""`.
1305
- - `"dataset_ids"`: (*Body parameter*)
1306
- The IDs of the associated datasets. Defaults to `[""]`.
1307
  - `"llm"`: (*Body parameter*), `object`
1308
- The LLM settings for the chat assistant to create. When the value is `None`, a dictionary with the following values will be generated as the default. An `llm` object contains the following attributes:
1309
  - `"model_name"`, `string`
1310
- The chat model name. If it is `None`, the user's default chat model will be returned.
1311
  - `"temperature"`: `float`
1312
  Controls the randomness of the model's predictions. A lower temperature increases the model's confidence in its responses; a higher temperature increases creativity and diversity. Defaults to `0.1`.
1313
  - `"top_p"`: `float`
@@ -1324,10 +1342,10 @@ curl --request POST \
1324
  - `"keywords_similarity_weight"`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
1325
  - `"top_n"`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
1326
  - `"variables"`: `object[]` This argument lists the variables to use in the 'System' field of **Chat Configurations**. Note that:
1327
- - `"knowledge"` is a reserved variable, which will be replaced with the retrieved chunks.
1328
  - All the variables in 'System' should be curly bracketed.
1329
- - The default value is `[{"key": "knowledge", "optional": true}]`
1330
- - `"rerank_model"`: `string` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used. Defaults to `""`.
1331
  - `"empty_response"`: `string` 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.
1332
  - `"opener"`: `string` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
1333
  - `"show_quote`: `boolean` Indicates whether the source of text should be displayed. Defaults to `true`.
@@ -1458,14 +1476,14 @@ curl --request PUT \
1458
  The ID of the chat assistant to update.
1459
  - `"name"`: (*Body parameter*), `string`, *Required*
1460
  The name of the chat assistant.
1461
- - `"avatar"`: (*Body parameter*)
1462
- Base64 encoding of the avatar. Defaults to `""`.
1463
- - `"dataset_ids"`: (*Body parameter*)
1464
- The IDs of the associated datasets. Defaults to `[""]`.
1465
  - `"llm"`: (*Body parameter*), `object`
1466
- The LLM settings for the chat assistant to create. When the value is `None`, a dictionary with the following values will be generated as the default. An `llm` object contains the following attributes:
1467
  - `"model_name"`, `string`
1468
- The chat model name. If it is `None`, the user's default chat model will be returned.
1469
  - `"temperature"`: `float`
1470
  Controls the randomness of the model's predictions. A lower temperature increases the model's confidence in its responses; a higher temperature increases creativity and diversity. Defaults to `0.1`.
1471
  - `"top_p"`: `float`
@@ -1482,10 +1500,10 @@ curl --request PUT \
1482
  - `"keywords_similarity_weight"`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
1483
  - `"top_n"`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
1484
  - `"variables"`: `object[]` This argument lists the variables to use in the 'System' field of **Chat Configurations**. Note that:
1485
- - `"knowledge"` is a reserved variable, which will be replaced with the retrieved chunks.
1486
  - All the variables in 'System' should be curly bracketed.
1487
  - The default value is `[{"key": "knowledge", "optional": true}]`
1488
- - `"rerank_model"`: `string` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used. Defaults to `""`.
1489
  - `"empty_response"`: `string` 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.
1490
  - `"opener"`: `string` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
1491
  - `"show_quote`: `boolean` Indicates whether the source of text should be displayed. Defaults to `true`.
@@ -1547,7 +1565,7 @@ curl --request DELETE \
1547
  #### Request parameters
1548
 
1549
  - `"ids"`: (*Body parameter*), `list[string]`
1550
- The IDs of the chat assistants to delete. If not specified, all chat assistants in the system will be deleted.
1551
 
1552
  ### Response
1553
 
@@ -1570,7 +1588,7 @@ Failure:
1570
 
1571
  ---
1572
 
1573
- ## List chats
1574
 
1575
  **GET** `/api/v1/chat?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={chat_name}&id={chat_id}`
1576
 
@@ -1599,8 +1617,8 @@ curl --request GET \
1599
  The number of chat assistants on each page. Defaults to `1024`.
1600
  - `orderby`: (*Path parameter*), `string`
1601
  The attribute by which the results are sorted. Available options:
1602
- - `"create_time"` (default)
1603
- - `"update_time"`
1604
  - `"desc"`: (*Path parameter*), `boolean`
1605
  Indicates whether the retrieved chat assistants should be sorted in descending order. Defaults to `true`.
1606
  - `id`: (*Path parameter*), `string`
@@ -1804,7 +1822,7 @@ curl --request PUT \
1804
  The ID of the associated chat assistant.
1805
  - `session_id`: (*Path parameter*)
1806
  The ID of the session to update.
1807
- - `"name`: (*Body Parameter), `string`
1808
  The name of the session to update.
1809
 
1810
  ### Response
@@ -1822,7 +1840,7 @@ Failure:
1822
  ```json
1823
  {
1824
  "code": 102,
1825
- "message": "Name can not be empty."
1826
  }
1827
  ```
1828
 
@@ -1853,19 +1871,19 @@ curl --request GET \
1853
 
1854
  - `chat_id`: (*Path parameter*)
1855
  The ID of the associated chat assistant.
1856
- - `"page"`: (*Path parameter*), `integer`
1857
  Specifies the page on which the sessions will be displayed. Defaults to `1`.
1858
- - `"page_size"`: (*Path parameter*), `integer`
1859
  The number of sessions on each page. Defaults to `1024`.
1860
- - `"orderby"`: (*Path parameter*), `string`
1861
  The field by which sessions should be sorted. Available options:
1862
- - `"create_time"` (default)
1863
- - `"update_time"`
1864
- - `"desc"`: (*Path parameter*), `boolean`
1865
  Indicates whether the retrieved sessions should be sorted in descending order. Defaults to `true`.
1866
- - `"name"`: (*Path parameter*) `string`
1867
  The name of the chat session to retrieve.
1868
- - `"id"`: (*Path parameter*), `string`
1869
  The ID of the chat session to retrieve.
1870
 
1871
  ### Response
@@ -1941,7 +1959,7 @@ curl --request DELETE \
1941
  - `chat_id`: (*Path parameter*)
1942
  The ID of the associated chat assistant.
1943
  - `"ids"`: (*Body Parameter*), `list[string]`
1944
- The IDs of the sessions to delete. If not specified, all sessions associated with the current chat assistant will be deleted.
1945
 
1946
  ### Response
1947
 
@@ -2002,12 +2020,12 @@ curl --request POST \
2002
  The ID of the associated chat assistant.
2003
  - `"question"`: (*Body Parameter*), `string` *Required*
2004
  The question to start an AI chat.
2005
- - `"stream"`: (*Body Parameter*), `string`
2006
  Indicates whether to output responses in a streaming way:
2007
  - `true`: Enable streaming.
2008
  - `false`: (Default) Disable streaming.
2009
  - `"session_id"`: (*Body Parameter*)
2010
- The ID of session. If not provided, a new session will be generated.
2011
 
2012
  ### Response
2013
 
 
61
  - Case-insensitive.
62
 
63
  - `"avatar"`: (*Body parameter*), `string`
64
+ Base64 encoding of the avatar.
65
 
66
  - `"description"`: (*Body parameter*), `string`
67
+ A brief description of the dataset to create.
68
 
69
  - `"language"`: (*Body parameter*), `string`
70
  The language setting of the dataset to create. Available options:
 
178
 
179
  #### Request parameters
180
 
181
+ - `"ids"`: (*Body parameter*), `list[string]`
182
+ The IDs of the datasets to delete. If it is not specified, all datasets will be deleted.
183
 
184
  ### Response
185
 
 
407
 
408
  #### Request parameters
409
 
410
+ - `dataset_id`: (*Path parameter*)
411
  The ID of the dataset to which the documents will be uploaded.
412
+ - `'file'`: (*Body parameter*)
413
+ A document to upload.
414
 
415
  ### Response
416
 
 
469
 
470
  #### Request parameters
471
 
472
+ - `dataset_id`: (*Path parameter*)
473
+ The ID of the associated dataset.
474
+ - `document_id`: (*Path parameter*)
475
+ The ID of the document to update.
476
  - `"name"`: (*Body parameter*), `string`
477
  - `"chunk_method"`: (*Body parameter*), `string`
478
  The parsing method to apply to the document:
 
542
 
543
  #### Request parameters
544
 
545
+ - `dataset_id`: (*Path parameter*)
546
+ The associated dataset ID.
547
+ - `documents_id`: (*Path parameter*)
548
  The ID of the document to download.
549
 
550
  ### Response
 
584
 
585
  ```bash
586
  curl --request GET \
587
+ --url http://{address}/api/v1/dataset/{dataset_id}/info?keywords={keywords}&offset={offset}&limit={limit}&orderby={orderby}&desc={desc}&id={document_id} \
588
  --header 'Authorization: Bearer {YOUR_API_KEY}'
589
  ```
590
 
591
  #### Request parameters
592
 
593
+ - `dataset_id`: (*Path parameter*)
594
+ The associated dataset ID.
595
+ - `keywords`: (*Filter parameter*), `string`
596
  The keywords used to match document titles.
597
+ - `offset`: (*Filter parameter*), `integer`
598
  The starting index for the documents to retrieve. Typically used in conjunction with `limit`. Defaults to `1`.
599
+ - `limit`: (*Filter parameter*), `integer`
600
  The maximum number of documents to retrieve. Defaults to `1024`.
601
+ - `orderby`: (*Filter parameter*), `string`
602
  The field by which documents should be sorted. Available options:
603
+ - `create_time` (default)
604
+ - `update_time`
605
+ - `desc`: (*Filter parameter*), `boolean`
606
  Indicates whether the retrieved documents should be sorted in descending order. Defaults to `true`.
607
+ - `id`: (*Filter parameter*), `string`
608
  The ID of the document to retrieve.
609
 
610
  ### Response
 
694
 
695
  #### Request parameters
696
 
697
+ - `dataset_id`: (*Path parameter*)
698
+ The associated dataset ID.
699
  - `"ids"`: (*Body parameter*), `list[string]`
700
+ The IDs of the documents to delete. If it is not specified, all documents in the specified dataset will be deleted.
701
 
702
  ### Response
703
 
 
751
 
752
  #### Request parameters
753
 
754
+ - `dataset_id`: (*Path parameter*)
755
  The dataset ID.
756
  - `"document_ids"`: (*Body parameter*), `list[string]`, *Required*
757
  The IDs of the documents to parse.
 
808
 
809
  #### Request parameters
810
 
811
+ - `dataset_id`: (*Path parameter*)
812
+ The associated dataset ID.
813
+ - `"document_ids"`: (*Body parameter*), `list[string]`, *Required*
814
  The IDs of the documents for which the parsing should be stopped.
815
 
816
  ### Response
 
866
 
867
  #### Request parameters
868
 
869
+ - `dataset_id`: (*Path parameter*)
870
+ The associated dataset ID.
871
+ - `document_ids`: (*Path parameter*)
872
+ The associated document ID.
873
  - `"content"`: (*Body parameter*), `string`, *Required*
874
  The text content of the chunk.
875
+ - `"important_keywords`(*Body parameter*), `list[string]`
876
  The key terms or phrases to tag with the chunk.
877
 
878
  ### Response
 
932
 
933
  #### Request parameters
934
 
935
+ - `dataset_id`: (*Path parameter*)
936
+ The associated dataset ID.
937
+ - `document_ids`: (*Path parameter*)
938
+ The associated document ID.
939
  - `"keywords"`(*Filter parameter*), `string`
940
+ The keywords used to match chunk content.
941
  - `"offset"`(*Filter parameter*), `string`
942
  The starting index for the chunks to retrieve. Defaults to `1`.
943
  - `"limit"`(*Filter parameter*), `integer`
944
  The maximum number of chunks to retrieve. Default: `1024`
945
  - `"id"`(*Filter parameter*), `string`
946
+ The ID of the chunk to retrieve.
947
 
948
  ### Response
949
 
 
1033
 
1034
  #### Request parameters
1035
 
1036
+ - `dataset_id`: (*Path parameter*)
1037
+ The associated dataset ID.
1038
+ - `document_ids`: (*Path parameter*)
1039
+ The associated document ID.
1040
+ - `"chunk_ids"`: (*Body parameter*), `list[string]`
1041
+ The IDs of the chunks to delete. If it is not specified, all chunks of the specified document will be deleted.
1042
 
1043
  ### Response
1044
 
 
1095
 
1096
  #### Request parameters
1097
 
1098
+ - `dataset_id`: (*Path parameter*)
1099
+ The associated dataset ID.
1100
+ - `document_ids`: (*Path parameter*)
1101
+ The associated document ID.
1102
+ - `chunk_id`: (*Path parameter*)
1103
+ The ID of the chunk to update.
1104
  - `"content"`: (*Body parameter*), `string`
1105
  The text content of the chunk.
1106
  - `"important_keywords"`: (*Body parameter*), `list[string]`
1107
  A list of key terms or phrases to tag with the chunk.
1108
  - `"available"`: (*Body parameter*) `boolean`
1109
  The chunk's availability status in the dataset. Value options:
1110
+ - `true`: Available (default)
1111
  - `false`: Unavailable
1112
 
1113
  ### Response
 
1175
  #### Request parameter
1176
 
1177
  - `"question"`: (*Body parameter*), `string`, *Required*
1178
+ The user query or query keywords.
1179
  - `"dataset_ids"`: (*Body parameter*) `list[string]`, *Required*
1180
  The IDs of the datasets to search from.
1181
  - `"document_ids"`: (*Body parameter*), `list[string]`
 
1318
 
1319
  - `"name"`: (*Body parameter*), `string`, *Required*
1320
  The name of the chat assistant.
1321
+ - `"avatar"`: (*Body parameter*), `string`
1322
+ Base64 encoding of the avatar.
1323
+ - `"dataset_ids"`: (*Body parameter*), `list[string]`
1324
+ The IDs of the associated datasets.
1325
  - `"llm"`: (*Body parameter*), `object`
1326
+ The LLM settings for the chat assistant to create. If it is not explicitly set, a dictionary with the following values will be generated as the default. An `llm` object contains the following attributes:
1327
  - `"model_name"`, `string`
1328
+ The chat model name. If not set, the user's default chat model will be used.
1329
  - `"temperature"`: `float`
1330
  Controls the randomness of the model's predictions. A lower temperature increases the model's confidence in its responses; a higher temperature increases creativity and diversity. Defaults to `0.1`.
1331
  - `"top_p"`: `float`
 
1342
  - `"keywords_similarity_weight"`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
1343
  - `"top_n"`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
1344
  - `"variables"`: `object[]` This argument lists the variables to use in the 'System' field of **Chat Configurations**. Note that:
1345
+ - `"knowledge"` is a reserved variable, which represents the retrieved chunks.
1346
  - All the variables in 'System' should be curly bracketed.
1347
+ - The default value is `[{"key": "knowledge", "optional": true}]`.
1348
+ - `"rerank_model"`: `string` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used.
1349
  - `"empty_response"`: `string` 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.
1350
  - `"opener"`: `string` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
1351
  - `"show_quote`: `boolean` Indicates whether the source of text should be displayed. Defaults to `true`.
 
1476
  The ID of the chat assistant to update.
1477
  - `"name"`: (*Body parameter*), `string`, *Required*
1478
  The name of the chat assistant.
1479
+ - `"avatar"`: (*Body parameter*), `string`
1480
+ Base64 encoding of the avatar.
1481
+ - `"dataset_ids"`: (*Body parameter*), `list[string]`
1482
+ The IDs of the associated datasets.
1483
  - `"llm"`: (*Body parameter*), `object`
1484
+ The LLM settings for the chat assistant to create. If it is not explicitly set, a dictionary with the following values will be generated as the default. An `llm` object contains the following attributes:
1485
  - `"model_name"`, `string`
1486
+ The chat model name. If not set, the user's default chat model will be used.
1487
  - `"temperature"`: `float`
1488
  Controls the randomness of the model's predictions. A lower temperature increases the model's confidence in its responses; a higher temperature increases creativity and diversity. Defaults to `0.1`.
1489
  - `"top_p"`: `float`
 
1500
  - `"keywords_similarity_weight"`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
1501
  - `"top_n"`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
1502
  - `"variables"`: `object[]` This argument lists the variables to use in the 'System' field of **Chat Configurations**. Note that:
1503
+ - `"knowledge"` is a reserved variable, which represents the retrieved chunks.
1504
  - All the variables in 'System' should be curly bracketed.
1505
  - The default value is `[{"key": "knowledge", "optional": true}]`
1506
+ - `"rerank_model"`: `string` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used.
1507
  - `"empty_response"`: `string` 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.
1508
  - `"opener"`: `string` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
1509
  - `"show_quote`: `boolean` Indicates whether the source of text should be displayed. Defaults to `true`.
 
1565
  #### Request parameters
1566
 
1567
  - `"ids"`: (*Body parameter*), `list[string]`
1568
+ The IDs of the chat assistants to delete. If it is not specified, all chat assistants in the system will be deleted.
1569
 
1570
  ### Response
1571
 
 
1588
 
1589
  ---
1590
 
1591
+ ## List chat assistants
1592
 
1593
  **GET** `/api/v1/chat?page={page}&page_size={page_size}&orderby={orderby}&desc={desc}&name={chat_name}&id={chat_id}`
1594
 
 
1617
  The number of chat assistants on each page. Defaults to `1024`.
1618
  - `orderby`: (*Path parameter*), `string`
1619
  The attribute by which the results are sorted. Available options:
1620
+ - `create_time` (default)
1621
+ - `update_time`
1622
  - `"desc"`: (*Path parameter*), `boolean`
1623
  Indicates whether the retrieved chat assistants should be sorted in descending order. Defaults to `true`.
1624
  - `id`: (*Path parameter*), `string`
 
1822
  The ID of the associated chat assistant.
1823
  - `session_id`: (*Path parameter*)
1824
  The ID of the session to update.
1825
+ - `"name"`: (*Body Parameter), `string`
1826
  The name of the session to update.
1827
 
1828
  ### Response
 
1840
  ```json
1841
  {
1842
  "code": 102,
1843
+ "message": "Name cannot be empty."
1844
  }
1845
  ```
1846
 
 
1871
 
1872
  - `chat_id`: (*Path parameter*)
1873
  The ID of the associated chat assistant.
1874
+ - `page`: (*Filter parameter*), `integer`
1875
  Specifies the page on which the sessions will be displayed. Defaults to `1`.
1876
+ - `page_size`: (*Filter parameter*), `integer`
1877
  The number of sessions on each page. Defaults to `1024`.
1878
+ - `orderby`: (*Filter parameter*), `string`
1879
  The field by which sessions should be sorted. Available options:
1880
+ - `create_time` (default)
1881
+ - `update_time`
1882
+ - `desc`: (*Filter parameter*), `boolean`
1883
  Indicates whether the retrieved sessions should be sorted in descending order. Defaults to `true`.
1884
+ - `name`: (*Filter parameter*) `string`
1885
  The name of the chat session to retrieve.
1886
+ - `id`: (*Filter parameter*), `string`
1887
  The ID of the chat session to retrieve.
1888
 
1889
  ### Response
 
1959
  - `chat_id`: (*Path parameter*)
1960
  The ID of the associated chat assistant.
1961
  - `"ids"`: (*Body Parameter*), `list[string]`
1962
+ The IDs of the sessions to delete. If it is not specified, all sessions associated with the specified chat assistant will be deleted.
1963
 
1964
  ### Response
1965
 
 
2020
  The ID of the associated chat assistant.
2021
  - `"question"`: (*Body Parameter*), `string` *Required*
2022
  The question to start an AI chat.
2023
+ - `"stream"`: (*Body Parameter*), `boolean`
2024
  Indicates whether to output responses in a streaming way:
2025
  - `true`: Enable streaming.
2026
  - `false`: (Default) Disable streaming.
2027
  - `"session_id"`: (*Body Parameter*)
2028
+ The ID of session. If it is not provided, a new session will be generated.
2029
 
2030
  ### Response
2031
 
api/python_api_reference.md CHANGED
@@ -105,16 +105,16 @@ dataset = rag_object.create_dataset(name="kb_1")
105
  ## Delete datasets
106
 
107
  ```python
108
- RAGFlow.delete_datasets(ids: list[str])
109
  ```
110
 
111
- Deletes specified datasets or all datasets in the system.
112
 
113
  ### Parameters
114
 
115
  #### ids: `list[str]`, *Required*
116
 
117
- The IDs of the datasets to delete.
118
 
119
  ### Returns
120
 
@@ -460,7 +460,7 @@ Deletes documents by ID.
460
 
461
  #### ids: `list[list]`
462
 
463
- The IDs of the documents to delete. Defaults to `None`. If not specified, all documents in the dataset will be deleted.
464
 
465
  ### Returns
466
 
@@ -597,7 +597,7 @@ A `Chunk` object contains the following attributes:
597
  - `document_id`: `str` The ID of the associated document.
598
  - `available`: `bool` The chunk's availability status in the dataset. Value options:
599
  - `False`: Unavailable
600
- - `True`: Available
601
 
602
 
603
  ### Examples
@@ -673,7 +673,7 @@ Deletes chunks by ID.
673
 
674
  #### chunk_ids: `list[str]`
675
 
676
- The IDs of the chunks to delete. Defaults to `None`. If not specified, all chunks of the current document will be deleted.
677
 
678
  ### Returns
679
 
@@ -714,7 +714,7 @@ A dictionary representing the attributes to update, with the following keys:
714
  - `"important_keywords"`: `list[str]` A list of key terms or phrases to tag with the chunk.
715
  - `"available"`: `bool` The chunk's availability status in the dataset. Value options:
716
  - `False`: Unavailable
717
- - `True`: Available
718
 
719
  ### Returns
720
 
@@ -866,7 +866,7 @@ The IDs of the associated datasets. Defaults to `[""]`.
866
  The LLM settings for the chat assistant to create. Defaults to `None`. When the value is `None`, a dictionary with the following values will be generated as the default. An `LLM` object contains the following attributes:
867
 
868
  - `model_name`: `str`
869
- The chat model name. If it is `None`, the user's default chat model will be returned.
870
  - `temperature`: `float`
871
  Controls the randomness of the model's predictions. A lower temperature increases the model's confidence in its responses; a higher temperature increases creativity and diversity. Defaults to `0.1`.
872
  - `top_p`: `float`
@@ -886,10 +886,9 @@ Instructions for the LLM to follow. A `Prompt` object contains the following at
886
  - `keywords_similarity_weight`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
887
  - `top_n`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
888
  - `variables`: `list[dict[]]` This argument lists the variables to use in the 'System' field of **Chat Configurations**. Note that:
889
- - `knowledge` is a reserved variable, which will be replaced with the retrieved chunks.
890
- - All the variables in 'System' should be curly bracketed.
891
- - The default value is `[{"key": "knowledge", "optional": True}]`
892
-
893
  - `rerank_model`: `str` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used. Defaults to `""`.
894
  - `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`.
895
  - `opener`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
@@ -947,7 +946,10 @@ A dictionary representing the attributes to update, with the following keys:
947
  - `"similarity_threshold"`: `float` RAGFlow uses a hybrid of weighted keyword similarity and vector cosine similarity during retrieval. This argument sets the threshold for similarities between the user query and chunks. If a similarity score falls below this threshold, the corresponding chunk will be excluded from the results. The default value is `0.2`.
948
  - `"keywords_similarity_weight"`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
949
  - `"top_n"`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
950
- - `"variables"`: `list[dict[]]` If you use dialog APIs, the variables might help you chat with your clients with different strategies. The variables are used to fill in the 'System' part in prompt in order to give LLM a hint. The 'knowledge' is a very special variable which will be filled-in with the retrieved chunks. All the variables in 'System' should be curly bracketed. Defaults to `[{"key": "knowledge", "optional": True}]`
 
 
 
951
  - `"rerank_model"`: `str` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used. Defaults to `""`.
952
  - `"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`.
953
  - `"opener"`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
@@ -988,7 +990,7 @@ Deletes chat assistants by ID.
988
 
989
  #### ids: `list[str]`
990
 
991
- The IDs of the chat assistants to delete. Defaults to `None`. If not specified, all chat assistants in the system will be deleted.
992
 
993
  ### Returns
994
 
@@ -1219,7 +1221,7 @@ Deletes sessions by ID.
1219
 
1220
  #### ids: `list[str]`
1221
 
1222
- The IDs of the sessions to delete. Defaults to `None`. If not specified, all sessions associated with the current chat assistant will be deleted.
1223
 
1224
  ### Returns
1225
 
@@ -1253,7 +1255,7 @@ Asks a question to start a conversation.
1253
 
1254
  The question to start an AI chat.
1255
 
1256
- #### stream: `str`
1257
 
1258
  Indicates whether to output responses in a streaming way:
1259
 
 
105
  ## Delete datasets
106
 
107
  ```python
108
+ RAGFlow.delete_datasets(ids: list[str] = None)
109
  ```
110
 
111
+ Deletes datasets by ID.
112
 
113
  ### Parameters
114
 
115
  #### ids: `list[str]`, *Required*
116
 
117
+ The IDs of the datasets to delete. Defaults to `None`. If it is not specified, all datasets will be deleted.
118
 
119
  ### Returns
120
 
 
460
 
461
  #### ids: `list[list]`
462
 
463
+ The IDs of the documents to delete. Defaults to `None`. If it is not specified, all documents in the dataset will be deleted.
464
 
465
  ### Returns
466
 
 
597
  - `document_id`: `str` The ID of the associated document.
598
  - `available`: `bool` The chunk's availability status in the dataset. Value options:
599
  - `False`: Unavailable
600
+ - `True`: Available (default)
601
 
602
 
603
  ### Examples
 
673
 
674
  #### chunk_ids: `list[str]`
675
 
676
+ The IDs of the chunks to delete. Defaults to `None`. If it is not specified, all chunks of the current document will be deleted.
677
 
678
  ### Returns
679
 
 
714
  - `"important_keywords"`: `list[str]` A list of key terms or phrases to tag with the chunk.
715
  - `"available"`: `bool` The chunk's availability status in the dataset. Value options:
716
  - `False`: Unavailable
717
+ - `True`: Available (default)
718
 
719
  ### Returns
720
 
 
866
  The LLM settings for the chat assistant to create. Defaults to `None`. When the value is `None`, a dictionary with the following values will be generated as the default. An `LLM` object contains the following attributes:
867
 
868
  - `model_name`: `str`
869
+ The chat model name. If it is `None`, the user's default chat model will be used.
870
  - `temperature`: `float`
871
  Controls the randomness of the model's predictions. A lower temperature increases the model's confidence in its responses; a higher temperature increases creativity and diversity. Defaults to `0.1`.
872
  - `top_p`: `float`
 
886
  - `keywords_similarity_weight`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
887
  - `top_n`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
888
  - `variables`: `list[dict[]]` This argument lists the variables to use in the 'System' field of **Chat Configurations**. Note that:
889
+ - `knowledge` is a reserved variable, which represents the retrieved chunks.
890
+ - All the variables in 'System' should be curly bracketed.
891
+ - The default value is `[{"key": "knowledge", "optional": True}]`.
 
892
  - `rerank_model`: `str` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used. Defaults to `""`.
893
  - `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`.
894
  - `opener`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
 
946
  - `"similarity_threshold"`: `float` RAGFlow uses a hybrid of weighted keyword similarity and vector cosine similarity during retrieval. This argument sets the threshold for similarities between the user query and chunks. If a similarity score falls below this threshold, the corresponding chunk will be excluded from the results. The default value is `0.2`.
947
  - `"keywords_similarity_weight"`: `float` This argument sets the weight of keyword similarity in the hybrid similarity score with vector cosine similarity or reranking model similarity. By adjusting this weight, you can control the influence of keyword similarity in relation to other similarity measures. The default value is `0.7`.
948
  - `"top_n"`: `int` This argument specifies the number of top chunks with similarity scores above the `similarity_threshold` that are fed to the LLM. The LLM will *only* access these 'top N' chunks. The default value is `8`.
949
+ - `"variables"`: `list[dict[]]` This argument lists the variables to use in the 'System' field of **Chat Configurations**. Note that:
950
+ - `knowledge` is a reserved variable, which represents the retrieved chunks.
951
+ - All the variables in 'System' should be curly bracketed.
952
+ - The default value is `[{"key": "knowledge", "optional": True}]`.
953
  - `"rerank_model"`: `str` If it is not specified, vector cosine similarity will be used; otherwise, reranking score will be used. Defaults to `""`.
954
  - `"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`.
955
  - `"opener"`: `str` The opening greeting for the user. Defaults to `"Hi! I am your assistant, can I help you?"`.
 
990
 
991
  #### ids: `list[str]`
992
 
993
+ The IDs of the chat assistants to delete. Defaults to `None`. If it is ot specified, all chat assistants in the system will be deleted.
994
 
995
  ### Returns
996
 
 
1221
 
1222
  #### ids: `list[str]`
1223
 
1224
+ The IDs of the sessions to delete. Defaults to `None`. If it is not specified, all sessions associated with the current chat assistant will be deleted.
1225
 
1226
  ### Returns
1227
 
 
1255
 
1256
  The question to start an AI chat.
1257
 
1258
+ #### stream: `bool`
1259
 
1260
  Indicates whether to output responses in a streaming way:
1261