writinwaters KevinHuSh commited on
Commit
e331d20
·
1 Parent(s): 72bee74

Fixed a docusaurus display issue (#954)

Browse files

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] Documentation Update

---------

Co-authored-by: KevinHuSh <[email protected]>

Files changed (1) hide show
  1. docs/references/api.md +28 -97
docs/references/api.md CHANGED
@@ -52,9 +52,7 @@ You are *required* to save the `data.id` value returned in the response data, wh
52
 
53
  ### Response
54
 
55
- <details>
56
- <summary>Response example</summary>
57
- <pre><code>
58
  {
59
  "data": {
60
  "create_date": "Fri, 12 Apr 2024 17:26:21 GMT",
@@ -77,9 +75,7 @@ You are *required* to save the `data.id` value returned in the response data, wh
77
  "retcode": 0,
78
  "retmsg": "success"
79
  }
80
-
81
- </code></pre>
82
- </details>
83
 
84
  ## Get conversation history
85
 
@@ -93,7 +89,7 @@ This method retrieves the history of a specified conversation session.
93
  |----------|-------------------------------------------------------------|
94
  | GET | `/api/conversation/<id>` |
95
 
96
- ### Request parameter
97
 
98
  | Name | Type | Required | Description |
99
  |----------|--------|----------|-------------------------------------------------------------|
@@ -112,20 +108,17 @@ This method retrieves the history of a specified conversation session.
112
  - `chunks`
113
  - `content_with_weight`: Content of the chunk.
114
  - `doc_name`: Name of the *hit* document.
115
- - `img_id`: The image ID of the chunk. It is an optional field only for PDF, PPTX, and images. Call ['GET' /document/get/<id>](#get-document-content-or-image) to retrieve the image.
116
  - positions: [page_number, [upleft corner(x, y)], [right bottom(x, y)]], the chunk position, only for PDF.
117
  - similarity: The hybrid similarity.
118
  - term_similarity: The keyword simimlarity.
119
  - vector_similarity: The embedding similarity.
120
  - `doc_aggs`:
121
- - `doc_id`: ID of the *hit* document. Call ['GET' /document/get/<id>](#get-document-content-or-image) to retrieve the document.
122
  - `doc_name`: Name of the *hit* document.
123
  - `count`: The number of *hit* chunks in this document.
124
 
125
- <details>
126
- <summary>Response example</summary>
127
-
128
- <pre><code>
129
  {
130
  "data": {
131
  "create_date": "Mon, 01 Apr 2024 09:28:42 GMT",
@@ -144,14 +137,6 @@ This method retrieves the history of a specified conversation session.
144
  {
145
  "content": "The ViT Score for GPT-4 in the zero-shot scenario is 0.5058, and in the few-shot scenario, it is 0.6480. ##0$$",
146
  "role": "assistant"
147
- },
148
- {
149
- "content": "How is the nvlink topology like?",
150
- "role": "user"
151
- },
152
- {
153
- "content": "NVLink topology refers to the arrangement of connections between GPUs using NVIDIA's NVLink technology. Correct NVLink topology for NVIDIA A100 cards involves connecting one GPU to another through a series of NVLink bridges ##0$$. Each of the three attached bridges spans two PCIe slots, and for optimal performance and balanced bridge topology, all three NVLink bridges should be used when connecting two adjacent A100 cards.\n\nHere's a summary of the correct and incorrect topologies:\n\n- **Correct**: Both GPUs are connected via all three NVLink bridges, ensuring full bandwidth and proper communication.\n- **Incorrect**: Not using all three bridges or having an uneven connection configuration would result in suboptimal performance.\n\nIt's also important to note that for multi-CPU systems, both A100 cards in a bridged pair should be within the same CPU domain, unless each CPU has a single A100 PCIe card, in which case they can be bridged together.",
154
- "role": "assistant"
155
  }
156
  ],
157
  "user_id": "<USER_ID_SET_BY_THE_CALLER>",
@@ -182,8 +167,8 @@ This method retrieves the history of a specified conversation session.
182
  },
183
  {
184
  "chunk_id": "7e2345d440383b756670e1b0f43a7007",
185
- "content_ltks": "5.5 experiment analysi the main experiment result are tabul in tab . 1 and 2 , showcas the result for closed-sourc and open-sourc llm , respect . the overal perform is calcul a the averag of cllp 8 bert and vit score . here , onli the task descript of the benchmark task are fed into llm(addit inform , such a the input prompt and llm\u2019output , is provid in fig . a.4 and a.5 in supplementari). broadli speak , closed-sourc llm demonstr superior perform on openagi task , with gpt-4 lead the pack under both zero-and few-shot scenario . in the open-sourc categori , llama-2-13b take the lead , consist post top result across variou learn schema--the perform possibl influenc by it larger model size . notabl , open-sourc llm significantli benefit from the tune method , particularli fine-tun and\u2019rltf . these method mark notic enhanc for flan-t5-larg , vicuna-7b , and llama-2-13b when compar with zero-shot and few-shot learn schema . in fact , each of these open-sourc model hit it pinnacl under the rltf approach . conclus , with rltf tune , the perform of llama-2-13b approach that of gpt-3.5 , illustr it potenti .",
186
- "content_with_weight": "5.5 Experimental Analysis\nThe main experimental results are tabulated in Tab. 1 and 2, showcasing the results for closed-source and open-source LLMs, respectively. The overall performance is calculated as the average of CLlP\n8\nBERT and ViT scores. Here, only the task descriptions of the benchmark tasks are fed into LLMs (additional information, such as the input prompt and LLMs\u2019 outputs, is provided in Fig. A.4 and A.5 in supplementary). Broadly speaking, closed-source LLMs demonstrate superior performance on OpenAGI tasks, with GPT-4 leading the pack under both zero- and few-shot scenarios. In the open-source category, LLaMA-2-13B takes the lead, consistently posting top results across various learning schema--the performance possibly influenced by its larger model size. Notably, open-source LLMs significantly benefit from the tuning methods, particularly Fine-tuning and\u2019 RLTF. These methods mark noticeable enhancements for Flan-T5-Large, Vicuna-7B, and LLaMA-2-13B when compared with zero-shot and few-shot learning schema. In fact, each of these open-source models hits its pinnacle under the RLTF approach. Conclusively, with RLTF tuning, the performance of LLaMA-2-13B approaches that of GPT-3.5, illustrating its potential.",
187
  "doc_id": "c790da40ea8911ee928e0242ac180005",
188
  "doc_name": "OpenAGI When LLM Meets Domain Experts.pdf",
189
  "img_id": "afab9fdad6e511eebdb20242ac180006-7e2345d440383b756670e1b0f43a7007",
@@ -212,40 +197,6 @@ This method retrieves the history of a specified conversation session.
212
  ],
213
  "total": 8
214
  },
215
- {
216
- "chunks": [
217
- {
218
- "chunk_id": "8c11a1edddb21ad2ae0c43b4a5dcfa62",
219
- "content_ltks": "nvlink bridg support nvidia\u00aenvlink\u00aei a high-spe point-to-point peer transfer connect , where one gpu can transfer data to and receiv data from one other gpu . the nvidia a100 card support nvlink bridg connect with a singl adjac a100 card . each of the three attach bridg span two pcie slot . to function correctli a well a to provid peak bridg bandwidth , bridg connect with an adjac a100 card must incorpor all three nvlink bridg . wherev an adjac pair of a100 card exist in the server , for best bridg perform and balanc bridg topolog , the a100 pair should be bridg . figur 4 illustr correct and incorrect a100 nvlink connect topolog . nvlink topolog\u2013top view figur 4. correct incorrect correct incorrect for system that featur multipl cpu , both a100 card of a bridg card pair should be within the same cpu domain\u2014that is , under the same cpu\u2019s topolog . ensur thi benefit workload applic perform . the onli except is for dual cpu system wherein each cpu ha a singl a100 pcie card under it;in that case , the two a100 pcie card in the system may be bridg togeth . a100 nvlink speed and bandwidth are given in the follow tabl . tabl 5. a100 nvlink speed and bandwidth paramet valu total nvlink bridg support by nvidia a100 3 total nvlink rx and tx lane support 96 data rate per nvidia a100 nvlink lane(each direct)50 gbp total maximum nvlink bandwidth 600 gbyte per second pb-10137-001_v03|8 nvidia a100 40gb pcie gpu acceler",
220
- "content_with_weight": "NVLink Bridge Support\nNVIDIA\u00aeNVLink\u00aeis a high-speed point-to-point peer transfer connection, where one GPU can transfer data to and receive data from one other GPU. The NVIDIA A100 card supports NVLink bridge connection with a single adjacent A100 card.\nEach of the three attached bridges spans two PCIe slots. To function correctly as well as to provide peak bridge bandwidth, bridge connection with an adjacent A100 card must incorporate all three NVLink bridges. Wherever an adjacent pair of A100 cards exists in the server, for best bridging performance and balanced bridge topology, the A100 pair should be bridged. Figure 4 illustrates correct and incorrect A100 NVLink connection topologies.\nNVLink Topology \u2013Top Views \nFigure 4. \nCORRECT \nINCORRECT \nCORRECT \nINCORRECT \nFor systems that feature multiple CPUs, both A100 cards of a bridged card pair should be within the same CPU domain\u2014that is, under the same CPU\u2019s topology. Ensuring this benefits workload application performance. The only exception is for dual CPU systems wherein each CPU has a single A100 PCIe card under it; in that case, the two A100 PCIe cards in the system may be bridged together.\nA100 NVLink speed and bandwidth are given in the following table.\n<table><caption>Table 5. A100 NVLink Speed and Bandwidth </caption>\n<tr><th >Parameter </th><th >Value </th></tr>\n<tr><td >Total NVLink bridges supported by NVIDIA A100 </td><td >3 </td></tr>\n<tr><td >Total NVLink Rx and Tx lanes supported </td><td >96 </td></tr>\n<tr><td >Data rate per NVIDIA A100 NVLink lane (each direction)</td><td >50 Gbps </td></tr>\n<tr><td >Total maximum NVLink bandwidth</td><td >600 Gbytes per second </td></tr>\n</table>\nPB-10137-001_v03 |8\nNVIDIA A100 40GB PCIe GPU Accelerator",
221
- "doc_id": "806d1ed0ea9311ee860a0242ac180005",
222
- "doc_name": "A100-PCIE-Prduct-Brief.pdf",
223
- "img_id": "afab9fdad6e511eebdb20242ac180006-8c11a1edddb21ad2ae0c43b4a5dcfa62",
224
- "important_kwd": [],
225
- "kb_id": "afab9fdad6e511eebdb20242ac180006",
226
- "positions": [
227
- [
228
- 12.0,
229
- 84.0,
230
- 541.3,
231
- 76.7,
232
- 96.7
233
- ],
234
- ],
235
- "similarity": 0.3200748779905588,
236
- "term_similarity": 0.3082244010114718,
237
- "vector_similarity": 0.42672917080234146
238
- },
239
- ],
240
- "doc_aggs": [
241
- {
242
- "count": 1,
243
- "doc_id": "806d1ed0ea9311ee860a0242ac180005",
244
- "doc_name": "A100-PCIE-Prduct-Brief.pdf"
245
- }
246
- ],
247
- "total": 3
248
- }
249
  ],
250
  "update_date": "Tue, 02 Apr 2024 09:07:49 GMT",
251
  "update_time": 1712020069421
@@ -253,9 +204,7 @@ This method retrieves the history of a specified conversation session.
253
  "retcode": 0,
254
  "retmsg": "success"
255
  }
