template.ja.mdx 70.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977
import { CodeGroup } from '@/app/components/develop/code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstruction, Paragraph } from '@/app/components/develop/md.tsx'

# ナレッジ API

<div>
  ### 認証

  Dify のサービス API は `API-Key` を使用して認証します。

  開発者は、`API-Key` をクライアント側で共有または保存するのではなく、バックエンドに保存することを推奨します。これにより、`API-Key` の漏洩による財産損失を防ぐことができます。

  すべての API リクエストには、以下のように **`Authorization`** HTTP ヘッダーに `API-Key` を含める必要があります:

  <CodeGroup title="コード">
    ```javascript
      Authorization: Bearer {API_KEY}

    ```
  </CodeGroup>
</div>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/document/create-by-text'
  method='POST'
  title='テキストからドキュメントを作成'
  name='#create-by-text'
/>
<Row>
  <Col>
    この API は既存のナレッジに基づいており、このナレッジを基にテキストを使用して新しいドキュメントを作成します。

    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='name' type='string' key='name'>
        ドキュメント名
      </Property>
      <Property name='text' type='string' key='text'>
        ドキュメント内容
      </Property>
      <Property name='indexing_technique' type='string' key='indexing_technique'>
        インデックスモード
          - <code>high_quality</code> 高品質: 埋め込みモデルを使用してベクトルデータベースインデックスを構築
          - <code>economy</code> 経済: キーワードテーブルインデックスの反転インデックスを構築
      </Property>
      <Property name='doc_form' type='string' key='doc_form'>
        インデックス化された内容の形式
          - <code>text_model</code> テキストドキュメントは直接埋め込まれます; `economy` モードではこの形式がデフォルト
          - <code>hierarchical_model</code> 親子モード
          - <code>qa_model</code> Q&A モード: 分割されたドキュメントの質問と回答ペアを生成し、質問を埋め込みます
      </Property>
      <Property name='doc_language' type='string' key='doc_language'>
        Q&A モードでは、ドキュメントの言語を指定します。例: <code>English</code>, <code>Chinese</code>
      </Property>
      <Property name='process_rule' type='object' key='process_rule'>
        処理ルール
          - <code>mode</code> (string) クリーニング、セグメンテーションモード、自動 / カスタム
          - <code>rules</code> (object) カスタムルール (自動モードでは、このフィールドは空)
            - <code>pre_processing_rules</code> (array[object]) 前処理ルール
              - <code>id</code> (string) 前処理ルールの一意識別子
                - 列挙
                  - <code>remove_extra_spaces</code> 連続するスペース、改行、タブを置換
                  - <code>remove_urls_emails</code> URL、メールアドレスを削除
              - <code>enabled</code> (bool) このルールを選択するかどうか。ドキュメント ID が渡されない場合、デフォルト値を表します。
            - <code>segmentation</code> (object) セグメンテーションルール
              - <code>separator</code> カスタムセグメント識別子。現在は 1 つの区切り文字のみ設定可能。デフォルトは \n
              - <code>max_tokens</code> 最大長 (トークン) デフォルトは 1000
            - <code>parent_mode</code> 親チャンクの検索モード: <code>full-doc</code> 全文検索 / <code>paragraph</code> 段落検索
            - <code>subchunk_segmentation</code> (object) 子チャンクルール
              - <code>separator</code> セグメンテーション識別子。現在は 1 つの区切り文字のみ許可。デフォルトは <code>***</code>
              - <code>max_tokens</code> 最大長 (トークン) は親チャンクの長さより短いことを検証する必要があります
              - <code>chunk_overlap</code> 隣接するチャンク間の重複を定義 (オプション)
      </Property>
      <PropertyInstruction>ナレッジベースにパラメータが設定されていない場合、最初のアップロードには以下のパラメータを提供する必要があります。提供されない場合、デフォルトパラメータが使用されます。</PropertyInstruction>
      <Property name='retrieval_model' type='object' key='retrieval_model'>
        検索モデル
          - <code>search_method</code> (string) 検索方法
            - <code>hybrid_search</code> ハイブリッド検索
            - <code>semantic_search</code> セマンティック検索
            - <code>full_text_search</code> 全文検索
          - <code>reranking_enable</code> (bool) 再ランキングを有効にするかどうか
          - <code>reranking_mode</code> (object) 再ランキングモデル構成
            - <code>reranking_provider_name</code> (string) 再ランキングモデルプロバイダー
            - <code>reranking_model_name</code> (string) 再ランキングモデル名
          - <code>top_k</code> (int) 返される結果の数
          - <code>score_threshold_enabled</code> (bool) スコア閾値を有効にするかどうか
          - <code>score_threshold</code> (float) スコア閾値
      </Property>
      <Property name='embedding_model' type='string' key='embedding_model'>
        埋め込みモデル名
      </Property>
      <Property name='embedding_model_provider' type='string' key='embedding_model_provider'>
        埋め込みモデルプロバイダー
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/document/create-by-text"
      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"}}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create-by-text' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "name": "text",
        "text": "text",
        "indexing_technique": "high_quality",
        "process_rule": {
            "mode": "automatic"
        }
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "document": {
        "id": "",
        "position": 1,
        "data_source_type": "upload_file",
        "data_source_info": {
            "upload_file_id": ""
        },
        "dataset_process_rule_id": "",
        "name": "text.txt",
        "created_from": "api",
        "created_by": "",
        "created_at": 1695690280,
        "tokens": 0,
        "indexing_status": "waiting",
        "error": null,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "archived": false,
        "display_status": "queuing",
        "word_count": 0,
        "hit_count": 0,
        "doc_form": "text_model"
      },
      "batch": ""
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/document/create-by-file'
  method='POST'
  title='ファイルからドキュメントを作成'
  name='#create-by-file'
