Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. ---
  2. sidebar_position: 1
  3. slug: /api
  4. ---
  5. # API reference
  6. ![](https://github.com/infiniflow/ragflow/assets/12318111/df0dcc3d-789a-44f7-89f1-7a5f044ab729)
  7. ## Base URL
  8. ```
  9. https://demo.ragflow.io/v1/
  10. ```
  11. ## Authorization
  12. All the APIs are authorized with API-Key. Please keep it safe and private. Don't reveal it in any way from the front-end.
  13. The API-Key should put in the header of request:
  14. ```buildoutcfg
  15. Authorization: Bearer {API_KEY}
  16. ```
  17. ## Start a conversation
  18. This should be called whenever there's new user coming to chat.
  19. ### Path: /api/new_conversation
  20. ### Method: GET
  21. ### Parameter:
  22. | name | type | optional | description|
  23. |------|-------|----|----|
  24. | user_id| string | No | It's for identifying user in order to search and calculate statistics.|
  25. ### Response
  26. ```json
  27. {
  28. "data": {
  29. "create_date": "Fri, 12 Apr 2024 17:26:21 GMT",
  30. "create_time": 1712913981857,
  31. "dialog_id": "4f0a2e4cb9af11ee9ba20aef05f5e94f",
  32. "duration": 0.0,
  33. "id": "b9b2e098f8ae11ee9f45fa163e197198",
  34. "message": [
  35. {
  36. "content": "Hi, I'm your assistant, can I help you?",
  37. "role": "assistant"
  38. }
  39. ],
  40. "reference": [],
  41. "tokens": 0,
  42. "update_date": "Fri, 12 Apr 2024 17:26:21 GMT",
  43. "update_time": 1712913981857,
  44. "user_id": "kevinhu"
  45. },
  46. "retcode": 0,
  47. "retmsg": "success"
  48. }
  49. ```
  50. > data['id'] in response should be stored and will be used in every round of following conversation.
  51. ## Get history of a conversation
  52. ### Path: /api/conversation/\<id\>
  53. ### Method: GET
  54. ### Response
  55. ```json
  56. {
  57. "data": {
  58. "create_date": "Mon, 01 Apr 2024 09:28:42 GMT",
  59. "create_time": 1711934922220,
  60. "dialog_id": "df4a4916d7bd11eeaa650242ac180006",
  61. "id": "2cae30fcefc711ee94140242ac180006",
  62. "message": [
  63. {
  64. "content": "Hi! I'm your assistant, what can I do for you?",
  65. "role": "assistant"
  66. },
  67. {
  68. "content": "What's the vit score for GPT-4?",
  69. "role": "user"
  70. },
  71. {
  72. "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$$",
  73. "role": "assistant"
  74. },
  75. {
  76. "content": "How is the nvlink topology like?",
  77. "role": "user"
  78. },
  79. {
  80. "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.",
  81. "role": "assistant"
  82. }
  83. ],
  84. "user_id": "user name",
  85. "reference": [
  86. {
  87. "chunks": [
  88. {
  89. "chunk_id": "d0bc7892c3ec4aeac071544fd56730a8",
  90. "content_ltks": "tabl 1:openagi task-solv perform under differ set for three closed-sourc llm . boldfac denot the highest score under each learn schema . metric gpt-3.5-turbo claude-2 gpt-4 zero few zero few zero few clip score 0.0 0.0 0.0 0.2543 0.0 0.3055 bert score 0.1914 0.3820 0.2111 0.5038 0.2076 0.6307 vit score 0.2437 0.7497 0.4082 0.5416 0.5058 0.6480 overal 0.1450 0.3772 0.2064 0.4332 0.2378 0.5281",
  91. "content_with_weight": "<table><caption>Table 1: OpenAGI task-solving performances under different settings for three closed-source LLMs. Boldface denotes the highest score under each learning schema.</caption>\n<tr><th rowspan=2 >Metrics</th><th >GPT-3.5-turbo</th><th></th><th >Claude-2</th><th >GPT-4</th></tr>\n<tr><th >Zero</th><th >Few</th><th >Zero Few</th><th >Zero Few</th></tr>\n<tr><td >CLIP Score</td><td >0.0</td><td >0.0</td><td >0.0 0.2543</td><td >0.0 0.3055</td></tr>\n<tr><td >BERT Score</td><td >0.1914</td><td >0.3820</td><td >0.2111 0.5038</td><td >0.2076 0.6307</td></tr>\n<tr><td >ViT Score</td><td >0.2437</td><td >0.7497</td><td >0.4082 0.5416</td><td >0.5058 0.6480</td></tr>\n<tr><td >Overall</td><td >0.1450</td><td >0.3772</td><td >0.2064 0.4332</td><td >0.2378 0.5281</td></tr>\n</table>",
  92. "doc_id": "c790da40ea8911ee928e0242ac180005",
  93. "docnm_kwd": "OpenAGI When LLM Meets Domain Experts.pdf",
  94. "img_id": "afab9fdad6e511eebdb20242ac180006-d0bc7892c3ec4aeac071544fd56730a8",
  95. "important_kwd": [],
  96. "kb_id": "afab9fdad6e511eebdb20242ac180006",
  97. "positions": [
  98. [
  99. 9.0,
  100. 159.9383341471354,
  101. 472.1773274739583,
  102. 223.58013916015625,
  103. 307.86692301432294
  104. ]
  105. ],
  106. "similarity": 0.7310340654129031,
  107. "term_similarity": 0.7671974387781668,
  108. "vector_similarity": 0.40556370512552886
  109. },
  110. {
  111. "chunk_id": "7e2345d440383b756670e1b0f43a7007",
  112. "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 .",
  113. "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.",
  114. "doc_id": "c790da40ea8911ee928e0242ac180005",
  115. "docnm_kwd": "OpenAGI When LLM Meets Domain Experts.pdf",
  116. "img_id": "afab9fdad6e511eebdb20242ac180006-7e2345d440383b756670e1b0f43a7007",
  117. "important_kwd": [],
  118. "kb_id": "afab9fdad6e511eebdb20242ac180006",
  119. "positions": [
  120. [
  121. 8.0,
  122. 107.3,
  123. 508.90000000000003,
  124. 686.3,
  125. 697.0
  126. ],
  127. ],
  128. "similarity": 0.6691508616357027,
  129. "term_similarity": 0.6999011754270821,
  130. "vector_similarity": 0.39239803751328806
  131. },
  132. ],
  133. "doc_aggs": [
  134. {
  135. "count": 8,
  136. "doc_id": "c790da40ea8911ee928e0242ac180005",
  137. "doc_name": "OpenAGI When LLM Meets Domain Experts.pdf"
  138. }
  139. ],
  140. "total": 8
  141. },
  142. {
  143. "chunks": [
  144. {
  145. "chunk_id": "8c11a1edddb21ad2ae0c43b4a5dcfa62",
  146. "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",
  147. "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",
  148. "doc_id": "806d1ed0ea9311ee860a0242ac180005",
  149. "docnm_kwd": "A100-PCIE-Prduct-Brief.pdf",
  150. "img_id": "afab9fdad6e511eebdb20242ac180006-8c11a1edddb21ad2ae0c43b4a5dcfa62",
  151. "important_kwd": [],
  152. "kb_id": "afab9fdad6e511eebdb20242ac180006",
  153. "positions": [
  154. [
  155. 12.0,
  156. 84.0,
  157. 541.3,
  158. 76.7,
  159. 96.7
  160. ],
  161. ],
  162. "similarity": 0.3200748779905588,
  163. "term_similarity": 0.3082244010114718,
  164. "vector_similarity": 0.42672917080234146
  165. },
  166. ],
  167. "doc_aggs": [
  168. {
  169. "count": 1,
  170. "doc_id": "806d1ed0ea9311ee860a0242ac180005",
  171. "doc_name": "A100-PCIE-Prduct-Brief.pdf"
  172. }
  173. ],
  174. "total": 3
  175. }
  176. ],
  177. "update_date": "Tue, 02 Apr 2024 09:07:49 GMT",
  178. "update_time": 1712020069421
  179. },
  180. "retcode": 0,
  181. "retmsg": "success"
  182. }
  183. ```
  184. - **message**: All the chat history in it.
  185. - role: user or assistant
  186. - content: the text content of user or assistant. The citations are in format like: ##0$$. The number in the middle indicate which part in data.reference.chunks it refers to.
  187. - **user_id**: This is set by the caller.
  188. - **reference**: Every item in it refer to the corresponding message in data.message whose role is assistant.
  189. - chunks
  190. - content_with_weight: The content of chunk.
  191. - docnm_kwd: the document name.
  192. - img_id: the image id of the chunk. It is an optional field only for PDF/pptx/picture. And accessed by 'GET' /document/get/\<id\>.
  193. - positions: [page_number, [upleft corner(x, y)], [right bottom(x, y)]], the chunk position, only for PDF.
  194. - similarity: the hybrid similarity.
  195. - term_similarity: keyword simimlarity
  196. - vector_similarity: embedding similarity
  197. - doc_aggs:
  198. - doc_id: the document can be accessed by 'GET' /document/get/\<id\>
  199. - doc_name: the file name
  200. - count: the chunk number hit in this document.
  201. ## Chat
  202. This will be called to get the answer to users' questions.
  203. ### Path: /api/completion
  204. ### Method: POST
  205. ### Parameter:
  206. | name | type | optional | description|
  207. |------|-------|----|----|
  208. | conversation_id| string | No | This is from calling /new_conversation.|
  209. | messages| json | No | The latest question, such as `[{"role": "user", "content": "How are you doing!"}]`|
  210. | quote | bool | Yes | Default: true |
  211. | stream | bool | Yes | Default: true |
  212. | doc_ids | string | Yes | Document IDs which is delimited by comma, like `c790da40ea8911ee928e0242ac180005,c790da40ea8911ee928e0242ac180005`. The retrieved content is limited in these documents. |
  213. ### Response
  214. ```json
  215. {
  216. "data": {
  217. "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$$",
  218. "reference": {
  219. "chunks": [
  220. {
  221. "chunk_id": "d0bc7892c3ec4aeac071544fd56730a8",
  222. "content_ltks": "tabl 1:openagi task-solv perform under differ set for three closed-sourc llm . boldfac denot the highest score under each learn schema . metric gpt-3.5-turbo claude-2 gpt-4 zero few zero few zero few clip score 0.0 0.0 0.0 0.2543 0.0 0.3055 bert score 0.1914 0.3820 0.2111 0.5038 0.2076 0.6307 vit score 0.2437 0.7497 0.4082 0.5416 0.5058 0.6480 overal 0.1450 0.3772 0.2064 0.4332 0.2378 0.5281",
  223. "content_with_weight": "<table><caption>Table 1: OpenAGI task-solving performances under different settings for three closed-source LLMs. Boldface denotes the highest score under each learning schema.</caption>\n<tr><th rowspan=2 >Metrics</th><th >GPT-3.5-turbo</th><th></th><th >Claude-2</th><th >GPT-4</th></tr>\n<tr><th >Zero</th><th >Few</th><th >Zero Few</th><th >Zero Few</th></tr>\n<tr><td >CLIP Score</td><td >0.0</td><td >0.0</td><td >0.0 0.2543</td><td >0.0 0.3055</td></tr>\n<tr><td >BERT Score</td><td >0.1914</td><td >0.3820</td><td >0.2111 0.5038</td><td >0.2076 0.6307</td></tr>\n<tr><td >ViT Score</td><td >0.2437</td><td >0.7497</td><td >0.4082 0.5416</td><td >0.5058 0.6480</td></tr>\n<tr><td >Overall</td><td >0.1450</td><td >0.3772</td><td >0.2064 0.4332</td><td >0.2378 0.5281</td></tr>\n</table>",
  224. "doc_id": "c790da40ea8911ee928e0242ac180005",
  225. "docnm_kwd": "OpenAGI When LLM Meets Domain Experts.pdf",
  226. "img_id": "afab9fdad6e511eebdb20242ac180006-d0bc7892c3ec4aeac071544fd56730a8",
  227. "important_kwd": [],
  228. "kb_id": "afab9fdad6e511eebdb20242ac180006",
  229. "positions": [
  230. [
  231. 9.0,
  232. 159.9383341471354,
  233. 472.1773274739583,
  234. 223.58013916015625,
  235. 307.86692301432294
  236. ]
  237. ],
  238. "similarity": 0.7310340654129031,
  239. "term_similarity": 0.7671974387781668,
  240. "vector_similarity": 0.40556370512552886
  241. },
  242. {
  243. "chunk_id": "7e2345d440383b756670e1b0f43a7007",
  244. "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 .",
  245. "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.",
  246. "doc_id": "c790da40ea8911ee928e0242ac180005",
  247. "docnm_kwd": "OpenAGI When LLM Meets Domain Experts.pdf",
  248. "img_id": "afab9fdad6e511eebdb20242ac180006-7e2345d440383b756670e1b0f43a7007",
  249. "important_kwd": [],
  250. "kb_id": "afab9fdad6e511eebdb20242ac180006",
  251. "positions": [
  252. [
  253. 8.0,
  254. 107.3,
  255. 508.90000000000003,
  256. 686.3,
  257. 697.0
  258. ]
  259. ],
  260. "similarity": 0.6691508616357027,
  261. "term_similarity": 0.6999011754270821,
  262. "vector_similarity": 0.39239803751328806
  263. }
  264. ],
  265. "doc_aggs": {
  266. "OpenAGI When LLM Meets Domain Experts.pdf": 4
  267. },
  268. "total": 8
  269. }
  270. },
  271. "retcode": 0,
  272. "retmsg": "success"
  273. }
  274. ```
  275. - **answer**: The replay of the chat bot.
  276. - **reference**:
  277. - chunks: Every item in it refer to the corresponding message in answer.
  278. - content_with_weight: The content of chunk.
  279. - docnm_kwd: the document name.
  280. - img_id: the image id of the chunk. It is an optional field only for PDF/pptx/picture. And accessed by 'GET' /document/get/\<id\>.
  281. - positions: [page_number, [upleft corner(x, y)], [right bottom(x, y)]], the chunk position, only for PDF.
  282. - similarity: the hybrid similarity.
  283. - term_similarity: keyword simimlarity
  284. - vector_similarity: embedding similarity
  285. - doc_aggs:
  286. - doc_id: the document can be accessed by 'GET' /document/get/\<id\>
  287. - doc_name: the file name
  288. - count: the chunk number hit in this document.
  289. ## Get document content or image
  290. This is usually used when display content of citation.
  291. ### Path: /api/document/get/\<id\>
  292. ### Method: GET
  293. ## Upload file
  294. This is usually used when upload a file to.
  295. ### Path: /api/document/upload/
  296. ### Method: POST
  297. ### Parameter:
  298. | name | type | optional | description |
  299. |-----------|--------|----------|---------------------------------------------------------|
  300. | file | file | No | Upload file. |
  301. | kb_name | string | No | Choose the upload knowledge base name. |
  302. | parser_id | string | Yes | Choose the parsing method. |
  303. | run | string | Yes | Parsing will start automatically when the value is "1". |
  304. ### Response
  305. ```json
  306. {
  307. "data": {
  308. "chunk_num": 0,
  309. "create_date": "Thu, 25 Apr 2024 14:30:06 GMT",
  310. "create_time": 1714026606921,
  311. "created_by": "553ec818fd5711ee8ea63043d7ed348e",
  312. "id": "41e9324602cd11ef9f5f3043d7ed348e",
  313. "kb_id": "06802686c0a311ee85d6246e9694c130",
  314. "location": "readme.txt",
  315. "name": "readme.txt",
  316. "parser_config": {
  317. "field_map": {
  318. },
  319. "pages": [
  320. [
  321. 0,
  322. 1000000
  323. ]
  324. ]
  325. },
  326. "parser_id": "general",
  327. "process_begin_at": null,
  328. "process_duation": 0.0,
  329. "progress": 0.0,
  330. "progress_msg": "",
  331. "run": "0",
  332. "size": 929,
  333. "source_type": "local",
  334. "status": "1",
  335. "thumbnail": null,
  336. "token_num": 0,
  337. "type": "doc",
  338. "update_date": "Thu, 25 Apr 2024 14:30:06 GMT",
  339. "update_time": 1714026606921
  340. },
  341. "retcode": 0,
  342. "retmsg": "success"
  343. }
  344. ```
  345. ## Get document chunks
  346. Get the chunks of the document based on doc_name or doc_id.
  347. ### Path: /api/list_chunks/
  348. ### Method: POST
  349. ### Parameter:
  350. | Name | Type | Optional | Description |
  351. |----------|--------|----------|---------------------------------|
  352. | `doc_name` | string | Yes | The name of the document in the knowledge base. It must not be empty if `doc_id` is not set.|
  353. | `doc_id` | string | Yes | The ID of the document in the knowledge base. It must not be empty if `doc_name` is not set.|
  354. ### Response
  355. ```json
  356. {
  357. "data": [
  358. {
  359. "content": "Figure 14: Per-request neural-net processingof RL-Cache.\n103\n(sn)\nCPU\n 102\nGPU\n8101\n100\n8\n16 64 256 1K\n4K",
  360. "doc_name": "RL-Cache.pdf",
  361. "img_id": "0335167613f011ef91240242ac120006-b46c3524952f82dbe061ce9b123f2211"
  362. },
  363. {
  364. "content": "4.3 ProcessingOverheadof RL-CacheACKNOWLEDGMENTSThis section evaluates how e￿ectively our RL-Cache implemen-tation leverages modern multi-core CPUs and GPUs to keep the per-request neural-net processing overhead low. Figure 14 depictsThis researchwas supported inpart by the Regional Government of Madrid (grant P2018/TCS-4499, EdgeData-CM)andU.S. National Science Foundation (grants CNS-1763617 andCNS-1717179).REFERENCES",
  365. "doc_name": "RL-Cache.pdf",
  366. "img_id": "0335167613f011ef91240242ac120006-d4c12c43938eb55d2d8278eea0d7e6d7"
  367. }
  368. ],
  369. "retcode": 0,
  370. "retmsg": "success"
  371. }
  372. ```