256
- </code></pre>
257
- </details>
258
-
259
 
260
  ## Get answer
261
 
@@ -269,7 +218,7 @@ This method retrieves from RAGFlow the answer to the user's latest question.
269
  |----------|-------------------------------------------------------------|
270
  | POST | `/api/completion` |
271
 
272
- ### Request parameter
273
 
274
  | Name | Type | Required | Description |
275
  |------------------|--------|----------|---------------|
@@ -286,20 +235,17 @@ This method retrieves from RAGFlow the answer to the user's latest question.
286
  - `chunks`: The retrieved chunks that contribute to the answer.
287
  - `content_with_weight`: Content of the chunk.
288
  - `doc_name`: Name of the *hit* document.
289
- - `img_id`: The image ID of the chunk. It is an optional field only for PDF, PPTX, and images. Call ['GET' /document/get/<id>](#get-document-content-or-image) to retrieve the image.
290
  - `positions`: [page_number, [upleft corner(x, y)], [right bottom(x, y)]], the chunk position, only for PDF.
291
  - `similarity`: The hybrid similarity.
292
  - `term_similarity`: The keyword simimlarity.
293
  - `vector_similarity`: The embedding similarity.
294
  - `doc_aggs`:
295
- - `doc_id`: ID of the *hit* document. Call ['GET' /document/get/<id>](#get-document-content-or-image) to retrieve the document.
296
  - `doc_name`: Name of the *hit* document.
297
  - `count`: The number of *hit* chunks in this document.
298
 
299
- <details>
300
- <summary>Response example</summary>
301
-
302
- <pre><code>
303
  {
304
  "data": {
305
  "answer": "The ViT Score for GPT-4 in the zero-shot scenario is 0.5058, and in the few-shot scenario, it is 0.6480. ##0$$",
@@ -359,12 +305,11 @@ This method retrieves from RAGFlow the answer to the user's latest question.
359
  "retcode": 0,
360
  "retmsg": "success"
361
  }
362
- </code></pre>
363
- </details>
364
 
365
- ## Get document content or image
366
 
367
- This method retrieves the content or a specific image in a document. Used if you intend to display the content of a citation.
368
 
369
  ### Request
370
 
@@ -372,10 +317,12 @@ This method retrieves the content or a specific image in a document. Used if you
372
 
373
  | Method | Request URI |
374
  |----------|-------------------------------------------------------------|
375
- | GET | `/api/document/get/<id>` |
376
 
377
  ### Response
378
 
 
 
379
  ## Upload file
380
 
381
  This method uploads a specific file to a specified knowledge base.
@@ -388,7 +335,7 @@ This method uploads a specific file to a specified knowledge base.
388
  |----------|-------------------------------------------------------------|
389
  | POST | `/api/document/upload` |
390
 
391
- ### Response parameter
392
 
393
  | Name | Type | Required | Description |
394
  |-------------|--------|----------|---------------------------------------------------------|
@@ -400,9 +347,7 @@ This method uploads a specific file to a specified knowledge base.
400
 
401
  ### Response
402
 
403
- <details>
404
- <summary>Response example</summary>
405
- <pre><code>
406
  {
407
  "data": {
408
  "chunk_num": 0,
@@ -441,9 +386,7 @@ This method uploads a specific file to a specified knowledge base.
441
  "retcode": 0,
442
  "retmsg": "success"
443
  }
444
-
445
- </code></pre>
446
- </details>
447
 
448
  ## Get document chunks
449
 
@@ -467,9 +410,7 @@ This method retrieves the chunks of a specific document by `doc_name` or `doc_id
467
 
468
  ### Response
469
 
470
- <details>
471
- <summary>Response example</summary>
472
- <pre><code>
473
  {
474
  "data": [
475
  {
@@ -486,9 +427,7 @@ This method retrieves the chunks of a specific document by `doc_name` or `doc_id
486
  "retcode": 0,
487
  "retmsg": "success"
488
  }
489
-
490
- </code></pre>
491
- </details>
492
 
493
  ## Get document list
494
 
@@ -516,9 +455,7 @@ This method retrieves a list of documents from a specified knowledge base.
516
 
517
  ### Response
518
 
519
- <details>
520
- <summary>Response example</summary>
521
- <pre><code>
522
  {
523
  "data": {
524
  "docs": [
@@ -536,9 +473,7 @@ This method retrieves a list of documents from a specified knowledge base.
536
  "retcode": 0,
537
  "retmsg": "success"
538
  }
539
-
540
- </code></pre>
541
- </details>
542
 
543
  ## Delete documents
544
 
@@ -562,14 +497,10 @@ This method deletes documents by document ID or name.
562
 
563
  ### Response
564
 
565
- <details>
566
- <summary>Response example</summary>
567
- <pre><code>
568
  {
569
  "data": true,
570
  "retcode": 0,
571
  "retmsg": "success"
572
  }
573
-
574
- </code></pre>
575
- </details>
 
52
 
53
  ### Response
54
 
55
+ ```json
 
 
56
  {
57
  "data": {
58
  "create_date": "Fri, 12 Apr 2024 17:26:21 GMT",
 
75
  "retcode": 0,
76
  "retmsg": "success"
77
  }
78
+ ```
 
 
79
 
80
  ## Get conversation history
81
 
 
89
  |----------|-------------------------------------------------------------|
90
  | GET | `/api/conversation/<id>` |
91
 
92
+ #### Request parameter
93
 
94
  | Name | Type | Required | Description |
95
  |----------|--------|----------|-------------------------------------------------------------|
 
108
  - `chunks`
109
  - `content_with_weight`: Content of the chunk.
110
  - `doc_name`: Name of the *hit* document.
111
+ - `img_id`: The image ID of the chunk. It is an optional field only for PDF, PPTX, and images. Call ['GET' /document/get/\<id\>](#get-document-content-or-image) to retrieve the image.
112
  - positions: [page_number, [upleft corner(x, y)], [right bottom(x, y)]], the chunk position, only for PDF.
113
  - similarity: The hybrid similarity.
114
  - term_similarity: The keyword simimlarity.
115
  - vector_similarity: The embedding similarity.
116
  - `doc_aggs`:
117
+ - `doc_id`: ID of the *hit* document. Call ['GET' /document/get/\<id\>](#get-document-content-or-image) to retrieve the document.
118
  - `doc_name`: Name of the *hit* document.
119
  - `count`: The number of *hit* chunks in this document.
120
 
121
+ ```json
 
 
 
122
  {
123
  "data": {
124
  "create_date": "Mon, 01 Apr 2024 09:28:42 GMT",
 
137
  {
138
  "content": "The ViT Score for GPT-4 in the zero-shot scenario is 0.5058, and in the few-shot scenario, it is 0.6480. ##0$$",
139
  "role": "assistant"
 
 
 
 
 
 
 
 
140
  }
141
  ],
142
  "user_id": "<USER_ID_SET_BY_THE_CALLER>",
 
167
  },
168
  {
169
  "chunk_id": "7e2345d440383b756670e1b0f43a7007",
170
+ "content_ltks": "5.5 experiment analysi the main experiment result are tabul in tab . 1 and 2 , showcas the result for closed-sourc and open-sourc llm , respect . the overal perform is calcul a the averag of cllp 8 bert and vit score . ",
171
+ "content_with_weight": "5.5 Experimental Analysis\nThe main experimental results are tabulated in Tab. 1 and 2, showcasing the results for closed-source and open-source LLMs, respectively. The overall performance is calculated as the average of CLlP\n8\nBERT and ViT scores.",
172
  "doc_id": "c790da40ea8911ee928e0242ac180005",
173
  "doc_name": "OpenAGI When LLM Meets Domain Experts.pdf",
174
  "img_id": "afab9fdad6e511eebdb20242ac180006-7e2345d440383b756670e1b0f43a7007",
 
197
  ],
198
  "total": 8
199
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  ],
201
  "update_date": "Tue, 02 Apr 2024 09:07:49 GMT",
202
  "update_time": 1712020069421
 
204
  "retcode": 0,
205
  "retmsg": "success"
206
  }
207
+ ```
 
 
208
 
209
  ## Get answer
210
 
 
218
  |----------|-------------------------------------------------------------|
219
  | POST | `/api/completion` |
220
 
221
+ #### Request parameter
222
 
223
  | Name | Type | Required | Description |
224
  |------------------|--------|----------|---------------|
 
235
  - `chunks`: The retrieved chunks that contribute to the answer.
236
  - `content_with_weight`: Content of the chunk.
237
  - `doc_name`: Name of the *hit* document.
238
+ - `img_id`: The image ID of the chunk. It is an optional field only for PDF, PPTX, and images. Call ['GET' /document/get/\<id\>](#get-document-content-or-image) to retrieve the image.
239
  - `positions`: [page_number, [upleft corner(x, y)], [right bottom(x, y)]], the chunk position, only for PDF.
240
  - `similarity`: The hybrid similarity.
241
  - `term_similarity`: The keyword simimlarity.
242
  - `vector_similarity`: The embedding similarity.
243
  - `doc_aggs`:
244
+ - `doc_id`: ID of the *hit* document. Call ['GET' /document/get/\<id\>](#get-document-content-or-image) to retrieve the document.
245
  - `doc_name`: Name of the *hit* document.
246
  - `count`: The number of *hit* chunks in this document.
247
 
248
+ ```json
 
 
 
249
  {
250
  "data": {
251
  "answer": "The ViT Score for GPT-4 in the zero-shot scenario is 0.5058, and in the few-shot scenario, it is 0.6480. ##0$$",
 
305
  "retcode": 0,
306
  "retmsg": "success"
307
  }
308
+ ```
 
309
 
310
+ ## Get document content
311
 
312
+ This method retrieves the content of a document.
313
 
314
  ### Request
315
 
 
317
 
318
  | Method | Request URI |
319
  |----------|-------------------------------------------------------------|
320
+ | GET | `/document/get/<id>` |
321
 
322
  ### Response
323
 
324
+ A binary file.
325
+
326
  ## Upload file
327
 
328
  This method uploads a specific file to a specified knowledge base.
 
335
  |----------|-------------------------------------------------------------|
336
  | POST | `/api/document/upload` |
337
 
338
+ #### Response parameter
339
 
340
  | Name | Type | Required | Description |
341
  |-------------|--------|----------|---------------------------------------------------------|
 
347
 
348
  ### Response
349
 
350
+ ```json
 
 
351
  {
352
  "data": {
353
  "chunk_num": 0,
 
386
  "retcode": 0,
387
  "retmsg": "success"
388
  }
389
+ ```
 
 
390
 
391
  ## Get document chunks
392
 
 
410
 
411
  ### Response
412
 
413
+ ```json
 
 
414
  {
415
  "data": [
416
  {
 
427
  "retcode": 0,
428
  "retmsg": "success"
429
  }
430
+ ```
 
 
431
 
432
  ## Get document list
433
 
 
455
 
456
  ### Response
457
 
458
+ ```json
 
 
459
  {
460
  "data": {
461
  "docs": [
 
473
  "retcode": 0,
474
  "retmsg": "success"
475
  }
476
+ ```
 
 
477
 
478
  ## Delete documents
479
 
 
497
 
498
  ### Response
499
 
500
+ ```json
 
 
501
  {
502
  "data": true,
503
  "retcode": 0,
504
  "retmsg": "success"
505
  }
506
+ ```