/>
<Row>
  <Col>
    この API は既存のナレッジに基づいており、このナレッジを基にファイルを使用して新しいドキュメントを作成します。

    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='data' type='multipart/form-data json string' key='data'>
        - <code>original_document_id</code> 元のドキュメント ID (オプション)
          - ドキュメントを再アップロードまたはクリーニングとセグメンテーション構成を変更するために使用されます。欠落している情報は元のドキュメントからコピーされます。
          - 元のドキュメントはアーカイブされたドキュメントであってはなりません。
          - original_document_id が渡された場合、更新操作が実行されます。process_rule は入力可能な項目です。入力されない場合、元のドキュメントのセグメンテーション方法がデフォルトで使用されます。
          - original_document_id が渡されない場合、新しい操作が実行され、process_rule が必要です。

        - <code>indexing_technique</code> インデックスモード
          - <code>high_quality</code> 高品質: 埋め込みモデルを使用してベクトルデータベースインデックスを構築
          - <code>economy</code> 経済: キーワードテーブルインデックスの反転インデックスを構築

        - <code>doc_form</code> インデックス化された内容の形式
          - <code>text_model</code> テキストドキュメントは直接埋め込まれます; `economy` モードではこの形式がデフォルト
          - <code>hierarchical_model</code> 親子モード
          - <code>qa_model</code> Q&A モード: 分割されたドキュメントの質問と回答ペアを生成し、質問を埋め込みます

        - <code>doc_language</code> Q&A モードでは、ドキュメントの言語を指定します。例: <code>English</code>, <code>Chinese</code>

        - <code>process_rule</code> 処理ルール
          - <code>mode</code> (string) クリーニング、セグメンテーションモード、自動 / カスタム
          - <code>rules</code> (object) カスタムルール (自動モードでは、このフィールドは空)
            - <code>pre_processing_rules</code> (array[object]) 前処理ルール
              - <code>id</code> (string) 前処理ルールの一意識別子
                - 列挙
                  - <code>remove_extra_spaces</code> 連続するスペース、改行、タブを置換
                  - <code>remove_urls_emails</code> URL、メールアドレスを削除
              - <code>enabled</code> (bool) このルールを選択するかどうか。ドキュメント ID が渡されない場合、デフォルト値を表します。
            - <code>segmentation</code> (object) セグメンテーションルール
              - <code>separator</code> カスタムセグメント識別子。現在は 1 つの区切り文字のみ設定可能。デフォルトは \n
              - <code>max_tokens</code> 最大長 (トークン) デフォルトは 1000
            - <code>parent_mode</code> 親チャンクの検索モード: <code>full-doc</code> 全文検索 / <code>paragraph</code> 段落検索
            - <code>subchunk_segmentation</code> (object) 子チャンクルール
              - <code>separator</code> セグメンテーション識別子。現在は 1 つの区切り文字のみ許可。デフォルトは <code>***</code>
              - <code>max_tokens</code> 最大長 (トークン) は親チャンクの長さより短いことを検証する必要があります
              - <code>chunk_overlap</code> 隣接するチャンク間の重複を定義 (オプション)
      </Property>
      <Property name='file' type='multipart/form-data' key='file'>
        アップロードする必要があるファイル。
      </Property>
      <PropertyInstruction>ナレッジベースにパラメータが設定されていない場合、最初のアップロードには以下のパラメータを提供する必要があります。提供されない場合、デフォルトパラメータが使用されます。</PropertyInstruction>
      <Property name='retrieval_model' type='object' key='retrieval_model'>
        検索モデル
          - <code>search_method</code> (string) 検索方法
            - <code>hybrid_search</code> ハイブリッド検索
            - <code>semantic_search</code> セマンティック検索
            - <code>full_text_search</code> 全文検索
          - <code>reranking_enable</code> (bool) 再ランキングを有効にするかどうか
          - <code>reranking_mode</code> (object) 再ランキングモデル構成
            - <code>reranking_provider_name</code> (string) 再ランキングモデルプロバイダー
            - <code>reranking_model_name</code> (string) 再ランキングモデル名
          - <code>top_k</code> (int) 返される結果の数
          - <code>score_threshold_enabled</code> (bool) スコア閾値を有効にするかどうか
          - <code>score_threshold</code> (float) スコア閾値
      </Property>
      <Property name='embedding_model' type='string' key='embedding_model'>
        埋め込みモデル名
      </Property>
      <Property name='embedding_model_provider' type='string' key='embedding_model_provider'>
        埋め込みモデルプロバイダー
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/document/create-by-file"
      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"'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create-by-file' \
    --header 'Authorization: Bearer {api_key}' \
    --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' \
    --form 'file=@"/path/to/file"'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "document": {
        "id": "",
        "position": 1,
        "data_source_type": "upload_file",
        "data_source_info": {
          "upload_file_id": ""
        },
        "dataset_process_rule_id": "",
        "name": "Dify.txt",
        "created_from": "api",
        "created_by": "",
        "created_at": 1695308667,
        "tokens": 0,
        "indexing_status": "waiting",
        "error": null,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "archived": false,
        "display_status": "queuing",
        "word_count": 0,
        "hit_count": 0,
        "doc_form": "text_model"
      },
      "batch": ""
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets'
  method='POST'
  title='空のナレッジベースを作成'
  name='#create_empty_dataset'
