template.en.mdx 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300
  1. import { CodeGroup } from '@/app/components/develop/code.tsx'
  2. import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '@/app/components/develop/md.tsx'
  3. # Knowledge API
  4. <div>
  5. ### Authentication
  6. Service API of Dify authenticates using an `API-Key`.
  7. It is suggested that developers store the `API-Key` in the backend instead of sharing or storing it in the client side to avoid the leakage of the `API-Key`, which may lead to property loss.
  8. All API requests should include your `API-Key` in the **`Authorization`** HTTP Header, as shown below:
  9. <CodeGroup title="Code">
  10. ```javascript
  11. Authorization: Bearer {API_KEY}
  12. ```
  13. </CodeGroup>
  14. </div>
  15. ---
  16. <Heading
  17. url='/datasets/{dataset_id}/document/create_by_text'
  18. method='POST'
  19. title='Create a document from text'
  20. name='#create_by_text'
  21. />
  22. <Row>
  23. <Col>
  24. This api is based on an existing Knowledge and creates a new document through text based on this Knowledge.
  25. ### Params
  26. <Properties>
  27. <Property name='dataset_id' type='string' key='dataset_id'>
  28. Knowledge ID
  29. </Property>
  30. </Properties>
  31. ### Request Body
  32. <Properties>
  33. <Property name='name' type='string' key='name'>
  34. Document name
  35. </Property>
  36. <Property name='text' type='string' key='text'>
  37. Document content
  38. </Property>
  39. <Property name='indexing_technique' type='string' key='indexing_technique'>
  40. Index mode
  41. - <code>high_quality</code> High quality: embedding using embedding model, built as vector database index
  42. - <code>economy</code> Economy: Build using inverted index of Keyword Table Index
  43. </Property>
  44. <Property name='process_rule' type='object' key='process_rule'>
  45. Processing rules
  46. - <code>mode</code> (string) Cleaning, segmentation mode, automatic / custom
  47. - <code>rules</code> (object) Custom rules (in automatic mode, this field is empty)
  48. - <code>pre_processing_rules</code> (array[object]) Preprocessing rules
  49. - <code>id</code> (string) Unique identifier for the preprocessing rule
  50. - enumerate
  51. - <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
  52. - <code>remove_urls_emails</code> Delete URL, email address
  53. - <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
  54. - <code>segmentation</code> (object) segmentation rules
  55. - <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
  56. - <code>max_tokens</code> Maximum length (token) defaults to 1000
  57. </Property>
  58. </Properties>
  59. </Col>
  60. <Col sticky>
  61. <CodeGroup
  62. title="Request"
  63. tag="POST"
  64. label="/datasets/{dataset_id}/document/create_by_text"
  65. targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_text' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "text","text": "text","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}}'`}
  66. >
  67. ```bash {{ title: 'cURL' }}
  68. curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_text' \
  69. --header 'Authorization: Bearer {api_key}' \
  70. --header 'Content-Type: application/json' \
  71. --data-raw '{
  72. "name": "text",
  73. "text": "text",
  74. "indexing_technique": "high_quality",
  75. "process_rule": {
  76. "mode": "automatic"
  77. }
  78. }'
  79. ```
  80. </CodeGroup>
  81. <CodeGroup title="Response">
  82. ```json {{ title: 'Response' }}
  83. {
  84. "document": {
  85. "id": "",
  86. "position": 1,
  87. "data_source_type": "upload_file",
  88. "data_source_info": {
  89. "upload_file_id": ""
  90. },
  91. "dataset_process_rule_id": "",
  92. "name": "text.txt",
  93. "created_from": "api",
  94. "created_by": "",
  95. "created_at": 1695690280,
  96. "tokens": 0,
  97. "indexing_status": "waiting",
  98. "error": null,
  99. "enabled": true,
  100. "disabled_at": null,
  101. "disabled_by": null,
  102. "archived": false,
  103. "display_status": "queuing",
  104. "word_count": 0,
  105. "hit_count": 0,
  106. "doc_form": "text_model"
  107. },
  108. "batch": ""
  109. }
  110. ```
  111. </CodeGroup>
  112. </Col>
  113. </Row>
  114. ---
  115. <Heading
  116. url='/datasets/{dataset_id}/document/create_by_file'
  117. method='POST'
  118. title='Create documents from files'
  119. name='#create_by_file'
  120. />
  121. <Row>
  122. <Col>
  123. This api is based on an existing Knowledge and creates a new document through a file based on this Knowledge.
  124. ### Params
  125. <Properties>
  126. <Property name='dataset_id' type='string' key='dataset_id'>
  127. Knowledge ID
  128. </Property>
  129. </Properties>
  130. ### Request Body
  131. <Properties>
  132. <Property name='data' type='multipart/form-data json string' key='data'>
  133. - original_document_id Source document ID (optional)
  134. - Used to re-upload the document or modify the document cleaning and segmentation configuration. The missing information is copied from the source document
  135. - The source document cannot be an archived document
  136. - When original_document_id is passed in, the update operation is performed on behalf of the document. process_rule is a fillable item. If not filled in, the segmentation method of the source document will be used by default
  137. - When original_document_id is not passed in, the new operation is performed on behalf of the document, and process_rule is required
  138. - indexing_technique Index mode
  139. - <code>high_quality</code> High quality: embedding using embedding model, built as vector database index
  140. - <code>economy</code> Economy: Build using inverted index of Keyword Table Index
  141. - process_rule Processing rules
  142. - <code>mode</code> (string) Cleaning, segmentation mode, automatic / custom
  143. - <code>rules</code> (object) Custom rules (in automatic mode, this field is empty)
  144. - <code>pre_processing_rules</code> (array[object]) Preprocessing rules
  145. - <code>id</code> (string) Unique identifier for the preprocessing rule
  146. - enumerate
  147. - <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
  148. - <code>remove_urls_emails</code> Delete URL, email address
  149. - <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
  150. - <code>segmentation</code> (object) segmentation rules
  151. - <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
  152. - <code>max_tokens</code> Maximum length (token) defaults to 1000
  153. </Property>
  154. <Property name='file' type='multipart/form-data' key='file'>
  155. Files that need to be uploaded.
  156. </Property>
  157. </Properties>
  158. </Col>
  159. <Col sticky>
  160. <CodeGroup
  161. title="Request"
  162. tag="POST"
  163. label="/datasets/{dataset_id}/document/create_by_file"
  164. targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_file' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'data="{"indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \\\n--form 'file=@"/path/to/file"'`}
  165. >
  166. ```bash {{ title: 'cURL' }}
  167. curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_file' \
  168. --header 'Authorization: Bearer {api_key}' \
  169. --form 'data="{\"name\":\"Dify\",\"indexing_technique\":\"high_quality\",\"process_rule\":{\"rules\":{\"pre_processing_rules\":[{\"id\":\"remove_extra_spaces\",\"enabled\":true},{\"id\":\"remove_urls_emails\",\"enabled\":true}],\"segmentation\":{\"separator\":\"###\",\"max_tokens\":500}},\"mode\":\"custom\"}}";type=text/plain' \
  170. --form 'file=@"/path/to/file"'
  171. ```
  172. </CodeGroup>
  173. <CodeGroup title="Response">
  174. ```json {{ title: 'Response' }}
  175. {
  176. "document": {
  177. "id": "",
  178. "position": 1,
  179. "data_source_type": "upload_file",
  180. "data_source_info": {
  181. "upload_file_id": ""
  182. },
  183. "dataset_process_rule_id": "",
  184. "name": "Dify.txt",
  185. "created_from": "api",
  186. "created_by": "",
  187. "created_at": 1695308667,
  188. "tokens": 0,
  189. "indexing_status": "waiting",
  190. "error": null,
  191. "enabled": true,
  192. "disabled_at": null,
  193. "disabled_by": null,
  194. "archived": false,
  195. "display_status": "queuing",
  196. "word_count": 0,
  197. "hit_count": 0,
  198. "doc_form": "text_model"
  199. },
  200. "batch": ""
  201. }
  202. ```
  203. </CodeGroup>
  204. </Col>
  205. </Row>
  206. ---
  207. <Heading
  208. url='/datasets'
  209. method='POST'
  210. title='Create an empty Knowledge'
  211. name='#create_empty_dataset'
  212. />
  213. <Row>
  214. <Col>
  215. ### Request Body
  216. <Properties>
  217. <Property name='name' type='string' key='name'>
  218. Knowledge name
  219. </Property>
  220. <Property name='permission' type='string' key='permission'>
  221. Permission
  222. - <code>only_me</code> Only me
  223. - <code>all_team_members</code> All team members
  224. - <code>partial_members</code> Partial members
  225. </Property>
  226. </Properties>
  227. </Col>
  228. <Col sticky>
  229. <CodeGroup
  230. title="Request"
  231. tag="POST"
  232. label="/datasets"
  233. targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "name", "permission": "only_me"}'`}
  234. >
  235. ```bash {{ title: 'cURL' }}
  236. curl --location --request POST '${apiBaseUrl}/v1/datasets' \
  237. --header 'Authorization: Bearer {api_key}' \
  238. --header 'Content-Type: application/json' \
  239. --data-raw '{
  240. "name": "name",
  241. "permission": "only_me"
  242. }'
  243. ```
  244. </CodeGroup>
  245. <CodeGroup title="Response">
  246. ```json {{ title: 'Response' }}
  247. {
  248. "id": "",
  249. "name": "name",
  250. "description": null,
  251. "provider": "vendor",
  252. "permission": "only_me",
  253. "data_source_type": null,
  254. "indexing_technique": null,
  255. "app_count": 0,
  256. "document_count": 0,
  257. "word_count": 0,
  258. "created_by": "",
  259. "created_at": 1695636173,
  260. "updated_by": "",
  261. "updated_at": 1695636173,
  262. "embedding_model": null,
  263. "embedding_model_provider": null,
  264. "embedding_available": null
  265. }
  266. ```
  267. </CodeGroup>
  268. </Col>
  269. </Row>
  270. ---
  271. <Heading
  272. url='/datasets'
  273. method='GET'
  274. title='Knowledge list'
  275. name='#dataset_list'
  276. />
  277. <Row>
  278. <Col>
  279. ### Query
  280. <Properties>
  281. <Property name='page' type='string' key='page'>
  282. Page number
  283. </Property>
  284. <Property name='limit' type='string' key='limit'>
  285. Number of items returned, default 20, range 1-100
  286. </Property>
  287. </Properties>
  288. </Col>
  289. <Col sticky>
  290. <CodeGroup
  291. title="Request"
  292. tag="POST"
  293. label="/datasets"
  294. targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets?page=1&limit=20' \\\n--header 'Authorization: Bearer {api_key}'`}
  295. >
  296. ```bash {{ title: 'cURL' }}
  297. curl --location --request GET '${props.apiBaseUrl}/datasets?page=1&limit=20' \
  298. --header 'Authorization: Bearer {api_key}'
  299. ```
  300. </CodeGroup>
  301. <CodeGroup title="Response">
  302. ```json {{ title: 'Response' }}
  303. {
  304. "data": [
  305. {
  306. "id": "",
  307. "name": "name",
  308. "description": "desc",
  309. "permission": "only_me",
  310. "data_source_type": "upload_file",
  311. "indexing_technique": "",
  312. "app_count": 2,
  313. "document_count": 10,
  314. "word_count": 1200,
  315. "created_by": "",
  316. "created_at": "",
  317. "updated_by": "",
  318. "updated_at": ""
  319. },
  320. ...
  321. ],
  322. "has_more": true,
  323. "limit": 20,
  324. "total": 50,
  325. "page": 1
  326. }
  327. ```
  328. </CodeGroup>
  329. </Col>
  330. </Row>
  331. ---
  332. <Heading
  333. url='/datasets/{dataset_id}'
  334. method='DELETE'
  335. title='Delete knowledge'
  336. name='#delete_dataset'
  337. />
  338. <Row>
  339. <Col>
  340. ### Params
  341. <Properties>
  342. <Property name='dataset_id' type='string' key='dataset_id'>
  343. Knowledge ID
  344. </Property>
  345. </Properties>
  346. </Col>
  347. <Col sticky>
  348. <CodeGroup
  349. title="Request"
  350. tag="DELETE"
  351. label="/datasets/{dataset_id}"
  352. targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}' \\\n--header 'Authorization: Bearer {api_key}'`}
  353. >
  354. ```bash {{ title: 'cURL' }}
  355. curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}' \
  356. --header 'Authorization: Bearer {api_key}'
  357. ```
  358. </CodeGroup>
  359. <CodeGroup title="Response">
  360. ```text {{ title: 'Response' }}
  361. 204 No Content
  362. ```
  363. </CodeGroup>
  364. </Col>
  365. </Row>
  366. ---
  367. <Heading
  368. url='/datasets/{dataset_id}/documents/{document_id}/update_by_text'
  369. method='POST'
  370. title='Update document via text'
  371. name='#update_by_text'
  372. />
  373. <Row>
  374. <Col>
  375. This api is based on an existing Knowledge and updates the document through text based on this Knowledge.
  376. ### Params
  377. <Properties>
  378. <Property name='dataset_id' type='string' key='dataset_id'>
  379. Knowledge ID
  380. </Property>
  381. <Property name='document_id' type='string' key='document_id'>
  382. Document ID
  383. </Property>
  384. </Properties>
  385. ### Request Body
  386. <Properties>
  387. <Property name='name' type='string' key='name'>
  388. Document name (optional)
  389. </Property>
  390. <Property name='text' type='string' key='text'>
  391. Document content (optional)
  392. </Property>
  393. <Property name='process_rule' type='object' key='process_rule'>
  394. Processing rules
  395. - <code>mode</code> (string) Cleaning, segmentation mode, automatic / custom
  396. - <code>rules</code> (object) Custom rules (in automatic mode, this field is empty)
  397. - <code>pre_processing_rules</code> (array[object]) Preprocessing rules
  398. - <code>id</code> (string) Unique identifier for the preprocessing rule
  399. - enumerate
  400. - <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
  401. - <code>remove_urls_emails</code> Delete URL, email address
  402. - <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
  403. - <code>segmentation</code> (object) segmentation rules
  404. - <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
  405. - <code>max_tokens</code> Maximum length (token) defaults to 1000
  406. </Property>
  407. </Properties>
  408. </Col>
  409. <Col sticky>
  410. <CodeGroup
  411. title="Request"
  412. tag="POST"
  413. label="/datasets/{dataset_id}/documents/{document_id}/update_by_text"
  414. targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_text' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "name","text": "text"}'`}
  415. >
  416. ```bash {{ title: 'cURL' }}
  417. curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_text' \
  418. --header 'Authorization: Bearer {api_key}' \
  419. --header 'Content-Type: application/json' \
  420. --data-raw '{
  421. "name": "name",
  422. "text": "text"
  423. }'
  424. ```
  425. </CodeGroup>
  426. <CodeGroup title="Response">
  427. ```json {{ title: 'Response' }}
  428. {
  429. "document": {
  430. "id": "",
  431. "position": 1,
  432. "data_source_type": "upload_file",
  433. "data_source_info": {
  434. "upload_file_id": ""
  435. },
  436. "dataset_process_rule_id": "",
  437. "name": "name.txt",
  438. "created_from": "api",
  439. "created_by": "",
  440. "created_at": 1695308667,
  441. "tokens": 0,
  442. "indexing_status": "waiting",
  443. "error": null,
  444. "enabled": true,
  445. "disabled_at": null,
  446. "disabled_by": null,
  447. "archived": false,
  448. "display_status": "queuing",
  449. "word_count": 0,
  450. "hit_count": 0,
  451. "doc_form": "text_model"
  452. },
  453. "batch": ""
  454. }
  455. ```
  456. </CodeGroup>
  457. </Col>
  458. </Row>
  459. ---
  460. <Heading
  461. url='/datasets/{dataset_id}/documents/{document_id}/update_by_file'
  462. method='POST'
  463. title='Update a document from a file'
  464. name='#update_by_file'
  465. />
  466. <Row>
  467. <Col>
  468. This api is based on an existing Knowledge, and updates documents through files based on this Knowledge
  469. ### Params
  470. <Properties>
  471. <Property name='dataset_id' type='string' key='dataset_id'>
  472. Knowledge ID
  473. </Property>
  474. <Property name='document_id' type='string' key='document_id'>
  475. Document ID
  476. </Property>
  477. </Properties>
  478. ### Request Body
  479. <Properties>
  480. <Property name='name' type='string' key='name'>
  481. Document name (optional)
  482. </Property>
  483. <Property name='file' type='multipart/form-data' key='file'>
  484. Files to be uploaded
  485. </Property>
  486. <Property name='process_rule' type='object' key='process_rule'>
  487. Processing rules
  488. - <code>mode</code> (string) Cleaning, segmentation mode, automatic / custom
  489. - <code>rules</code> (object) Custom rules (in automatic mode, this field is empty)
  490. - <code>pre_processing_rules</code> (array[object]) Preprocessing rules
  491. - <code>id</code> (string) Unique identifier for the preprocessing rule
  492. - enumerate
  493. - <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
  494. - <code>remove_urls_emails</code> Delete URL, email address
  495. - <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
  496. - <code>segmentation</code> (object) segmentation rules
  497. - <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
  498. - <code>max_tokens</code> Maximum length (token) defaults to 1000
  499. </Property>
  500. </Properties>
  501. </Col>
  502. <Col sticky>
  503. <CodeGroup
  504. title="Request"
  505. tag="POST"
  506. label="/datasets/{dataset_id}/documents/{document_id}/update_by_file"
  507. targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_file' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'data="{"name":"Dify","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \\\n--form 'file=@"/path/to/file"'`}
  508. >
  509. ```bash {{ title: 'cURL' }}
  510. curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_file' \
  511. --header 'Authorization: Bearer {api_key}' \
  512. --form 'data="{\"name\":\"Dify\",\"indexing_technique\":\"high_quality\",\"process_rule\":{\"rules\":{\"pre_processing_rules\":[{\"id\":\"remove_extra_spaces\",\"enabled\":true},{\"id\":\"remove_urls_emails\",\"enabled\":true}],\"segmentation\":{\"separator\":\"###\",\"max_tokens\":500}},\"mode\":\"custom\"}}";type=text/plain' \
  513. --form 'file=@"/path/to/file"'
  514. ```
  515. </CodeGroup>
  516. <CodeGroup title="Response">
  517. ```json {{ title: 'Response' }}
  518. {
  519. "document": {
  520. "id": "",
  521. "position": 1,
  522. "data_source_type": "upload_file",
  523. "data_source_info": {
  524. "upload_file_id": ""
  525. },
  526. "dataset_process_rule_id": "",
  527. "name": "Dify.txt",
  528. "created_from": "api",
  529. "created_by": "",
  530. "created_at": 1695308667,
  531. "tokens": 0,
  532. "indexing_status": "waiting",
  533. "error": null,
  534. "enabled": true,
  535. "disabled_at": null,
  536. "disabled_by": null,
  537. "archived": false,
  538. "display_status": "queuing",
  539. "word_count": 0,
  540. "hit_count": 0,
  541. "doc_form": "text_model"
  542. },
  543. "batch": "20230921150427533684"
  544. }
  545. ```
  546. </CodeGroup>
  547. </Col>
  548. </Row>
  549. ---
  550. <Heading
  551. url='/datasets/{dataset_id}/documents/{batch}/indexing-status'
  552. method='GET'
  553. title='Get document embedding status (progress)'
  554. name='#indexing_status'
  555. />
  556. <Row>
  557. <Col>
  558. ### Params
  559. <Properties>
  560. <Property name='dataset_id' type='string' key='dataset_id'>
  561. Knowledge ID
  562. </Property>
  563. <Property name='batch' type='string' key='batch'>
  564. Batch number of uploaded documents
  565. </Property>
  566. </Properties>
  567. </Col>
  568. <Col sticky>
  569. <CodeGroup
  570. title="Request"
  571. tag="GET"
  572. label="/datasets/{dataset_id}/documents/{batch}/indexing-status"
  573. targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{batch}/indexing-status' \\\n--header 'Authorization: Bearer {api_key}'`}
  574. >
  575. ```bash {{ title: 'cURL' }}
  576. curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{batch}/indexing-status' \
  577. --header 'Authorization: Bearer {api_key}' \
  578. ```
  579. </CodeGroup>
  580. <CodeGroup title="Response">
  581. ```json {{ title: 'Response' }}
  582. {
  583. "data":[{
  584. "id": "",
  585. "indexing_status": "indexing",
  586. "processing_started_at": 1681623462.0,
  587. "parsing_completed_at": 1681623462.0,
  588. "cleaning_completed_at": 1681623462.0,
  589. "splitting_completed_at": 1681623462.0,
  590. "completed_at": null,
  591. "paused_at": null,
  592. "error": null,
  593. "stopped_at": null,
  594. "completed_segments": 24,
  595. "total_segments": 100
  596. }]
  597. }
  598. ```
  599. </CodeGroup>
  600. </Col>
  601. </Row>
  602. ---
  603. <Heading
  604. url='/datasets/{dataset_id}/documents/{document_id}'
  605. method='DELETE'
  606. title='Delete document'
  607. name='#delete_document'
  608. />
  609. <Row>
  610. <Col>
  611. ### Params
  612. <Properties>
  613. <Property name='dataset_id' type='string' key='dataset_id'>
  614. Knowledge ID
  615. </Property>
  616. <Property name='document_id' type='string' key='document_id'>
  617. Document ID
  618. </Property>
  619. </Properties>
  620. </Col>
  621. <Col sticky>
  622. <CodeGroup
  623. title="Request"
  624. tag="DELETE"
  625. label="/datasets/{dataset_id}/documents/{document_id}"
  626. targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}' \\\n--header 'Authorization: Bearer {api_key}'`}
  627. >
  628. ```bash {{ title: 'cURL' }}
  629. curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}' \
  630. --header 'Authorization: Bearer {api_key}' \
  631. ```
  632. </CodeGroup>
  633. <CodeGroup title="Response">
  634. ```json {{ title: 'Response' }}
  635. {
  636. "result": "success"
  637. }
  638. ```
  639. </CodeGroup>
  640. </Col>
  641. </Row>
  642. ---
  643. <Heading
  644. url='/datasets/{dataset_id}/documents'
  645. method='GET'
  646. title='Knowledge document list'
  647. name='#dataset_document_list'
  648. />
  649. <Row>
  650. <Col>
  651. ### Params
  652. <Properties>
  653. <Property name='dataset_id' type='string' key='dataset_id'>
  654. Knowledge ID
  655. </Property>
  656. </Properties>
  657. ### Query
  658. <Properties>
  659. <Property name='keyword' type='string' key='keyword'>
  660. Search keywords, currently only search document names(optional)
  661. </Property>
  662. <Property name='page' type='string' key='page'>
  663. Page number(optional)
  664. </Property>
  665. <Property name='limit' type='string' key='limit'>
  666. Number of items returned, default 20, range 1-100(optional)
  667. </Property>
  668. </Properties>
  669. </Col>
  670. <Col sticky>
  671. <CodeGroup
  672. title="Request"
  673. tag="GET"
  674. label="/datasets/{dataset_id}/documents"
  675. targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents' \\\n--header 'Authorization: Bearer {api_key}'`}
  676. >
  677. ```bash {{ title: 'cURL' }}
  678. curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents' \
  679. --header 'Authorization: Bearer {api_key}' \
  680. ```
  681. </CodeGroup>
  682. <CodeGroup title="Response">
  683. ```json {{ title: 'Response' }}
  684. {
  685. "data": [
  686. {
  687. "id": "",
  688. "position": 1,
  689. "data_source_type": "file_upload",
  690. "data_source_info": null,
  691. "dataset_process_rule_id": null,
  692. "name": "dify",
  693. "created_from": "",
  694. "created_by": "",
  695. "created_at": 1681623639,
  696. "tokens": 0,
  697. "indexing_status": "waiting",
  698. "error": null,
  699. "enabled": true,
  700. "disabled_at": null,
  701. "disabled_by": null,
  702. "archived": false
  703. },
  704. ],
  705. "has_more": false,
  706. "limit": 20,
  707. "total": 9,
  708. "page": 1
  709. }
  710. ```
  711. </CodeGroup>
  712. </Col>
  713. </Row>
  714. ---
  715. <Heading
  716. url='/datasets/{dataset_id}/documents/{document_id}/segments'
  717. method='POST'
  718. title='Add segment'
  719. name='#create_new_segment'
  720. />
  721. <Row>
  722. <Col>
  723. ### Params
  724. <Properties>
  725. <Property name='dataset_id' type='string' key='dataset_id'>
  726. Knowledge ID
  727. </Property>
  728. <Property name='document_id' type='string' key='document_id'>
  729. Document ID
  730. </Property>
  731. </Properties>
  732. ### Request Body
  733. <Properties>
  734. <Property name='segments' type='object list' key='segments'>
  735. - <code>content</code> (text) Text content/question content, required
  736. - <code>answer</code> (text) Answer content, if the mode of the Knowledge is qa mode, pass the value(optional)
  737. - <code>keywords</code> (list) Keywords(optional)
  738. </Property>
  739. </Properties>
  740. </Col>
  741. <Col sticky>
  742. <CodeGroup
  743. title="Request"
  744. tag="POST"
  745. label="/datasets/{dataset_id}/documents/{document_id}/segments"
  746. targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"segments": [{"content": "1","answer": "1","keywords": ["a"]}]}'`}
  747. >
  748. ```bash {{ title: 'cURL' }}
  749. curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments' \
  750. --header 'Authorization: Bearer {api_key}' \
  751. --header 'Content-Type: application/json' \
  752. --data-raw '{
  753. "segments": [
  754. {
  755. "content": "1",
  756. "answer": "1",
  757. "keywords": ["a"]
  758. }
  759. ]
  760. }'
  761. ```
  762. </CodeGroup>
  763. <CodeGroup title="Response">
  764. ```json {{ title: 'Response' }}
  765. {
  766. "data": [{
  767. "id": "",
  768. "position": 1,
  769. "document_id": "",
  770. "content": "1",
  771. "answer": "1",
  772. "word_count": 25,
  773. "tokens": 0,
  774. "keywords": [
  775. "a"
  776. ],
  777. "index_node_id": "",
  778. "index_node_hash": "",
  779. "hit_count": 0,
  780. "enabled": true,
  781. "disabled_at": null,
  782. "disabled_by": null,
  783. "status": "completed",
  784. "created_by": "",
  785. "created_at": 1695312007,
  786. "indexing_at": 1695312007,
  787. "completed_at": 1695312007,
  788. "error": null,
  789. "stopped_at": null
  790. }],
  791. "doc_form": "text_model"
  792. }
  793. ```
  794. </CodeGroup>
  795. </Col>
  796. </Row>
  797. ---
  798. <Heading
  799. url='/datasets/{dataset_id}/documents/{document_id}/segments'
  800. method='GET'
  801. title='get documents segments'
  802. name='#get_segment'
  803. />
  804. <Row>
  805. <Col>
  806. ### Path
  807. <Properties>
  808. <Property name='dataset_id' type='string' key='dataset_id'>
  809. Knowledge ID
  810. </Property>
  811. <Property name='document_id' type='string' key='document_id'>
  812. Document ID
  813. </Property>
  814. </Properties>
  815. ### Query
  816. <Properties>
  817. <Property name='keyword' type='string' key='keyword'>
  818. keyword,choosable
  819. </Property>
  820. <Property name='status' type='string' key='status'>
  821. Search status,completed
  822. </Property>
  823. </Properties>
  824. </Col>
  825. <Col sticky>
  826. <CodeGroup
  827. title="Request"
  828. tag="GET"
  829. label="/datasets/{dataset_id}/documents/{document_id}/segments"
  830. targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'`}
  831. >
  832. ```bash {{ title: 'cURL' }}
  833. curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments' \
  834. --header 'Authorization: Bearer {api_key}' \
  835. --header 'Content-Type: application/json'
  836. ```
  837. </CodeGroup>
  838. <CodeGroup title="Response">
  839. ```json {{ title: 'Response' }}
  840. {
  841. "data": [{
  842. "id": "",
  843. "position": 1,
  844. "document_id": "",
  845. "content": "1",
  846. "answer": "1",
  847. "word_count": 25,
  848. "tokens": 0,
  849. "keywords": [
  850. "a"
  851. ],
  852. "index_node_id": "",
  853. "index_node_hash": "",
  854. "hit_count": 0,
  855. "enabled": true,
  856. "disabled_at": null,
  857. "disabled_by": null,
  858. "status": "completed",
  859. "created_by": "",
  860. "created_at": 1695312007,
  861. "indexing_at": 1695312007,
  862. "completed_at": 1695312007,
  863. "error": null,
  864. "stopped_at": null
  865. }],
  866. "doc_form": "text_model"
  867. }
  868. ```
  869. </CodeGroup>
  870. </Col>
  871. </Row>
  872. ---
  873. <Heading
  874. url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
  875. method='DELETE'
  876. title='delete document segment'
  877. name='#delete_segment'
  878. />
  879. <Row>
  880. <Col>
  881. ### Path
  882. <Properties>
  883. <Property name='dataset_id' type='string' key='dataset_id'>
  884. Knowledge ID
  885. </Property>
  886. <Property name='document_id' type='string' key='document_id'>
  887. Document ID
  888. </Property>
  889. <Property name='segment_id' type='string' key='segment_id'>
  890. Document Segment ID
  891. </Property>
  892. </Properties>
  893. </Col>
  894. <Col sticky>
  895. <CodeGroup
  896. title="Request"
  897. tag="DELETE"
  898. label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}"
  899. targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/segments/{segment_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'`}
  900. >
  901. ```bash {{ title: 'cURL' }}
  902. curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/segments/{segment_id}' \
  903. --header 'Authorization: Bearer {api_key}' \
  904. --header 'Content-Type: application/json'
  905. ```
  906. </CodeGroup>
  907. <CodeGroup title="Response">
  908. ```json {{ title: 'Response' }}
  909. {
  910. "result": "success"
  911. }
  912. ```
  913. </CodeGroup>
  914. </Col>
  915. </Row>
  916. ---
  917. <Heading
  918. url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
  919. method='POST'
  920. title='update document segment'
  921. name='#update_segment'
  922. />
  923. <Row>
  924. <Col>
  925. ### POST
  926. <Properties>
  927. <Property name='dataset_id' type='string' key='dataset_id'>
  928. Knowledge ID
  929. </Property>
  930. <Property name='document_id' type='string' key='document_id'>
  931. Document ID
  932. </Property>
  933. <Property name='segment_id' type='string' key='segment_id'>
  934. Document Segment ID
  935. </Property>
  936. </Properties>
  937. ### Request Body
  938. <Properties>
  939. <Property name='segment' type='object' key='segment'>
  940. - <code>content</code> (text) text content/question content,required
  941. - <code>answer</code> (text) Answer content, not required, passed if the Knowledge is in qa mode
  942. - <code>keywords</code> (list) keyword, not required
  943. - <code>enabled</code> (bool) false/true, not required
  944. </Property>
  945. </Properties>
  946. </Col>
  947. <Col sticky>
  948. <CodeGroup
  949. title="Request"
  950. tag="POST"
  951. label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}"
  952. targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'\\\n--data-raw '{\"segment\": {\"content\": \"1\",\"answer\": \"1\", \"keywords\": [\"a\"], \"enabled\": false}}'`}
  953. >
  954. ```bash {{ title: 'cURL' }}
  955. curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}' \
  956. --header 'Content-Type: application/json' \
  957. --data-raw '{
  958. "segment": {
  959. "content": "1",
  960. "answer": "1",
  961. "keywords": ["a"],
  962. "enabled": false
  963. }
  964. }'
  965. ```
  966. </CodeGroup>
  967. <CodeGroup title="Response">
  968. ```json {{ title: 'Response' }}
  969. {
  970. "data": [{
  971. "id": "",
  972. "position": 1,
  973. "document_id": "",
  974. "content": "1",
  975. "answer": "1",
  976. "word_count": 25,
  977. "tokens": 0,
  978. "keywords": [
  979. "a"
  980. ],
  981. "index_node_id": "",
  982. "index_node_hash": "",
  983. "hit_count": 0,
  984. "enabled": true,
  985. "disabled_at": null,
  986. "disabled_by": null,
  987. "status": "completed",
  988. "created_by": "",
  989. "created_at": 1695312007,
  990. "indexing_at": 1695312007,
  991. "completed_at": 1695312007,
  992. "error": null,
  993. "stopped_at": null
  994. }],
  995. "doc_form": "text_model"
  996. }
  997. ```
  998. </CodeGroup>
  999. </Col>
  1000. </Row>
  1001. ---
  1002. <Heading
  1003. url='/datasets/{dataset_id}/hit_testing'
  1004. method='POST'
  1005. title='Dataset hit testing'
  1006. name='#dataset_hit_testing'
  1007. />
  1008. <Row>
  1009. <Col>
  1010. ### Path
  1011. <Properties>
  1012. <Property name='dataset_id' type='string' key='dataset_id'>
  1013. Dataset ID
  1014. </Property>
  1015. </Properties>
  1016. ### Request Body
  1017. <Properties>
  1018. <Property name='query' type='string' key='query'>
  1019. retrieval keywordc
  1020. </Property>
  1021. <Property name='retrieval_model' type='object' key='retrieval_model'>
  1022. retrieval keyword(Optional, if not filled, it will be recalled according to the default method)
  1023. - <code>search_method</code> (text) Search method: One of the following four keywords is required
  1024. - <code>keyword_search</code> Keyword search
  1025. - <code>semantic_search</code> Semantic search
  1026. - <code>full_text_search</code> Full-text search
  1027. - <code>hybrid_search</code> Hybrid search
  1028. - <code>reranking_enable</code> (bool) Whether to enable reranking, optional, required if the search mode is semantic_search or hybrid_search
  1029. - <code>reranking_mode</code> (object) Rerank model configuration, optional, required if reranking is enabled
  1030. - <code>reranking_provider_name</code> (string) Rerank model provider
  1031. - <code>reranking_model_name</code> (string) Rerank model name
  1032. - <code>weights</code> (double) Semantic search weight setting in hybrid search mode
  1033. - <code>top_k</code> (integer) Number of results to return, optional
  1034. - <code>score_threshold_enabled</code> (bool) Whether to enable score threshold
  1035. - <code>score_threshold</code> (double) Score threshold
  1036. </Property>
  1037. <Property name='external_retrieval_model' type='object' key='external_retrieval_model'>
  1038. Unused field
  1039. </Property>
  1040. </Properties>
  1041. </Col>
  1042. <Col sticky>
  1043. <CodeGroup
  1044. title="Request"
  1045. tag="POST"
  1046. label="/datasets/{dataset_id}/hit_testing"
  1047. targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/hit_testing' \\\n--header 'Authorization: Bearer {api_key}'\\\n--header 'Content-Type: application/json'\\\n--data-raw '{
  1048. "query": "test",
  1049. "retrieval_model": {
  1050. "search_method": "keyword_search",
  1051. "reranking_enable": false,
  1052. "reranking_mode": null,
  1053. "reranking_model": {
  1054. "reranking_provider_name": "",
  1055. "reranking_model_name": ""
  1056. },
  1057. "weights": null,
  1058. "top_k": 1,
  1059. "score_threshold_enabled": false,
  1060. "score_threshold": null
  1061. }
  1062. }'`}
  1063. >
  1064. ```bash {{ title: 'cURL' }}
  1065. curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/hit_testing' \
  1066. --header 'Authorization: Bearer {api_key}' \
  1067. --header 'Content-Type: application/json' \
  1068. --data-raw '{
  1069. "query": "test",
  1070. "retrieval_model": {
  1071. "search_method": "keyword_search",
  1072. "reranking_enable": false,
  1073. "reranking_mode": null,
  1074. "reranking_model": {
  1075. "reranking_provider_name": "",
  1076. "reranking_model_name": ""
  1077. },
  1078. "weights": null,
  1079. "top_k": 2,
  1080. "score_threshold_enabled": false,
  1081. "score_threshold": null
  1082. }
  1083. }'
  1084. ```
  1085. </CodeGroup>
  1086. <CodeGroup title="Response">
  1087. ```json {{ title: 'Response' }}
  1088. {
  1089. "query": {
  1090. "content": "test"
  1091. },
  1092. "records": [
  1093. {
  1094. "segment": {
  1095. "id": "7fa6f24f-8679-48b3-bc9d-bdf28d73f218",
  1096. "position": 1,
  1097. "document_id": "a8c6c36f-9f5d-4d7a-8472-f5d7b75d71d2",
  1098. "content": "Operation guide",
  1099. "answer": null,
  1100. "word_count": 847,
  1101. "tokens": 280,
  1102. "keywords": [
  1103. "install",
  1104. "java",
  1105. "base",
  1106. "scripts",
  1107. "jdk",
  1108. "manual",
  1109. "internal",
  1110. "opens",
  1111. "add",
  1112. "vmoptions"
  1113. ],
  1114. "index_node_id": "39dd8443-d960-45a8-bb46-7275ad7fbc8e",
  1115. "index_node_hash": "0189157697b3c6a418ccf8264a09699f25858975578f3467c76d6bfc94df1d73",
  1116. "hit_count": 0,
  1117. "enabled": true,
  1118. "disabled_at": null,
  1119. "disabled_by": null,
  1120. "status": "completed",
  1121. "created_by": "dbcb1ab5-90c8-41a7-8b78-73b235eb6f6f",
  1122. "created_at": 1728734540,
  1123. "indexing_at": 1728734552,
  1124. "completed_at": 1728734584,
  1125. "error": null,
  1126. "stopped_at": null,
  1127. "document": {
  1128. "id": "a8c6c36f-9f5d-4d7a-8472-f5d7b75d71d2",
  1129. "data_source_type": "upload_file",
  1130. "name": "readme.txt",
  1131. "doc_type": null
  1132. }
  1133. },
  1134. "score": 3.730463140527718e-05,
  1135. "tsne_position": null
  1136. }
  1137. ]
  1138. }
  1139. ```
  1140. </CodeGroup>
  1141. </Col>
  1142. </Row>
  1143. ---
  1144. <Row>
  1145. <Col>
  1146. ### Error message
  1147. <Properties>
  1148. <Property name='code' type='string' key='code'>
  1149. Error code
  1150. </Property>
  1151. </Properties>
  1152. <Properties>
  1153. <Property name='status' type='number' key='status'>
  1154. Error status
  1155. </Property>
  1156. </Properties>
  1157. <Properties>
  1158. <Property name='message' type='string' key='message'>
  1159. Error message
  1160. </Property>
  1161. </Properties>
  1162. </Col>
  1163. <Col>
  1164. <CodeGroup title="Example">
  1165. ```json {{ title: 'Response' }}
  1166. {
  1167. "code": "no_file_uploaded",
  1168. "message": "Please upload your file.",
  1169. "status": 400
  1170. }
  1171. ```
  1172. </CodeGroup>
  1173. </Col>
  1174. </Row>
  1175. <table className="max-w-auto border-collapse border border-slate-400" style={{ maxWidth: 'none', width: 'auto' }}>
  1176. <thead style={{ background: '#f9fafc' }}>
  1177. <tr>
  1178. <th className="p-2 border border-slate-300">code</th>
  1179. <th className="p-2 border border-slate-300">status</th>
  1180. <th className="p-2 border border-slate-300">message</th>
  1181. </tr>
  1182. </thead>
  1183. <tbody>
  1184. <tr>
  1185. <td className="p-2 border border-slate-300">no_file_uploaded</td>
  1186. <td className="p-2 border border-slate-300">400</td>
  1187. <td className="p-2 border border-slate-300">Please upload your file.</td>
  1188. </tr>
  1189. <tr>
  1190. <td className="p-2 border border-slate-300">too_many_files</td>
  1191. <td className="p-2 border border-slate-300">400</td>
  1192. <td className="p-2 border border-slate-300">Only one file is allowed.</td>
  1193. </tr>
  1194. <tr>
  1195. <td className="p-2 border border-slate-300">file_too_large</td>
  1196. <td className="p-2 border border-slate-300">413</td>
  1197. <td className="p-2 border border-slate-300">File size exceeded.</td>
  1198. </tr>
  1199. <tr>
  1200. <td className="p-2 border border-slate-300">unsupported_file_type</td>
  1201. <td className="p-2 border border-slate-300">415</td>
  1202. <td className="p-2 border border-slate-300">File type not allowed.</td>
  1203. </tr>
  1204. <tr>
  1205. <td className="p-2 border border-slate-300">high_quality_dataset_only</td>
  1206. <td className="p-2 border border-slate-300">400</td>
  1207. <td className="p-2 border border-slate-300">Current operation only supports 'high-quality' datasets.</td>
  1208. </tr>
  1209. <tr>
  1210. <td className="p-2 border border-slate-300">dataset_not_initialized</td>
  1211. <td className="p-2 border border-slate-300">400</td>
  1212. <td className="p-2 border border-slate-300">The dataset is still being initialized or indexing. Please wait a moment.</td>
  1213. </tr>
  1214. <tr>
  1215. <td className="p-2 border border-slate-300">archived_document_immutable</td>
  1216. <td className="p-2 border border-slate-300">403</td>
  1217. <td className="p-2 border border-slate-300">The archived document is not editable.</td>
  1218. </tr>
  1219. <tr>
  1220. <td className="p-2 border border-slate-300">dataset_name_duplicate</td>
  1221. <td className="p-2 border border-slate-300">409</td>
  1222. <td className="p-2 border border-slate-300">The dataset name already exists. Please modify your dataset name.</td>
  1223. </tr>
  1224. <tr>
  1225. <td className="p-2 border border-slate-300">invalid_action</td>
  1226. <td className="p-2 border border-slate-300">400</td>
  1227. <td className="p-2 border border-slate-300">Invalid action.</td>
  1228. </tr>
  1229. <tr>
  1230. <td className="p-2 border border-slate-300">document_already_finished</td>
  1231. <td className="p-2 border border-slate-300">400</td>
  1232. <td className="p-2 border border-slate-300">The document has been processed. Please refresh the page or go to the document details.</td>
  1233. </tr>
  1234. <tr>
  1235. <td className="p-2 border border-slate-300">document_indexing</td>
  1236. <td className="p-2 border border-slate-300">400</td>
  1237. <td className="p-2 border border-slate-300">The document is being processed and cannot be edited.</td>
  1238. </tr>
  1239. <tr>
  1240. <td className="p-2 border border-slate-300">invalid_metadata</td>
  1241. <td className="p-2 border border-slate-300">400</td>
  1242. <td className="p-2 border border-slate-300">The metadata content is incorrect. Please check and verify.</td>
  1243. </tr>
  1244. </tbody>
  1245. </table>
  1246. <div className="pb-4" />