/>
<Row>
  <Col>
    ### リクエストボディ
    <Properties>
      <Property name='name' type='string' key='name'>
        ナレッジ名
      </Property>
      <Property name='description' type='string' key='description'>
        ナレッジの説明 (オプション)
      </Property>
      <Property name='indexing_technique' type='string' key='indexing_technique'>
        インデックス技術 (オプション)
          - <code>high_quality</code> 高品質
          - <code>economy</code> 経済
      </Property>
      <Property name='permission' type='string' key='permission'>
        権限
          - <code>only_me</code> 自分のみ
          - <code>all_team_members</code> すべてのチームメンバー
          - <code>partial_members</code> 一部のメンバー
      </Property>
      <Property name='provider' type='string' key='provider'>
        プロバイダー (オプション、デフォルト: vendor)
          - <code>vendor</code> ベンダー
          - <code>external</code> 外部ナレッジ
      </Property>
      <Property name='external_knowledge_api_id' type='str' key='external_knowledge_api_id'>
        外部ナレッジ API ID (オプション)
      </Property>
      <Property name='external_knowledge_id' type='str' key='external_knowledge_id'>
        外部ナレッジ ID (オプション)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets"
      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"}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${apiBaseUrl}/v1/datasets' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "name": "name",
      "permission": "only_me"
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "id": "",
      "name": "name",
      "description": null,
      "provider": "vendor",
      "permission": "only_me",
      "data_source_type": null,
      "indexing_technique": null,
      "app_count": 0,
      "document_count": 0,
      "word_count": 0,
      "created_by": "",
      "created_at": 1695636173,
      "updated_by": "",
      "updated_at": 1695636173,
      "embedding_model": null,
      "embedding_model_provider": null,
      "embedding_available": null
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets'
  method='GET'
  title='ナレッジベースリストを取得'
  name='#dataset_list'
/>
<Row>
  <Col>
    ### クエリ
    <Properties>
      <Property name='page' type='string' key='page'>
        ページ番号
      </Property>
      <Property name='limit' type='string' key='limit'>
        返されるアイテム数、デフォルトは 20、範囲は 1-100
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="GET"
      label="/datasets"
      targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets?page=1&limit=20' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request GET '${props.apiBaseUrl}/datasets?page=1&limit=20' \
    --header 'Authorization: Bearer {api_key}'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": [
        {
          "id": "",
          "name": "name",
          "description": "desc",
          "permission": "only_me",
          "data_source_type": "upload_file",
          "indexing_technique": "",
          "app_count": 2,
          "document_count": 10,
          "word_count": 1200,
          "created_by": "",
          "created_at": "",
          "updated_by": "",
          "updated_at": ""
        },
        ...
      ],
      "has_more": true,
      "limit": 20,
      "total": 50,
      "page": 1
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}'
  method='DELETE'
  title='ナレッジベースを削除'
  name='#delete_dataset'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="DELETE"
      label="/datasets/{dataset_id}"
      targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}' \
    --header 'Authorization: Bearer {api_key}'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```text {{ title: 'Response' }}
    204 No Content
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/update-by-text'
  method='POST'
  title='テキストでドキュメントを更新'
  name='#update-by-text'
/>
<Row>
  <Col>
    この API は既存のナレッジに基づいており、このナレッジを基にテキストを使用してドキュメントを更新します。

    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='name' type='string' key='name'>
        ドキュメント名 (オプション)
      </Property>
      <Property name='text' type='string' key='text'>
        ドキュメント内容 (オプション)
      </Property>
      <Property name='process_rule' type='object' key='process_rule'>
        処理ルール
          - <code>mode</code> (string) クリーニング、セグメンテーションモード、自動 / カスタム
          - <code>rules</code> (object) カスタムルール (自動モードでは、このフィールドは空)
            - <code>pre_processing_rules</code> (array[object]) 前処理ルール
              - <code>id</code> (string) 前処理ルールの一意識別子
                - 列挙
                  - <code>remove_extra_spaces</code> 連続するスペース、改行、タブを置換
                  - <code>remove_urls_emails</code> URL、メールアドレスを削除
              - <code>enabled</code> (bool) このルールを選択するかどうか。ドキュメント ID が渡されない場合、デフォルト値を表します。
            - <code>segmentation</code> (object) セグメンテーションルール
              - <code>separator</code> カスタムセグメント識別子。現在は 1 つの区切り文字のみ設定可能。デフォルトは \n
              - <code>max_tokens</code> 最大長 (トークン) デフォルトは 1000
            - <code>parent_mode</code> 親チャンクの検索モード: <code>full-doc</code> 全文検索 / <code>paragraph</code> 段落検索
            - <code>subchunk_segmentation</code> (object) 子チャンクルール
              - <code>separator</code> セグメンテーション識別子。現在は 1 つの区切り文字のみ許可。デフォルトは <code>***</code>
              - <code>max_tokens</code> 最大長 (トークン) は親チャンクの長さより短いことを検証する必要があります
              - <code>chunk_overlap</code> 隣接するチャンク間の重複を定義 (オプション)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/documents/{document_id}/update-by-text"
      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"}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update-by-text' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "name": "name",
        "text": "text"
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "document": {
        "id": "",
        "position": 1,
        "data_source_type": "upload_file",
        "data_source_info": {
          "upload_file_id": ""
        },
        "dataset_process_rule_id": "",
        "name": "name.txt",
        "created_from": "api",
        "created_by": "",
        "created_at": 1695308667,
        "tokens": 0,
        "indexing_status": "waiting",
        "error": null,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "archived": false,
        "display_status": "queuing",
        "word_count": 0,
        "hit_count": 0,
        "doc_form": "text_model"
      },
      "batch": ""
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/update-by-file'
  method='POST'
  title='ファイルでドキュメントを更新'
  name='#update-by-file'
/>
<Row>
  <Col>
    この API は既存のナレッジに基づいており、このナレッジを基にファイルを使用してドキュメントを更新します。

    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='name' type='string' key='name'>
        ドキュメント名 (オプション)
      </Property>
      <Property name='file' type='multipart/form-data' key='file'>
        アップロードするファイル
      </Property>
      <Property name='process_rule' type='object' key='process_rule'>
        処理ルール
          - <code>mode</code> (string) クリーニング、セグメンテーションモード、自動 / カスタム
          - <code>rules</code> (object) カスタムルール (自動モードでは、このフィールドは空)
            - <code>pre_processing_rules</code> (array[object]) 前処理ルール
              - <code>id</code> (string) 前処理ルールの一意識別子
                - 列挙
                  - <code>remove_extra_spaces</code> 連続するスペース、改行、タブを置換
                  - <code>remove_urls_emails</code> URL、メールアドレスを削除
              - <code>enabled</code> (bool) このルールを選択するかどうか。ドキュメント ID が渡されない場合、デフォルト値を表します。
            - <code>segmentation</code> (object) セグメンテーションルール
              - <code>separator</code> カスタムセグメント識別子。現在は 1 つの区切り文字のみ設定可能。デフォルトは \n
              - <code>max_tokens</code> 最大長 (トークン) デフォルトは 1000
            - <code>parent_mode</code> 親チャンクの検索モード: <code>full-doc</code> 全文検索 / <code>paragraph</code> 段落検索
            - <code>subchunk_segmentation</code> (object) 子チャンクルール
              - <code>separator</code> セグメンテーション識別子。現在は 1 つの区切り文字のみ許可。デフォルトは <code>***</code>
              - <code>max_tokens</code> 最大長 (トークン) は親チャンクの長さより短いことを検証する必要があります
              - <code>chunk_overlap</code> 隣接するチャンク間の重複を定義 (オプション)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/documents/{document_id}/update-by-file"
      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"'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update-by-file' \
    --header 'Authorization: Bearer {api_key}' \
    --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' \
    --form 'file=@"/path/to/file"'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "document": {
        "id": "",
        "position": 1,
        "data_source_type": "upload_file",
        "data_source_info": {
          "upload_file_id": ""
        },
        "dataset_process_rule_id": "",
        "name": "Dify.txt",
        "created_from": "api",
        "created_by": "",
        "created_at": 1695308667,
        "tokens": 0,
        "indexing_status": "waiting",
        "error": null,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "archived": false,
        "display_status": "queuing",
        "word_count": 0,
        "hit_count": 0,
        "doc_form": "text_model"
      },
      "batch": "20230921150427533684"
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{batch}/indexing-status'
  method='GET'
  title='ドキュメントの埋め込みステータス (進行状況) を取得'
  name='#indexing_status'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='batch' type='string' key='batch'>
        アップロードされたドキュメントのバッチ番号
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="GET"
      label="/datasets/{dataset_id}/documents/{batch}/indexing-status"
      targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{batch}/indexing-status' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{batch}/indexing-status' \
    --header 'Authorization: Bearer {api_key}' \
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data":[{
        "id": "",
        "indexing_status": "indexing",
        "processing_started_at": 1681623462.0,
        "parsing_completed_at": 1681623462.0,
        "cleaning_completed_at": 1681623462.0,
        "splitting_completed_at": 1681623462.0,
        "completed_at": null,
        "paused_at": null,
        "error": null,
        "stopped_at": null,
        "completed_segments": 24,
        "total_segments": 100
      }]
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}'
  method='DELETE'
  title='ドキュメントを削除'
  name='#delete_document'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="DELETE"
      label="/datasets/{dataset_id}/documents/{document_id}"
      targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}' \
    --header 'Authorization: Bearer {api_key}' \
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "result": "success"
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents'
  method='GET'
  title='ナレッジベースのドキュメントリストを取得'
  name='#dataset_document_list'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>

    ### クエリ
    <Properties>
      <Property name='keyword' type='string' key='keyword'>
        検索キーワード、現在はドキュメント名のみ検索 (オプション)
      </Property>
      <Property name='page' type='string' key='page'>
        ページ番号 (オプション)
      </Property>
      <Property name='limit' type='string' key='limit'>
        返されるアイテム数、デフォルトは 20、範囲は 1-100 (オプション)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="GET"
      label="/datasets/{dataset_id}/documents"
      targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents' \
    --header 'Authorization: Bearer {api_key}' \
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": [
        {
          "id": "",
          "position": 1,
          "data_source_type": "file_upload",
          "data_source_info": null,
          "dataset_process_rule_id": null,
          "name": "dify",
          "created_from": "",
          "created_by": "",
          "created_at": 1681623639,
          "tokens": 0,
          "indexing_status": "waiting",
          "error": null,
          "enabled": true,
          "disabled_at": null,
          "disabled_by": null,
          "archived": false
        },
      ],
      "has_more": false,
      "limit": 20,
      "total": 9,
      "page": 1
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments'
  method='POST'
  title='ドキュメントにチャンクを追加'
  name='#create_new_segment'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='segments' type='object list' key='segments'>
        - <code>content</code> (text) テキスト内容 / 質問内容、必須
        - <code>answer</code> (text) 回答内容、ナレッジのモードが Q&A モードの場合に値を渡します (オプション)
        - <code>keywords</code> (list) キーワード (オプション)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/documents/{document_id}/segments"
      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"]}]}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "segments": [
        {
          "content": "1",
          "answer": "1",
          "keywords": ["a"]
        }
      ]
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": [{
        "id": "",
        "position": 1,
        "document_id": "",
        "content": "1",
        "answer": "1",
        "word_count": 25,
        "tokens": 0,
        "keywords": [
          "a"
        ],
        "index_node_id": "",
        "index_node_hash": "",
        "hit_count": 0,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "status": "completed",
        "created_by": "",
        "created_at": 1695312007,
        "indexing_at": 1695312007,
        "completed_at": 1695312007,
        "error": null,
        "stopped_at": null
      }],
      "doc_form": "text_model"
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments'
  method='GET'
  title='ドキュメントからチャンクを取得'
  name='#get_segment'
/>
<Row>
  <Col>
    ### パス
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
    </Properties>

     ### クエリ
    <Properties>
      <Property name='keyword' type='string' key='keyword'>
        キーワード (オプション)
      </Property>
      <Property name='status' type='string' key='status'>
        検索ステータス、completed
      </Property>
      <Property name='page' type='string' key='page'>
        ページ番号 (オプション)
      </Property>
      <Property name='limit' type='string' key='limit'>
        返されるアイテム数、デフォルトは 20、範囲は 1-100 (オプション)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="GET"
      label="/datasets/{dataset_id}/documents/{document_id}/segments"
      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'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": [{
        "id": "",
        "position": 1,
        "document_id": "",
        "content": "1",
        "answer": "1",
        "word_count": 25,
        "tokens": 0,
        "keywords": [
            "a"
        ],
        "index_node_id": "",
        "index_node_hash": "",
        "hit_count": 0,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "status": "completed",
        "created_by": "",
        "created_at": 1695312007,
        "indexing_at": 1695312007,
        "completed_at": 1695312007,
        "error": null,
        "stopped_at": null
      }],
      "doc_form": "text_model",
      "has_more": false,
      "limit": 20,
      "total": 9,
      "page": 1
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
  method='DELETE'
  title='ドキュメント内のチャンクを削除'
  name='#delete_segment'
/>
<Row>
  <Col>
    ### パス
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
      <Property name='segment_id' type='string' key='segment_id'>
        ドキュメントセグメント ID
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="DELETE"
      label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}"
      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'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/segments/{segment_id}' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "result": "success"
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
  method='POST'
  title='ドキュメント内のチャンクを更新'
  name='#update_segment'
/>
<Row>
  <Col>
    ### POST
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
      <Property name='segment_id' type='string' key='segment_id'>
        ドキュメントセグメント ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='segment' type='object' key='segment'>
        - <code>content</code> (text) テキスト内容 / 質問内容、必須
        - <code>answer</code> (text) 回答内容、ナレッジが Q&A モードの場合に値を渡します (オプション)
        - <code>keywords</code> (list) キーワード (オプション)
        - <code>enabled</code> (bool) False / true (オプション)
        - <code>regenerate_child_chunks</code> (bool) 子チャンクを再生成するかどうか (オプション)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}"
      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}}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
      "segment": {
          "content": "1",
          "answer": "1",
          "keywords": ["a"],
          "enabled": false
      }
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": {
        "id": "",
        "position": 1,
        "document_id": "",
        "content": "1",
        "answer": "1",
        "word_count": 25,
        "tokens": 0,
        "keywords": [
            "a"
        ],
        "index_node_id": "",
        "index_node_hash": "",
        "hit_count": 0,
        "enabled": true,
        "disabled_at": null,
        "disabled_by": null,
        "status": "completed",
        "created_by": "",
        "created_at": 1695312007,
        "indexing_at": 1695312007,
        "completed_at": 1695312007,
        "error": null,
        "stopped_at": null
      },
      "doc_form": "text_model"
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks'
  method='POST'
  title='子チャンクを作成'
  name='#create_child_chunk'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
      <Property name='segment_id' type='string' key='segment_id'>
        セグメント ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='content' type='string' key='content'>
        子チャンクの内容
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks"
      targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"content": "Child chunk content"}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "content": "Child chunk content"
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": {
        "id": "",
        "segment_id": "",
        "content": "Child chunk content",
        "word_count": 25,
        "tokens": 0,
        "index_node_id": "",
        "index_node_hash": "",
        "status": "completed",
        "created_by": "",
        "created_at": 1695312007,
        "indexing_at": 1695312007,
        "completed_at": 1695312007,
        "error": null,
        "stopped_at": null
      }
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks'
  method='GET'
  title='子チャンクを取得'
  name='#get_child_chunks'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
      <Property name='segment_id' type='string' key='segment_id'>
        セグメント ID
      </Property>
    </Properties>

    ### クエリ
    <Properties>
      <Property name='keyword' type='string' key='keyword'>
        検索キーワード (オプション)
      </Property>
      <Property name='page' type='integer' key='page'>
        ページ番号 (オプション、デフォルト: 1)
      </Property>
      <Property name='limit' type='integer' key='limit'>
        ページあたりのアイテム数 (オプション、デフォルト: 20、最大: 100)
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="GET"
      label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks"
      targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks?page=1&limit=20' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks?page=1&limit=20' \
    --header 'Authorization: Bearer {api_key}'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": [{
        "id": "",
        "segment_id": "",
        "content": "Child chunk content",
        "word_count": 25,
        "tokens": 0,
        "index_node_id": "",
        "index_node_hash": "",
        "status": "completed",
        "created_by": "",
        "created_at": 1695312007,
        "indexing_at": 1695312007,
        "completed_at": 1695312007,
        "error": null,
        "stopped_at": null
      }],
      "total": 1,
      "total_pages": 1,
      "page": 1,
      "limit": 20
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}'
  method='DELETE'
  title='子チャンクを削除'
  name='#delete_child_chunk'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
      <Property name='segment_id' type='string' key='segment_id'>
        セグメント ID
      </Property>
      <Property name='child_chunk_id' type='string' key='child_chunk_id'>
        子チャンク ID
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="DELETE"
      label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}"
      targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \
    --header 'Authorization: Bearer {api_key}'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "result": "success"
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}'
  method='PATCH'
  title='子チャンクを更新'
  name='#update_child_chunk'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
      <Property name='segment_id' type='string' key='segment_id'>
        セグメント ID
      </Property>
      <Property name='child_chunk_id' type='string' key='child_chunk_id'>
        子チャンク ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='content' type='string' key='content'>
        子チャンクの内容
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="PATCH"
      label="/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}"
      targetCode={`curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"content": "Updated child chunk content"}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "content": "Updated child chunk content"
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "data": {
        "id": "",
        "segment_id": "",
        "content": "Updated child chunk content",
        "word_count": 25,
        "tokens": 0,
        "index_node_id": "",
        "index_node_hash": "",
        "status": "completed",
        "created_by": "",
        "created_at": 1695312007,
        "indexing_at": 1695312007,
        "completed_at": 1695312007,
        "error": null,
        "stopped_at": null
      }
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/{document_id}/upload-file'
  method='GET'
  title='アップロードファイルを取得'
  name='#get_upload_file'
/>
<Row>
  <Col>
    ### パス
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='document_id' type='string' key='document_id'>
        ドキュメント ID
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="GET"
      label="/datasets/{dataset_id}/documents/{document_id}/upload-file"
      targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/upload-file' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/upload-file' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "id": "file_id",
      "name": "file_name",
      "size": 1024,
      "extension": "txt",
      "url": "preview_url",
      "download_url": "download_url",
      "mime_type": "text/plain",
      "created_by": "user_id",
      "created_at": 1728734540,
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/retrieve'
  method='POST'
  title='ナレッジベースからチャンクを取得'
  name='#dataset_retrieval'
/>
<Row>
  <Col>
    ### パス
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='query' type='string' key='query'>
        クエリキーワード
      </Property>
      <Property name='retrieval_model' type='object' key='retrieval_model'>
        検索モデル (オプション、入力されない場合はデフォルトの方法でリコールされます)
        - <code>search_method</code> (text) 検索方法: 以下の 4 つのキーワードのいずれかが必要です
          - <code>keyword_search</code> キーワード検索
          - <code>semantic_search</code> セマンティック検索
          - <code>full_text_search</code> 全文検索
          - <code>hybrid_search</code> ハイブリッド検索
        - <code>reranking_enable</code> (bool) 再ランキングを有効にするかどうか、検索モードが semantic_search または hybrid_search の場合に必須 (オプション)
        - <code>reranking_mode</code> (object) 再ランキングモデル構成、再ランキングが有効な場合に必須
            - <code>reranking_provider_name</code> (string) 再ランキングモデルプロバイダー
            - <code>reranking_model_name</code> (string) 再ランキングモデル名
        - <code>weights</code> (float) ハイブリッド検索モードでのセマンティック検索の重み設定
        - <code>top_k</code> (integer) 返される結果の数 (オプション)
        - <code>score_threshold_enabled</code> (bool) スコア閾値を有効にするかどうか
        - <code>score_threshold</code> (float) スコア閾値
      </Property>
      <Property name='external_retrieval_model' type='object' key='external_retrieval_model'>
          未使用フィールド
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/retrieve"
      targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/retrieve' \\\n--header 'Authorization: Bearer {api_key}'\\\n--header 'Content-Type: application/json'\\\n--data-raw '{
    "query": "test",
    "retrieval_model": {
        "search_method": "keyword_search",
        "reranking_enable": false,
        "reranking_mode": null,
        "reranking_model": {
            "reranking_provider_name": "",
            "reranking_model_name": ""
        },
        "weights": null,
        "top_k": 1,
        "score_threshold_enabled": false,
        "score_threshold": null
    }
}'`}
    >
    ```bash {{ title: 'cURL' }}
    curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/retrieve' \
    --header 'Authorization: Bearer {api_key}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "query": "test",
        "retrieval_model": {
            "search_method": "keyword_search",
            "reranking_enable": false,
            "reranking_mode": null,
            "reranking_model": {
                "reranking_provider_name": "",
                "reranking_model_name": ""
            },
            "weights": null,
            "top_k": 2,
            "score_threshold_enabled": false,
            "score_threshold": null
        }
    }'
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "query": {
        "content": "test"
      },
      "records": [
        {
          "segment": {
            "id": "7fa6f24f-8679-48b3-bc9d-bdf28d73f218",
            "position": 1,
            "document_id": "a8c6c36f-9f5d-4d7a-8472-f5d7b75d71d2",
            "content": "Operation guide",
            "answer": null,
            "word_count": 847,
            "tokens": 280,
            "keywords": [
              "install",
              "java",
              "base",
              "scripts",
              "jdk",
              "manual",
              "internal",
              "opens",
              "add",
              "vmoptions"
            ],
            "index_node_id": "39dd8443-d960-45a8-bb46-7275ad7fbc8e",
            "index_node_hash": "0189157697b3c6a418ccf8264a09699f25858975578f3467c76d6bfc94df1d73",
            "hit_count": 0,
            "enabled": true,
            "disabled_at": null,
            "disabled_by": null,
            "status": "completed",
            "created_by": "dbcb1ab5-90c8-41a7-8b78-73b235eb6f6f",
            "created_at": 1728734540,
            "indexing_at": 1728734552,
            "completed_at": 1728734584,
            "error": null,
            "stopped_at": null,
            "document": {
              "id": "a8c6c36f-9f5d-4d7a-8472-f5d7b75d71d2",
              "data_source_type": "upload_file",
              "name": "readme.txt",
            }
          },
          "score": 3.730463140527718e-05,
          "tsne_position": null
        }
      ]
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/metadata'
  method='POST'
  title='ナレッジメタデータを作成'
  name='#create_metadata'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='segment' type='object' key='segment'>
        - <code>type</code> (string) メタデータの種類、必須
        - <code>name</code> (string) メタデータの名前、必須
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/metadata"
      targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/metadata' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'\\\n--data-raw '{"type": "string", "name": "test"}'`}
    >
    ```bash {{ title: 'cURL' }}
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "id": "abc",
      "type": "string",
      "name": "test",
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/metadata/{metadata_id}'
  method='PATCH'
  title='ナレッジメタデータを更新'
  name='#update_metadata'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='metadata_id' type='string' key='metadata_id'>
        メタデータ ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='segment' type='object' key='segment'>
        - <code>name</code> (string) メタデータの名前、必須
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="PATCH"
      label="/datasets/{dataset_id}/metadata/{metadata_id}"
      targetCode={`curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}/metadata/{metadata_id}' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'\\\n--data-raw '{"name": "test"}'`}
    >
    ```bash {{ title: 'cURL' }}
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "id": "abc",
      "type": "string",
      "name": "test",
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/metadata/{metadata_id}'
  method='DELETE'
  title='ナレッジメタデータを削除'
  name='#delete_metadata'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='metadata_id' type='string' key='metadata_id'>
        メタデータ ID
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="DELETE"
      label="/datasets/{dataset_id}/metadata/{metadata_id}"
      targetCode={`curl --location --request DELETE '${props.apiBaseUrl}/datasets/{dataset_id}/metadata/{metadata_id}' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/metadata/built-in/{action}'
  method='POST'
  title='組み込みメタデータを無効化または有効化'
  name='#toggle_metadata'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
      <Property name='action' type='string' key='action'>
        disable/enable
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/metadata/built-in/{action}"
      targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/metadata/built-in/{action}' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/documents/metadata'
  method='POST'
  title='ドキュメントメタデータを更新'
  name='#update_documents_metadata'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>

    ### リクエストボディ
    <Properties>
      <Property name='operation_data' type='object list' key='segments'>
        - <code>document_id</code> (string) ドキュメント ID
        - <code>metadata_list</code> (list) メタデータリスト
          - <code>id</code> (string) メタデータ ID
          - <code>value</code> (string) メタデータの値
          - <code>name</code> (string) メタデータの名前
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="POST"
      label="/datasets/{dataset_id}/documents/metadata"
      targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/metadata' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json'\\\n--data-raw '{"operation_data": [{"document_id": "document_id", "metadata_list": [{"id": "id", "value": "value", "name": "name"}]}]}'`}
    >
    ```bash {{ title: 'cURL' }}
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Heading
  url='/datasets/{dataset_id}/metadata'
  method='GET'
  title='ナレッジメタデータリストを取得'
  name='#dataset_metadata_list'
/>
<Row>
  <Col>
    ### パラメータ
    <Properties>
      <Property name='dataset_id' type='string' key='dataset_id'>
        ナレッジ ID
      </Property>
    </Properties>
  </Col>
  <Col sticky>
    <CodeGroup
      title="リクエスト"
      tag="GET"
      label="/datasets/{dataset_id}/metadata"
      targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/metadata' \\\n--header 'Authorization: Bearer {api_key}'`}
    >
    ```bash {{ title: 'cURL' }}
    ```
    </CodeGroup>
    <CodeGroup title="レスポンス">
    ```json {{ title: 'Response' }}
    {
      "doc_metadata": [
        {
          "id": "",
          "name": "name",
          "type": "string",
          "use_count": 0,
        },
        ...
      ],
      "built_in_field_enabled": true
    }
    ```
    </CodeGroup>
  </Col>
</Row>

<hr className='ml-0 mr-0' />

<Row>
  <Col>
    ### エラーメッセージ
    <Properties>
      <Property name='code' type='string' key='code'>
        エラーコード
      </Property>
    </Properties>
    <Properties>
      <Property name='status' type='number' key='status'>
        エラーステータス
      </Property>
    </Properties>
    <Properties>
      <Property name='message' type='string' key='message'>
        エラーメッセージ
      </Property>
    </Properties>
  </Col>
  <Col>
    <CodeGroup title="例">
    ```json {{ title: 'Response' }}
      {
        "code": "no_file_uploaded",
        "message": "Please upload your file.",
        "status": 400
      }
    ```
    </CodeGroup>
  </Col>
</Row>
<table className="max-w-auto border-collapse border border-slate-400" style={{ maxWidth: 'none', width: 'auto' }}>
  <thead style={{ background: '#f9fafc' }}>
    <tr>
      <th className="p-2 border border-slate-300">code</th>
      <th className="p-2 border border-slate-300">status</th>
      <th className="p-2 border border-slate-300">message</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td className="p-2 border border-slate-300">no_file_uploaded</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">Please upload your file.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">too_many_files</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">Only one file is allowed.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">file_too_large</td>
      <td className="p-2 border border-slate-300">413</td>
      <td className="p-2 border border-slate-300">File size exceeded.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">unsupported_file_type</td>
      <td className="p-2 border border-slate-300">415</td>
      <td className="p-2 border border-slate-300">File type not allowed.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">high_quality_dataset_only</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">Current operation only supports 'high-quality' datasets.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">dataset_not_initialized</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">The dataset is still being initialized or indexing. Please wait a moment.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">archived_document_immutable</td>
      <td className="p-2 border border-slate-300">403</td>
      <td className="p-2 border border-slate-300">The archived document is not editable.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">dataset_name_duplicate</td>
      <td className="p-2 border border-slate-300">409</td>
      <td className="p-2 border border-slate-300">The dataset name already exists. Please modify your dataset name.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">invalid_action</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">Invalid action.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">document_already_finished</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">The document has been processed. Please refresh the page or go to the document details.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">document_indexing</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">The document is being processed and cannot be edited.</td>
    </tr>
    <tr>
      <td className="p-2 border border-slate-300">invalid_metadata</td>
      <td className="p-2 border border-slate-300">400</td>
      <td className="p-2 border border-slate-300">The metadata content is incorrect. Please check and verify.</td>
    </tr>
  </tbody>
</table>
<div className="pb-4" />