mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-01 22:14:03 -04:00
Compare commits
1206 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cb270d07f | |||
| 62771058aa | |||
| ca348a6570 | |||
| 44a7fd72e8 | |||
| d8d952d937 | |||
| 216ba1f22b | |||
| 74686f5776 | |||
| 1ebf9e67a4 | |||
| aeefc77da0 | |||
| 13d8d7cbbe | |||
| 9c34e44b85 | |||
| cb2dc802d9 | |||
| 5a6cc0e32e | |||
| a63256eb84 | |||
| 0a160b97a0 | |||
| 95602c7959 | |||
| 20bc466ca1 | |||
| efb1c56ba5 | |||
| 286499388d | |||
| 460c6574cc | |||
| 8b0e0e3cc8 | |||
| 87142b29fa | |||
| 501b844f0f | |||
| 03157dc295 | |||
| ef80b684f7 | |||
| 472e70feee | |||
| cfb90f7666 | |||
| 2e3a287a27 | |||
| 635fbb8618 | |||
| d2d34acb31 | |||
| cf70edbede | |||
| 79b7d246bd | |||
| bcc3d0b4d1 | |||
| 238ca86534 | |||
| 1f3efe8947 | |||
| 89324b4067 | |||
| 8cc848aee6 | |||
| cd54a7a66b | |||
| dca02f7277 | |||
| b757fa9aa3 | |||
| bc594a0674 | |||
| 208282d62f | |||
| 060880abfe | |||
| 728b35e774 | |||
| bdaa043404 | |||
| a55cf8d870 | |||
| cf4244fd3a | |||
| 76c3fd64ad | |||
| 701e0ac2be | |||
| a285f8ba3a | |||
| 663821cdf6 | |||
| c4b95494ac | |||
| 980fb4e5a3 | |||
| 96f8f40291 | |||
| 1c698df6e0 | |||
| 298cb433be | |||
| 63af7dd99d | |||
| af5df1d083 | |||
| a3b44093c2 | |||
| c80bf3311f | |||
| 7940d249b0 | |||
| 4a07c81f71 | |||
| 7d56cdf045 | |||
| 0affe621d5 | |||
| 93932b1a9c | |||
| a87f13b9d2 | |||
| 8d2b21ee75 | |||
| 87741c9be8 | |||
| 171cb89170 | |||
| 5dad867bbe | |||
| 13f26fd84d | |||
| 3bc77f7d7f | |||
| aac1ee3af3 | |||
| e85893ac0f | |||
| 315947ee6f | |||
| 23a0d44b11 | |||
| 3b501de057 | |||
| 6cc645aa2a | |||
| 0b37207adc | |||
| f0704ec705 | |||
| 4fcbdf710e | |||
| 866149193a | |||
| 6ffb161618 | |||
| 8e4b49824b | |||
| 5263576de1 | |||
| 6d4e2ea0e9 | |||
| 3cbfa98e6b | |||
| d256cbe0e0 | |||
| a6dfa30dcf | |||
| d0365dc434 | |||
| aa41432bbb | |||
| 98a2b4a547 | |||
| 806ce9a360 | |||
| 8b28092cc8 | |||
| 5c5f4c1c84 | |||
| 949d330295 | |||
| 9a5ee4f37a | |||
| 7a23cc6c84 | |||
| 041acd11fe | |||
| 24b4033db9 | |||
| 1115f83b8f | |||
| 60a1603636 | |||
| ea467fa031 | |||
| b0e6f73b1d | |||
| 6d9e015b5e | |||
| fececd89ab | |||
| 48e287892f | |||
| f118400820 | |||
| 3f8407c7af | |||
| 83317739c7 | |||
| 0b665bd1ca | |||
| 98d4cbdf95 | |||
| 6cb75b54a0 | |||
| 53edfe93cf | |||
| b856deae43 | |||
| 259c842259 | |||
| ffb195ea7a | |||
| b4677534d1 | |||
| f967b82467 | |||
| c81946930e | |||
| 1008b775a4 | |||
| 41210dfc51 | |||
| 67b7272249 | |||
| 964e045903 | |||
| 137cf67f40 | |||
| 309a526e3c | |||
| dd95927498 | |||
| 4f72feae91 | |||
| 3cd8f9f597 | |||
| d2e8d0c62a | |||
| fafbd8c9c7 | |||
| a40c91b054 | |||
| 98894055c6 | |||
| 4589a84643 | |||
| e6b7f52d3e | |||
| b169db617a | |||
| 89a49f4f4f | |||
| 58490715fe | |||
| 4c2283c4e5 | |||
| a059070dec | |||
| 20dfeb4cfa | |||
| aefc3266c1 | |||
| fdf48dd459 | |||
| 66525346a2 | |||
| c9b2ec4a2b | |||
| bf583a7266 | |||
| de194d1c73 | |||
| ecdc289df1 | |||
| 9e198ac40d | |||
| 0a06998690 | |||
| 484a7105a9 | |||
| 8d18ea167b | |||
| a2ca89bfe0 | |||
| edeea40898 | |||
| 2a7080b094 | |||
| b354f2386b | |||
| d766bd03d2 | |||
| 6a69148356 | |||
| e1e1b0b522 | |||
| d824876653 | |||
| 2048698f77 | |||
| 9942979aa7 | |||
| 3c2655a1f9 | |||
| 552a61a66f | |||
| d13143e322 | |||
| 5116ad8d08 | |||
| 64683a55f3 | |||
| 698cd9c631 | |||
| c744a99102 | |||
| 2d2935085e | |||
| 1b31e2c8cd | |||
| 7257751993 | |||
| de6bfdb1b1 | |||
| 9e49f4411b | |||
| 026d068ddf | |||
| 7055d6fc3c | |||
| e9c2366bf1 | |||
| 6278152e49 | |||
| 76010c0cea | |||
| 889b84cfb9 | |||
| a26681c416 | |||
| 90027a7b44 | |||
| aab56faf88 | |||
| c57bd11c45 | |||
| 3fa1e29468 | |||
| cf87f84900 | |||
| 402d4ef013 | |||
| fc94906a1e | |||
| b83fcd11e4 | |||
| c28af7c7bc | |||
| dbc853bcc5 | |||
| c8396c5a3c | |||
| 65af8d3a26 | |||
| 329b6ec958 | |||
| 09bf27abd7 | |||
| 2ec6a529c7 | |||
| e8e21a0e4e | |||
| 88d243f145 | |||
| 3a6e287443 | |||
| beb3e5cd7f | |||
| 7416a87e10 | |||
| 65b85b237e | |||
| b17a80014a | |||
| ff87f99807 | |||
| 65d834615d | |||
| b8be4c09e2 | |||
| e5fb332538 | |||
| 491033d534 | |||
| 885fa316a5 | |||
| b6ed679771 | |||
| 68fc6e8b50 | |||
| ea0331ef5a | |||
| 6827e245b8 | |||
| ef25d6960c | |||
| f740f44cf2 | |||
| a5e4e6d857 | |||
| cfdd6db530 | |||
| d4eda9f396 | |||
| a433b107e0 | |||
| 59f9fb6c3f | |||
| 09d532ebcc | |||
| cfd6f3ca8c | |||
| 95add73c38 | |||
| 9ee036b160 | |||
| c2b521199c | |||
| ee9f3f373a | |||
| f205358587 | |||
| 255ae7dced | |||
| b4c6d509a0 | |||
| 34cd57b639 | |||
| 50dfd7bf60 | |||
| 0b57187909 | |||
| e78e9f4832 | |||
| 383933adb5 | |||
| dd054137bf | |||
| cf3b7571eb | |||
| ae7a2c202a | |||
| 9b00d578bc | |||
| b8173e4c4e | |||
| 67b5445fb9 | |||
| 87419ef5d1 | |||
| ad218160d8 | |||
| eeb90d7991 | |||
| 7b7329bd18 | |||
| b3acbb06f4 | |||
| 7db7562841 | |||
| 0e75b124c3 | |||
| d79a0b76f3 | |||
| c3eb4933fb | |||
| e3a956aedd | |||
| e562e479dc | |||
| 1900e019e3 | |||
| 317f140822 | |||
| cd829474d6 | |||
| b6c1500570 | |||
| d06a85bd34 | |||
| 6b9a2feac5 | |||
| bd08004afe | |||
| 0ecc4b2051 | |||
| f9f351229a | |||
| 72659a237b | |||
| 6cc3a36d44 | |||
| 6fe55d6e88 | |||
| 36f2903eb3 | |||
| 09464e6da7 | |||
| 955e084cf3 | |||
| 46ee0c8765 | |||
| da5391c018 | |||
| ce732beece | |||
| 889b70093c | |||
| 7211a27f01 | |||
| ba95ca3fb6 | |||
| ffdc507625 | |||
| 8aef0dece9 | |||
| c680af63ef | |||
| 4a7ac65184 | |||
| 4016c55604 | |||
| 0f64084c20 | |||
| 7af03d9205 | |||
| d903da626f | |||
| 177b446229 | |||
| ab9d941d15 | |||
| 66fd990624 | |||
| f6dabd0d3e | |||
| 74caaa2bf7 | |||
| 552403b370 | |||
| a93d09d159 | |||
| 0fb757f6c1 | |||
| a68053ca4e | |||
| 36d4f4027b | |||
| 19d92507e3 | |||
| 664e92a3d6 | |||
| d687c110e4 | |||
| af5ae7054e | |||
| dff1e7f552 | |||
| cf446401e5 | |||
| e9b87ef09b | |||
| 7231ddb1b3 | |||
| 1ead36f1bb | |||
| 8a9b78a4ab | |||
| 569299724a | |||
| 6dd401e1c7 | |||
| c4cb37786b | |||
| b757d9a94e | |||
| 6cc083f370 | |||
| c419027db9 | |||
| 6a16b47406 | |||
| 4197ae8b9f | |||
| 88696e1407 | |||
| 24cb48f195 | |||
| 965cfd291e | |||
| 873329c052 | |||
| 3d8023b9a9 | |||
| 93d1450fc1 | |||
| 27d55fde8c | |||
| 690399b04c | |||
| 65b84f1ab3 | |||
| 835acb89d0 | |||
| d9df9ea75c | |||
| 06874ffb69 | |||
| f0898a3930 | |||
| 7d50196d2f | |||
| f90f7fee64 | |||
| 3d860df873 | |||
| 2fe3a2b6a8 | |||
| eb3d4af204 | |||
| 0652352e92 | |||
| 103949513b | |||
| 9ba4547c4d | |||
| 4fea0adf43 | |||
| de070dbfa7 | |||
| 87eb72bdb2 | |||
| fe03aaae55 | |||
| 9ce7d3d648 | |||
| 0471407761 | |||
| e4b807a018 | |||
| 0a0ec37725 | |||
| 8abca5d818 | |||
| 3a29a8036b | |||
| e2b9b66f71 | |||
| bb66cb7e36 | |||
| 2159e77c9d | |||
| 3154f521d9 | |||
| fda8024607 | |||
| 89336e4ddf | |||
| a94f747307 | |||
| 88d3b41044 | |||
| 7fd02ab8d1 | |||
| 9e5d8e143e | |||
| f0f7df29b3 | |||
| 05ba70881c | |||
| 8a729cdd0d | |||
| ffe5fbcd51 | |||
| 18cc545e16 | |||
| c818e90cfc | |||
| 570973b9d6 | |||
| 09d19b99ba | |||
| 7ad30dc660 | |||
| 5c1702c527 | |||
| f1063d58ae | |||
| eee39221c4 | |||
| 4303961948 | |||
| e2790dabc8 | |||
| ba42aa592c | |||
| e1deba1222 | |||
| f9c2dd1b3a | |||
| 8bf0a41926 | |||
| 5c89aa54c4 | |||
| 69484526e6 | |||
| bfc84384ea | |||
| cce3b792db | |||
| bff40f27c5 | |||
| c3e3b598bb | |||
| fa17f7e352 | |||
| 3aed922a3b | |||
| 7c4e37c5cd | |||
| 2d8845b084 | |||
| 47f21796e0 | |||
| eb6de99fcb | |||
| 2bfc8f3161 | |||
| bcacf88e55 | |||
| 13766a82b2 | |||
| 34d7ca66f5 | |||
| 17a803bb17 | |||
| 1bd47969b3 | |||
| 5fec0f1135 | |||
| a73942ddea | |||
| 34a26e5e4d | |||
| f74dea5fae | |||
| ee3eb7d8e2 | |||
| 75f94eea1b | |||
| b737bda40d | |||
| d99b1d61d7 | |||
| 844029d8e5 | |||
| 9492cc64b5 | |||
| 5773f97e88 | |||
| 0784dc3a0a | |||
| 7993be7d0d | |||
| f22ce6e757 | |||
| 3c4347b247 | |||
| 977f2840b9 | |||
| 5d3bb6642e | |||
| 2001eb7ffb | |||
| f18c9f69d4 | |||
| 8e124e5b63 | |||
| 4ed5e544b0 | |||
| b185bda5b1 | |||
| d79804e271 | |||
| 2b356c8613 | |||
| 2e6b36ef4b | |||
| edd0f66234 | |||
| 2da407d66c | |||
| fa574f709e | |||
| 1e6171521b | |||
| 3f3e4eca66 | |||
| 648482b0f1 | |||
| bb46afe33d | |||
| 80f5914abf | |||
| 1c4e7f9c3e | |||
| e4ae6e9076 | |||
| f93efa2ea1 | |||
| 7d79365262 | |||
| 555692207e | |||
| fcc06b227a | |||
| 08a39790e4 | |||
| a8270082a0 | |||
| 85da798538 | |||
| b68d8697df | |||
| 7704df5042 | |||
| 16f04c7e7e | |||
| 7c6b3117bf | |||
| 7def68fb37 | |||
| 03ed2b4129 | |||
| 733d62a699 | |||
| f76e1d0796 | |||
| 88d42ccd8d | |||
| a0686fb1f2 | |||
| 3d198d94a6 | |||
| 036c00db73 | |||
| 548f0687f1 | |||
| f85c042a94 | |||
| 40e892f813 | |||
| 2381025306 | |||
| a0909dc053 | |||
| 853a14b7c7 | |||
| b31e2d42eb | |||
| 5b6ad9419f | |||
| a60948a87e | |||
| 8b420da753 | |||
| 12c079b74a | |||
| c835f78dd0 | |||
| d52eb9d4ee | |||
| 0cfd9f60b5 | |||
| 5ab65eb95a | |||
| b13fb36de0 | |||
| d8fe65a273 | |||
| ba1cb996cf | |||
| 41f41d6543 | |||
| e25fc44db9 | |||
| 2ea91dc94b | |||
| b16419ad3e | |||
| 1e3c05c408 | |||
| a7eb59f472 | |||
| e99448481c | |||
| 83ab7622d9 | |||
| d4312d504b | |||
| 95742e7704 | |||
| a8845a33df | |||
| b3fd87f302 | |||
| 25ba970e09 | |||
| a67f9aaad7 | |||
| 210ce35867 | |||
| 36905f6442 | |||
| ed509db04a | |||
| 14413c0637 | |||
| 9682c95da8 | |||
| 7c6eba90e5 | |||
| c85bf225b9 | |||
| b51c2d66a5 | |||
| 935bc52239 | |||
| 57ff51823c | |||
| 06b20a1772 | |||
| 7a98255149 | |||
| 980038c711 | |||
| 09d4e36200 | |||
| 8fb523bcef | |||
| e48a621d61 | |||
| 1f87787b05 | |||
| fb6cef8a0b | |||
| 21368f6218 | |||
| 116685017d | |||
| 23082f2c5e | |||
| ff2b3ca727 | |||
| e55d41f5df | |||
| 91fb5101d6 | |||
| 9c5e22a656 | |||
| 18f23b298e | |||
| ddf39ebeaa | |||
| 320b515e7d | |||
| 04c50ee946 | |||
| 3d626d68aa | |||
| 9c0442bdb5 | |||
| 606ffa40d1 | |||
| e9f6de1238 | |||
| 8110ab98b6 | |||
| b8c4bd70ae | |||
| 2e49856621 | |||
| 2039509811 | |||
| 420f2ddeb7 | |||
| afc0516868 | |||
| 02a0f5e96c | |||
| 2f7b05006b | |||
| 314089b0a1 | |||
| 60e626d6d0 | |||
| 5c2050ebcf | |||
| 7fd2870d45 | |||
| 609e3339c0 | |||
| 0e01723aee | |||
| 25141b85f9 | |||
| 21510bd664 | |||
| 696d1de19f | |||
| 56020b4bc3 | |||
| 62e29d5a51 | |||
| 15c890a7b8 | |||
| 43b33c558f | |||
| be0661f156 | |||
| b9a5a0498a | |||
| 8c4261500c | |||
| 2254d98bcc | |||
| 21f9096846 | |||
| 9830dc2962 | |||
| c29a8cc63b | |||
| ef7872eb4f | |||
| 3282223511 | |||
| c99c5eb03f | |||
| 3b759c26c4 | |||
| 5038a1f351 | |||
| 0aa7552de6 | |||
| 7fae7d2cde | |||
| f35d8e5b64 | |||
| 63cc0a35d3 | |||
| d159bdd50c | |||
| 0f2c609621 | |||
| 4e14952b24 | |||
| b36d4b2723 | |||
| bf53cd3d3d | |||
| f2e3935c0b | |||
| 77f41f9356 | |||
| 042500dd55 | |||
| f0be93313a | |||
| bf9e26319c | |||
| 5054eb3b10 | |||
| 9bea88c7b8 | |||
| 786c25d342 | |||
| d00f18d567 | |||
| 0f363487e9 | |||
| b471da75d6 | |||
| e5937ff6f8 | |||
| 08379e61bf | |||
| 6c8a65b055 | |||
| d059db62c3 | |||
| e4dd4a9036 | |||
| c0fc9f6e55 | |||
| 72d919566c | |||
| 2aeb3415b1 | |||
| 680a12f87e | |||
| 7a83b34c16 | |||
| ecd16f9fb0 | |||
| 54ca85d482 | |||
| 65ef0be90c | |||
| 57106affdf | |||
| d613bbd358 | |||
| d0bf2104dc | |||
| e70413373f | |||
| 36f0af5a5d | |||
| 79d7076121 | |||
| 526b3e74bf | |||
| d03dc21e8a | |||
| c31dfa4957 | |||
| c7e510723d | |||
| 42093de872 | |||
| 886e58828e | |||
| c8eaf1c9ac | |||
| 2169dadccc | |||
| 4bc8a7b733 | |||
| 61eb955921 | |||
| aa48a5d764 | |||
| 1dedca45ac | |||
| 9d90335a12 | |||
| b577acb115 | |||
| 425e2bcccc | |||
| 3766251891 | |||
| 3552de1b45 | |||
| 2b94e36df6 | |||
| d1e1de4a8d | |||
| 23587e17ad | |||
| 213f452f0b | |||
| 27a488539d | |||
| 283da50d33 | |||
| a809085715 | |||
| 67321f1cba | |||
| 7683186470 | |||
| fded43b77e | |||
| 22ff7da4e0 | |||
| 844561b6cc | |||
| 1fe02a3067 | |||
| 362d8ecb31 | |||
| 5f5f6389f9 | |||
| 31cf3cde45 | |||
| 11f0c2cab1 | |||
| 52bc1d8387 | |||
| 8a3ac0c338 | |||
| bb125d7d4f | |||
| a405716847 | |||
| bad6e03095 | |||
| 2330fddfbb | |||
| 61dfd74134 | |||
| 029ff83979 | |||
| dbbc4cb2e1 | |||
| 1cce21cdc2 | |||
| 8b786a51b3 | |||
| ad7537dd84 | |||
| 3bab23172a | |||
| 18c132d494 | |||
| d072353e08 | |||
| c8bbc101cc | |||
| b93f748998 | |||
| ecb100448a | |||
| c749c856b5 | |||
| 0baf278972 | |||
| ae7780266a | |||
| 587960aebe | |||
| 4e1b6784f7 | |||
| 8b381f2640 | |||
| 0dc7fa6c34 | |||
| 2a2bf682bf | |||
| 87526129fb | |||
| 8ed1b7aa46 | |||
| 4084bd0ecc | |||
| d11eaceaf1 | |||
| 1e6986fbc5 | |||
| 11a19bdec7 | |||
| 51064f1b90 | |||
| 3385cd19e8 | |||
| 852f8517df | |||
| bb917f9818 | |||
| 10248fb29f | |||
| 446dc85bdd | |||
| 4aa2c226a9 | |||
| bf9ba8313a | |||
| 444b59c557 | |||
| b2e1df94db | |||
| b4963cabc8 | |||
| 2851024340 | |||
| 7f25a25729 | |||
| acfe23265a | |||
| 2c6fbbd7dd | |||
| f84507f513 | |||
| be6a9e4a48 | |||
| 69e7634619 | |||
| d18748aba4 | |||
| 27c4ef3410 | |||
| a7ee392d3e | |||
| 4415a6fdef | |||
| 1e1e6e96a1 | |||
| 461d1dfbcc | |||
| 3e8c923641 | |||
| 5975fafefb | |||
| 71169fd545 | |||
| be895d564d | |||
| f36a27c218 | |||
| 8cdb07f151 | |||
| ea403a0ffe | |||
| 7f0b4e66ae | |||
| 3b226965ba | |||
| 63daf77412 | |||
| df5cbe30a6 | |||
| 9e1a536778 | |||
| a1db8833ef | |||
| 95dd0e0158 | |||
| 079a1d5cc3 | |||
| 2377d1a466 | |||
| 9f9f29391e | |||
| b64716d3f7 | |||
| d7a47abe38 | |||
| 58b314a61e | |||
| 4431ec7a5e | |||
| 9542026d70 | |||
| cc4c5b64c0 | |||
| 82c2aac4a0 | |||
| a143e0f0f1 | |||
| db9775dc32 | |||
| 538c0b0740 | |||
| 21cd88caf6 | |||
| 0660d9e2a5 | |||
| 25257f49d7 | |||
| dd615f106d | |||
| 5db64d61e0 | |||
| ee5e1f94e4 | |||
| 031e926414 | |||
| 88b4b3143d | |||
| c1ce84ecec | |||
| d670011363 | |||
| c88332366b | |||
| cfee282c28 | |||
| 91b42a3539 | |||
| 02b1d176c5 | |||
| 63d072b8cc | |||
| 256d44f255 | |||
| e2a6805a31 | |||
| d46fc12079 | |||
| 5ce88f107c | |||
| 683c4addd9 | |||
| db58cf2e68 | |||
| 1cf535865a | |||
| 6042d2a3c7 | |||
| df03819e12 | |||
| 072354afb7 | |||
| 57c7369aea | |||
| f92cdf335f | |||
| 19f3c857d5 | |||
| 7f3da73aa4 | |||
| c384c2b610 | |||
| 16d7dd426a | |||
| 787b6928d9 | |||
| ddbdbc5fb5 | |||
| d0edf9fb48 | |||
| 28d4446aa7 | |||
| ab3419ab09 | |||
| 457fe1535f | |||
| 6e90b02052 | |||
| fdc2680ae8 | |||
| 35a398443a | |||
| b55ce8aa93 | |||
| 74e67ef702 | |||
| e689248919 | |||
| 5a527b3fc9 | |||
| 565cc37912 | |||
| 50e1864a85 | |||
| 37ac88fc1b | |||
| 8ed98bcb07 | |||
| b8609ec149 | |||
| 96eb603bca | |||
| 20aaf35fc4 | |||
| 151a63a118 | |||
| 9db2267445 | |||
| 69a7ef063d | |||
| 8527875f0a | |||
| 2244da07e6 | |||
| 18bf710549 | |||
| 9e2e5a3f7f | |||
| 3df7fd6dd1 | |||
| 4371c46c4c | |||
| fcf7c1275b | |||
| e6e62fa767 | |||
| 8e1cb8fb70 | |||
| 00674686cb | |||
| b350bb2e7a | |||
| e17c704a4b | |||
| 3259245780 | |||
| 63f21084b6 | |||
| ced3555248 | |||
| 27eef24611 | |||
| dcf358f27d | |||
| 40afc8c0e2 | |||
| 1dabdbf7d8 | |||
| d65397a0ba | |||
| 8c72500070 | |||
| 2a27e21e00 | |||
| 3bc52a1f2c | |||
| 9806b5a0a9 | |||
| 201cd0f5fc | |||
| 5e2e92c11a | |||
| d57657599b | |||
| 995db834b2 | |||
| b22bc8a799 | |||
| dfd22aac46 | |||
| 72f62718f1 | |||
| e938a4d154 | |||
| 641019262e | |||
| fe9056f081 | |||
| fba49b8088 | |||
| a5ae1eea30 | |||
| 6e0ee9ec32 | |||
| a5e3e10e84 | |||
| 99afbdd606 | |||
| 90c0b83c34 | |||
| 68f9dd1ce1 | |||
| 51e4b1de99 | |||
| 08f091a889 | |||
| 692e3cc56e | |||
| bcfbccc381 | |||
| 8aa8c65d0e | |||
| 635d485b69 | |||
| c0630eeebb | |||
| 8932be2d49 | |||
| 3905486240 | |||
| eedc14b13c | |||
| 44bb615eee | |||
| 541d387143 | |||
| a8ad9c10bd | |||
| f1669224da | |||
| 2a27061891 | |||
| 6c55b2de58 | |||
| 9b99855c43 | |||
| 0269e88575 | |||
| 7fbd43283d | |||
| 226c123b77 | |||
| ac271d1006 | |||
| af84425689 | |||
| 512e9c947c | |||
| e7319376a5 | |||
| 2a7b493769 | |||
| f516a0d2e4 | |||
| 62f872122c | |||
| 89737d6e00 | |||
| 6a81d54e53 | |||
| c0062746eb | |||
| 809a904bc8 | |||
| 602d27c7b0 | |||
| aad61e876f | |||
| eb0e9947f2 | |||
| 23a09cff1b | |||
| ebe9041fdc | |||
| f93ef09b58 | |||
| e74cfb93b5 | |||
| 4a44621f87 | |||
| c7acaa2f5e | |||
| 139abad1f4 | |||
| a3a5306f11 | |||
| fb1c3bc446 | |||
| aaf344a4dd | |||
| 62ca9c0ed2 | |||
| dc8be8740d | |||
| d9bcf4df92 | |||
| 7ceb94f9c2 | |||
| 2e5becb4fb | |||
| 5e12f568bd | |||
| 80382c0bf9 | |||
| 91150d4150 | |||
| 6bfc38db53 | |||
| 95b99db199 | |||
| 1b13395e65 | |||
| fe21904b53 | |||
| ab0d666f03 | |||
| 30add7a765 | |||
| 83971a1913 | |||
| 2f62081683 | |||
| c7eb81dfa4 | |||
| 9f35f526e0 | |||
| e755a63250 | |||
| 29c6b62ba1 | |||
| 9d69903c36 | |||
| 51475a9290 | |||
| a9e794bde9 | |||
| 5114a7aa27 | |||
| d14042e536 | |||
| 7819fca349 | |||
| 68d9cfb550 | |||
| 1b7fd95214 | |||
| 0a1e6ccf9a | |||
| 0db3f415a8 | |||
| 8a1385b9d0 | |||
| a52143b0ef | |||
| 75ec41c85a | |||
| 827c8b3c48 | |||
| 194b35d889 | |||
| 1b33523537 | |||
| 807b95597a | |||
| 14b1ffa413 | |||
| d1db4d5534 | |||
| a45c0e537f | |||
| 4dab9b8fa3 | |||
| a84f8ba5d6 | |||
| f6f5cab661 | |||
| 618f563ce9 | |||
| 5b49c90538 | |||
| 41be0003f1 | |||
| 8f8ee28ba0 | |||
| b3ae7fbb49 | |||
| 837854de1e | |||
| 8cc1f0726f | |||
| e1d617ef70 | |||
| 5f199d68f9 | |||
| b8cca2db97 | |||
| 35e959219d | |||
| 08d466faee | |||
| 0b5823f451 | |||
| c77b150c28 | |||
| 3cf27bb838 | |||
| 26a90435c7 | |||
| f6efaba906 | |||
| ff0e831da9 | |||
| 96bb65723a | |||
| 33ac4bc424 | |||
| 698503b467 | |||
| 0657525d40 | |||
| 064d0de531 | |||
| 471bf36a7b | |||
| cb7d2b4040 | |||
| 6032cbcf45 | |||
| 73785d7552 | |||
| 431b5ffa59 | |||
| c0500a0d4d | |||
| 5300534188 | |||
| 02192a5f53 | |||
| 2a98d5b8ee | |||
| 4f495b5fc6 | |||
| b75e2d23a2 | |||
| 5261cdc794 | |||
| b179f61c6f | |||
| 71b245ad6f | |||
| 5b070cf87a | |||
| b8afe0b364 | |||
| 92b4ec48f7 | |||
| 6a69ac997d | |||
| 8c542c30a9 | |||
| 5c59f93138 | |||
| 4a5591be75 | |||
| e756764398 | |||
| 568b9c3a4c | |||
| 13a4aa5212 | |||
| a8388c841f | |||
| 87f1f59855 | |||
| c8c67d2a3d | |||
| a042fa0b9a | |||
| b68d870599 | |||
| 2c63f10dca | |||
| 7b8e2d0dc7 | |||
| 5bb55bcc7d | |||
| 08c49b0d5f | |||
| 5b07c8adc6 | |||
| ca7e61c701 | |||
| 6795df10bd | |||
| 1e98a35953 | |||
| 2ab3fedf8f | |||
| 915fc33dd7 | |||
| c79a5359b1 | |||
| 632f176cdd | |||
| 99e7857ac8 | |||
| 9ff3837e49 | |||
| 6c91d0da5a | |||
| 12dd3c5eea | |||
| 04da822826 | |||
| 40a8f0775e | |||
| 65aaebe2b5 | |||
| 769559279f | |||
| bb7fd38c46 | |||
| a734927a42 | |||
| e21eca2a16 | |||
| 33c8c2fe47 | |||
| c3048858e9 | |||
| 259fe63ceb | |||
| d1aa3b7982 | |||
| e4af7b3a53 | |||
| 51bd392fed | |||
| 9bc4a2c564 | |||
| 550d28388a | |||
| e073b4f81b | |||
| fc0fdb5e37 | |||
| 9d6b2ed937 | |||
| 86468b9552 | |||
| 8c1b76f3c3 | |||
| 6fc6a499ec | |||
| 293b83c3df | |||
| 99df58f6d2 | |||
| 454f3f84b2 | |||
| 2d558c3963 | |||
| 055b49936a | |||
| 48289c3c5a | |||
| 0a09de2ed7 | |||
| f7a57ca3e2 | |||
| cfa93a78a3 | |||
| e4e616ee56 | |||
| 5cf2d243f0 | |||
| 0a35c4f1c7 | |||
| 4b94ff7492 | |||
| aacc0b47c0 | |||
| b526a2d9cf | |||
| af32450eca | |||
| 8664f73855 | |||
| 8bfa53fe66 | |||
| 16ad029335 | |||
| 82bd6228b8 | |||
| a747f28999 | |||
| 142310bd63 | |||
| 67c8b6536a | |||
| efc0e2e0ae | |||
| 0aa0129be9 | |||
| 355910bade | |||
| 74ab63232b | |||
| 90418fa4ec | |||
| 8983e9b0f0 | |||
| cc4bac899e | |||
| 82f30f5637 | |||
| ade9d8fb8e | |||
| 402152f96b | |||
| a43d76d4a7 | |||
| 824c13cb85 | |||
| 0904d3dc5d | |||
| 978ef781e4 | |||
| 18b8915f22 | |||
| 9bbfc2414e | |||
| 9487aa1ed5 | |||
| fd74c52fe8 | |||
| 0d2bf51a2e | |||
| 551c0edadf | |||
| f80b06293b | |||
| b3fec86413 | |||
| ab886a34d7 | |||
| 1ec9da120e | |||
| 817178272d | |||
| 3316c6b41c | |||
| 9214b0669d | |||
| b3d659b9af | |||
| 05b0fca610 | |||
| 64b909f436 | |||
| a2e6299aaa | |||
| 1fbfcab55e | |||
| 7db567ea74 | |||
| 6354c16776 | |||
| eb4c3dd3c7 | |||
| 8a4330132c | |||
| f2d4f828d4 | |||
| fe8030a9ad | |||
| ec12633ae0 | |||
| 5e24733e41 | |||
| a13911435f | |||
| 857bb4596a | |||
| 1359de75b5 | |||
| f9d1a6e013 | |||
| b18e1228a8 | |||
| b501eb5a19 | |||
| bfab1d407b | |||
| 4ef334a70f | |||
| af60503115 | |||
| b3a7a9df2c | |||
| 6b90e4c1b3 | |||
| 108634b94f | |||
| 4bb92be1e4 | |||
| 7678d319f2 | |||
| aaff02bc4b | |||
| 34f5398f41 | |||
| c06d1e5b09 | |||
| 0af7773c40 | |||
| a44ee19114 | |||
| 2726e375ea | |||
| b599813600 | |||
| bea4af984f | |||
| 5dbbb7d4c1 | |||
| c8ea424c7a | |||
| 8de110e577 | |||
| 7e82b89f36 | |||
| 669483699f | |||
| 672dde6e58 | |||
| 31a1a4b4d0 | |||
| f12a8d8006 | |||
| 03ea3af58c | |||
| cc2585360b | |||
| ff59660585 | |||
| 6063ce22fd | |||
| bc7cf343cc | |||
| 938eaf5d2d | |||
| a0bf44addb | |||
| 8d7e1624c7 | |||
| d1c9f30dfc | |||
| e57eb0caa3 | |||
| 7699f5432d | |||
| fe3b1f4f50 | |||
| 35f3030db6 | |||
| c0f31bbef2 | |||
| 0f654ae04b | |||
| be2dc5df28 | |||
| d6aeedd0e3 | |||
| dc91f5fdf7 | |||
| 4f6f245006 | |||
| ac69adba7a | |||
| b0bb4108a8 | |||
| 6ff932a055 | |||
| c850e7578b | |||
| 577534813d | |||
| 7d2fe9c69f | |||
| 68bdaaa657 | |||
| 7db9bc0c63 | |||
| cd8d22b33f | |||
| 802860050f | |||
| 3fda1deece | |||
| fb7fb760a0 | |||
| a4d6d7bc7d | |||
| f7cc69b5ec | |||
| 74b34a3730 | |||
| fc2a1b527e | |||
| 3e85a90b92 | |||
| 74ab98ddec | |||
| bff788b484 | |||
| 3e1abd2c6c | |||
| 79c76ea9d7 | |||
| 6f2cb31d41 | |||
| cc88141772 | |||
| 02d9bb0518 | |||
| 5321fb3135 | |||
| ea5038e4b7 | |||
| b012207764 | |||
| 9fa6d4a8a7 | |||
| c77dd18f2d | |||
| bb7c0d7deb | |||
| 80d3fc9482 | |||
| 79a721226d | |||
| ed36d41024 | |||
| 9a15c8ece0 | |||
| 9c5220ce75 | |||
| 8c67635041 | |||
| fc7f35141a | |||
| fc65e6b97d | |||
| 629bd3239a | |||
| 31c99baf1c | |||
| b2810777ef | |||
| 805d6fb81d | |||
| 9c566b0530 | |||
| daa14b8a5f | |||
| ed4fe4ac22 | |||
| b76562061e | |||
| baa91540cf | |||
| a594e22d2d | |||
| 91615a6602 | |||
| 43144ae782 | |||
| e927fc1800 | |||
| a08e904834 | |||
| 90429ab63d | |||
| abaab0caca | |||
| bc5c2e5c7b | |||
| c3e4b37414 | |||
| 63906798e8 | |||
| d7c2453c7d | |||
| 6a61ea46bf | |||
| 5a765aa1d6 | |||
| 3cab956f94 | |||
| c65d671ddb | |||
| 985f3b52bb | |||
| 4636a763b0 | |||
| f4ddf89b51 | |||
| ca9410f702 | |||
| 50c0b04017 | |||
| 41464386d6 | |||
| a07a94108d | |||
| a7cc8020db | |||
| 761fa4d836 | |||
| ade5587a15 | |||
| 2db8a8c2e3 | |||
| 3ad826e358 | |||
| 87925a36e6 | |||
| fc6ff47fd2 | |||
| 17b22f4673 | |||
| b033d0fbe9 | |||
| 122ab88fa5 | |||
| 73c188761f | |||
| 0fbf7b4ace | |||
| f9394ebb22 | |||
| 05f2f388d9 | |||
| d489a2120f | |||
| 8954a80e04 | |||
| f264211550 | |||
| 4d990d012c | |||
| 2683121ee1 | |||
| 08c2d4620f | |||
| 643ad626cd | |||
| 2619d4175d | |||
| b00821dbe9 | |||
| b0a742c3e6 | |||
| 9d0cadfc5f | |||
| 4ea034082b | |||
| 2298f42c18 | |||
| a67bfe26ed | |||
| d73ac8e718 | |||
| 213a68bb0f | |||
| 5bba0de1f3 | |||
| f1d609df5f | |||
| f9f6dc6985 | |||
| 4ae690612a | |||
| dc74b40c7a | |||
| b6b2598119 | |||
| 5cd54e2f98 | |||
| 8b7a94f8c5 | |||
| 44ab4d838f | |||
| 372ac1a24b | |||
| 09f02ff9b3 | |||
| 9dc30f5385 | |||
| 5871959c15 | |||
| e108757255 | |||
| 3cdc7e3feb | |||
| bc1a0fe651 | |||
| 5752fb6921 | |||
| f36f4b2dae | |||
| 8ee5503505 | |||
| da7199b3e9 | |||
| 67be6f373a | |||
| d5cbaa9ec7 | |||
| e7206a7dea | |||
| 5cdab4e311 | |||
| ee293da4f6 | |||
| 5a50ed2dfe | |||
| 452b678450 | |||
| abafa6014c | |||
| 1a3940376a | |||
| 775be4da64 | |||
| fcd70abc1f |
@@ -0,0 +1,8 @@
|
||||
# Changesets
|
||||
|
||||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
||||
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
||||
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
||||
|
||||
We have a quick list of common questions to get you started engaging with this project in
|
||||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"decorators": true
|
||||
},
|
||||
"target": "esnext",
|
||||
"transform": {
|
||||
"decoratorVersion": "2022-03"
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "commonjs",
|
||||
"ignoreDynamic": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
"turbo",
|
||||
"prettier",
|
||||
"plugin:@typescript-eslint/recommended-type-checked-only",
|
||||
],
|
||||
parserOptions: {
|
||||
project: true,
|
||||
__tsconfigRootDir: __dirname,
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "999.999.999",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"max-params": ["error", 4],
|
||||
"prefer-const": "error",
|
||||
"@typescript-eslint/no-floating-promises": [
|
||||
"error",
|
||||
{
|
||||
ignoreIIFE: true,
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/await-thenable": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"no-array-constructor": "off",
|
||||
"@typescript-eslint/no-array-constructor": "off",
|
||||
"@typescript-eslint/no-base-to-string": "off",
|
||||
"@typescript-eslint/no-duplicate-enum-values": "off",
|
||||
"@typescript-eslint/no-duplicate-type-constituents": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extra-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-for-in-array": "off",
|
||||
"no-implied-eval": "off",
|
||||
"@typescript-eslint/no-implied-eval": "off",
|
||||
"no-loss-of-precision": "off",
|
||||
"@typescript-eslint/no-loss-of-precision": "off",
|
||||
"@typescript-eslint/no-misused-new": "off",
|
||||
"@typescript-eslint/no-misused-promises": "off",
|
||||
"@typescript-eslint/no-namespace": "off",
|
||||
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
|
||||
"@typescript-eslint/no-redundant-type-constituents": "off",
|
||||
"@typescript-eslint/no-this-alias": "off",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
||||
"@typescript-eslint/no-unnecessary-type-constraint": "off",
|
||||
"@typescript-eslint/no-unsafe-argument": "off",
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/no-unsafe-declaration-merging": "off",
|
||||
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/no-unsafe-return": "off",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/prefer-as-const": "off",
|
||||
"require-await": "off",
|
||||
"@typescript-eslint/require-await": "off",
|
||||
"@typescript-eslint/restrict-plus-operands": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/triple-slash-reference": "off",
|
||||
"@typescript-eslint/unbound-method": "off",
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ["examples/**/*.ts"],
|
||||
rules: {
|
||||
"turbo/no-undeclared-env-vars": "off",
|
||||
},
|
||||
},
|
||||
],
|
||||
ignorePatterns: ["dist/", "lib/", "deps/"],
|
||||
};
|
||||
@@ -1,10 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
// This tells ESLint to load the config from the package `eslint-config-custom`
|
||||
extends: ["custom"],
|
||||
settings: {
|
||||
next: {
|
||||
rootDir: ["apps/*/"],
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
examples/readers/data/** binary
|
||||
examples/data/** binary
|
||||
@@ -0,0 +1,10 @@
|
||||
name: Bugfix
|
||||
title: ""
|
||||
description: Write something like "We notice ... behavior when ... happens instead of ..." If you would like to use sweep.dev prefix with "Sweep:"
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details about the bug
|
||||
placeholder: The bug might be in ... file
|
||||
@@ -0,0 +1,10 @@
|
||||
name: Feature Request
|
||||
title: ""
|
||||
description: Write something like "Write an api endpoint that does "..." in the "..." file". If you would like to use sweep.dev prefix with "Sweep:"
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details
|
||||
placeholder: The new endpoint should use the ... class from ... file because it contains ... logic
|
||||
@@ -0,0 +1,10 @@
|
||||
name: Refactor
|
||||
title: ""
|
||||
description: Write something like "Modify the ... api endpoint to use ... version and ... framework" If you would like to use sweep.dev prefix with "Sweep:"
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Details
|
||||
description: More details
|
||||
placeholder: We are migrating this function to ... version because ...
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Lint on push or pull request
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Run lint
|
||||
run: pnpm run lint
|
||||
- name: Run Prettier
|
||||
run: pnpm run format
|
||||
@@ -0,0 +1,36 @@
|
||||
name: Publish
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Publish @llamaindex/env
|
||||
run: npx jsr publish
|
||||
working-directory: packages/env
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish @llamaindex/core
|
||||
run: npx jsr publish --allow-slow-types
|
||||
working-directory: packages/core
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Publish to GitHub Releases
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "llamaindex@*"
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Build tarball
|
||||
run: |
|
||||
pnpm pack
|
||||
working-directory: packages/core
|
||||
|
||||
- name: Create release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "packages/core/llamaindex-*.tgz"
|
||||
name: Release ${{ github.ref }}
|
||||
bodyFile: "packages/core/CHANGELOG.md"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Add auth token to .npmrc file
|
||||
run: |
|
||||
cat << EOF >> ".npmrc"
|
||||
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
||||
EOF
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Get changeset status
|
||||
id: get-changeset-status
|
||||
run: |
|
||||
pnpm changeset status --output .changeset/status.json
|
||||
new_version=$(jq -r '.releases[] | select(.name == "llamaindex") | .newVersion' < .changeset/status.json)
|
||||
rm -v .changeset/status.json
|
||||
echo "new-version=${new_version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create Release Pull Request or Publish to npm
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
commit: Release ${{ steps.get-changeset-status.outputs.new-version }}
|
||||
title: Release ${{ steps.get-changeset-status.outputs.new-version }}
|
||||
# update version PR with the latest changesets
|
||||
version: pnpm new-version
|
||||
# build package and call changeset publish
|
||||
publish: pnpm release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
@@ -0,0 +1,133 @@
|
||||
name: Run Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [18.x, 20.x, 22.x]
|
||||
name: E2E on Node.js ${{ matrix.node-version }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Run E2E Tests
|
||||
run: pnpm run e2e
|
||||
|
||||
test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [18.x, 20.x, 22.x]
|
||||
name: Test on Node.js ${{ matrix.node-version }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Run tests
|
||||
run: pnpm run test
|
||||
typecheck:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Build
|
||||
run: pnpm run build --filter llamaindex
|
||||
- name: Use Build For Examples
|
||||
run: pnpm link ../packages/core/
|
||||
working-directory: ./examples
|
||||
- name: Run Type Check
|
||||
run: pnpm run type-check
|
||||
- name: Run Circular Dependency Check
|
||||
run: pnpm run circular-check
|
||||
working-directory: ./packages/core
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: typecheck-build-dist
|
||||
path: ./packages/core/dist
|
||||
if-no-files-found: error
|
||||
core-edge-runtime:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Build
|
||||
run: pnpm run build --filter @llamaindex/edge
|
||||
- name: Build Edge Runtime
|
||||
run: pnpm run build
|
||||
working-directory: ./packages/edge/e2e/test-edge-runtime
|
||||
typecheck-examples:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Build
|
||||
run: pnpm run build --filter llamaindex
|
||||
- name: Copy examples
|
||||
run: rsync -rv --exclude=node_modules ./examples ${{ runner.temp }}
|
||||
- name: Pack @llamaindex/env
|
||||
run: pnpm pack --pack-destination ${{ runner.temp }}
|
||||
working-directory: packages/env
|
||||
- name: Pack llamaindex
|
||||
run: pnpm pack --pack-destination ${{ runner.temp }}
|
||||
working-directory: packages/core
|
||||
- name: Install
|
||||
run: npm add ${{ runner.temp }}/*.tgz
|
||||
working-directory: ${{ runner.temp }}/examples
|
||||
- name: Run Type Check
|
||||
run: npx tsc --project ./tsconfig.json
|
||||
working-directory: ${{ runner.temp }}/examples
|
||||
+13
-1
@@ -3,6 +3,7 @@
|
||||
# dependencies
|
||||
node_modules
|
||||
.pnp
|
||||
.pnpm-store
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
@@ -35,4 +36,15 @@ yarn-error.log*
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
storage/
|
||||
dist/
|
||||
lib/
|
||||
|
||||
.cache
|
||||
test-results/
|
||||
playwright-report/
|
||||
blob-report/
|
||||
playwright/.cache/
|
||||
.tsbuildinfo
|
||||
|
||||
# intellij
|
||||
**/.idea
|
||||
|
||||
+2
-3
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
pnpm format
|
||||
pnpm lint
|
||||
npx lint-staged
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
pnpm test
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
auto-install-peers = true
|
||||
enable-pre-post-scripts = true
|
||||
prefer-workspace-packages = true
|
||||
save-workspace-protocol = true
|
||||
link-workspace-packages = true
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
apps/docs/i18n
|
||||
apps/docs/docs/api
|
||||
pnpm-lock.yaml
|
||||
lib/
|
||||
dist/
|
||||
.docusaurus/
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"decorators": true
|
||||
},
|
||||
"target": "esnext",
|
||||
"transform": {
|
||||
"decoratorVersion": "2022-03"
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Debug Example",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"runtimeExecutable": "pnpm",
|
||||
"console": "integratedTerminal",
|
||||
"cwd": "${workspaceFolder}/examples",
|
||||
"runtimeArgs": ["npx", "tsx", "${file}"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+9
@@ -4,5 +4,14 @@
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[xml]": {
|
||||
"editor.defaultFormatter": "redhat.vscode-xml"
|
||||
},
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.black-formatter"
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
||||
|
||||
+27
-5
@@ -8,17 +8,17 @@ Right now there are two packages of importance:
|
||||
|
||||
packages/core which is the main NPM library llamaindex
|
||||
|
||||
apps/simple is where the demo code lives
|
||||
examples is where the demo code lives
|
||||
|
||||
### Turborepo docs
|
||||
|
||||
You can checkout how Turborepo works using the built in [README-turborepo.md](README-turborepo.md)
|
||||
You can checkout how Turborepo works using the default [README-turborepo.md](/README-turborepo.md)
|
||||
|
||||
## Getting Started
|
||||
|
||||
Install NodeJS. Preferably v18 using nvm or n.
|
||||
|
||||
Inside the llamascript directory:
|
||||
Inside the LlamaIndexTS directory:
|
||||
|
||||
```
|
||||
npm i -g pnpm ts-node
|
||||
@@ -41,12 +41,14 @@ To run them, run
|
||||
pnpm run test
|
||||
```
|
||||
|
||||
To write new test cases write them in packages/core/src/tests
|
||||
To write new test cases write them in [packages/core/src/tests](/packages/core/src/tests)
|
||||
|
||||
We use Jest https://jestjs.io/ to write our test cases. Jest comes with a bunch of built in assertions using the expect function: https://jestjs.io/docs/expect
|
||||
|
||||
### Demo applications
|
||||
|
||||
There is an existing ["example"](/examples/README.md) demos folder with mainly NodeJS scripts. Feel free to add additional demos to that folder. If you would like to try out your changes in the core package with a new demo, you need to run the build command in the README.
|
||||
|
||||
You can create new demo applications in the apps folder. Just run pnpm init in the folder after you create it to create its own package.json
|
||||
|
||||
### Installing packages
|
||||
@@ -54,7 +56,7 @@ You can create new demo applications in the apps folder. Just run pnpm init in t
|
||||
To install packages for a specific package or demo application, run
|
||||
|
||||
```
|
||||
pnpm add [NPM Package] --filter [package or application i.e. core or simple]
|
||||
pnpm add [NPM Package] --filter [package or application i.e. core or docs]
|
||||
```
|
||||
|
||||
To install packages for every package or application run
|
||||
@@ -76,3 +78,23 @@ pnpm start
|
||||
That should start a webserver which will serve the docs on https://localhost:3000
|
||||
|
||||
Any changes you make should be reflected in the browser. If you need to regenerate the API docs and find that your TSDoc isn't getting the updates, feel free to remove apps/docs/api. It will automatically regenerate itself when you run pnpm start again.
|
||||
|
||||
## Changeset
|
||||
|
||||
We use [changesets](https://github.com/changesets/changesets) for managing versions and changelogs. To create a new changeset, run:
|
||||
|
||||
```
|
||||
pnpm changeset
|
||||
```
|
||||
|
||||
Please send a descriptive changeset for each PR.
|
||||
|
||||
## Publishing (maintainers only)
|
||||
|
||||
The [Release Github Action](.github/workflows/release.yml) is automatically generating and updating a
|
||||
PR called "Release {version}".
|
||||
|
||||
This PR will update the `package.json` and `CHANGELOG.md` files of each package according to
|
||||
the current changesets in the [.changeset](.changeset/) folder.
|
||||
|
||||
If this PR is merged it will automatically add version tags to the repository and publish the updated packages to NPM.
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
# Turborepo starter
|
||||
|
||||
This is an official starter Turborepo.
|
||||
|
||||
## Using this example
|
||||
|
||||
Run the following command:
|
||||
|
||||
```sh
|
||||
npx create-turbo@latest
|
||||
```
|
||||
|
||||
## What's inside?
|
||||
|
||||
This Turborepo includes the following packages/apps:
|
||||
|
||||
### Apps and Packages
|
||||
|
||||
- `docs`: a [Next.js](https://nextjs.org/) app
|
||||
- `web`: another [Next.js](https://nextjs.org/) app
|
||||
- `ui`: a stub React component library shared by both `web` and `docs` applications
|
||||
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
|
||||
- `tsconfig`: `tsconfig.json`s used throughout the monorepo
|
||||
|
||||
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
|
||||
|
||||
### Utilities
|
||||
|
||||
This Turborepo has some additional tools already setup for you:
|
||||
|
||||
- [TypeScript](https://www.typescriptlang.org/) for static type checking
|
||||
- [ESLint](https://eslint.org/) for code linting
|
||||
- [Prettier](https://prettier.io) for code formatting
|
||||
|
||||
### Build
|
||||
|
||||
To build all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Develop
|
||||
|
||||
To develop all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Remote Caching
|
||||
|
||||
Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
|
||||
|
||||
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
npx turbo login
|
||||
```
|
||||
|
||||
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
|
||||
|
||||
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
|
||||
|
||||
```
|
||||
npx turbo link
|
||||
```
|
||||
|
||||
## Useful Links
|
||||
|
||||
Learn more about the power of Turborepo:
|
||||
|
||||
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
|
||||
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
|
||||
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
|
||||
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
|
||||
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
|
||||
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
|
||||
@@ -1,21 +1,37 @@
|
||||
# LlamaIndex.TS
|
||||
|
||||
[](https://www.npmjs.com/package/llamaindex)
|
||||
[](https://www.npmjs.com/package/llamaindex)
|
||||
[](https://www.npmjs.com/package/llamaindex)
|
||||
[](https://discord.com/invite/eN6D2HQ4aX)
|
||||
|
||||
LlamaIndex is a data framework for your LLM application.
|
||||
|
||||
Use your own data with large language models (LLMs, OpenAI ChatGPT and others) in Typescript and Javascript.
|
||||
|
||||
Documentation: https://ts.llamaindex.ai/
|
||||
|
||||
Try examples online:
|
||||
|
||||
[](https://stackblitz.com/github/run-llama/LlamaIndexTS/tree/main/examples)
|
||||
|
||||
## What is LlamaIndex.TS?
|
||||
|
||||
LlamaIndex.TS aims to be a lightweight, easy to use set of libraries to help you integrate large language models into your applications with your own data.
|
||||
|
||||
## Getting started with an example:
|
||||
|
||||
LlamaIndex.TS requries Node v18 or higher. You can download it from https://nodejs.org or use https://nvm.sh (our preferred option).
|
||||
LlamaIndex.TS requires Node v18 or higher. You can download it from https://nodejs.org or use https://nvm.sh (our preferred option).
|
||||
|
||||
In a new folder:
|
||||
|
||||
```bash
|
||||
export OPEN_AI_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
npx tsc –-init # if needed
|
||||
export OPENAI_API_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
pnpm init
|
||||
pnpm install typescript
|
||||
pnpm exec tsc --init # if needed
|
||||
pnpm install llamaindex
|
||||
pnpm install @types/node
|
||||
```
|
||||
|
||||
Create the file example.ts
|
||||
@@ -29,7 +45,7 @@ async function main() {
|
||||
// Load essay from abramov.txt in Node
|
||||
const essay = await fs.readFile(
|
||||
"node_modules/llamaindex/examples/abramov.txt",
|
||||
"utf-8"
|
||||
"utf-8",
|
||||
);
|
||||
|
||||
// Create Document object with essay
|
||||
@@ -40,38 +56,147 @@ async function main() {
|
||||
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.aquery(
|
||||
"What did the author do in college?"
|
||||
);
|
||||
const response = await queryEngine.query({
|
||||
query: "What did the author do in college?",
|
||||
});
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
||||
Then you can run it using
|
||||
|
||||
```bash
|
||||
npx ts-node example.ts
|
||||
pnpm dlx ts-node example.ts
|
||||
```
|
||||
|
||||
## Core concepts:
|
||||
## Playground
|
||||
|
||||
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
|
||||
Check out our NextJS playground at https://llama-playground.vercel.app/. The source is available at https://github.com/run-llama/ts-playground
|
||||
|
||||
- [Node](packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
## Core concepts for getting started:
|
||||
|
||||
- Indexes: indexes store the Nodes and the embeddings of those nodes.
|
||||
- [Document](/packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
|
||||
|
||||
- [QueryEngine](packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
|
||||
- [Node](/packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
|
||||
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
|
||||
- [Embedding](/packages/core/src/embeddings/OpenAIEmbedding.ts): Embeddings are sets of floating point numbers which represent the data in a Node. By comparing the similarity of embeddings, we can derive an understanding of the similarity of two pieces of data. One use case is to compare the embedding of a question with the embeddings of our Nodes to see which Nodes may contain the data needed to answer that quesiton. Because the default service context is OpenAI, the default embedding is `OpenAIEmbedding`. If using different models, say through Ollama, use this [Embedding](/packages/core/src/embeddings/OllamaEmbedding.ts) (see all [here](/packages/core/src/embeddings)).
|
||||
|
||||
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
|
||||
- [Indices](/packages/core/src/indices/): Indices store the Nodes and the embeddings of those nodes. QueryEngines retrieve Nodes from these Indices using embedding similarity.
|
||||
|
||||
- [QueryEngine](/packages/core/src/engines/query/RetrieverQueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected Nodes from your Index to give the LLM the context it needs to answer your query. To build a query engine from your Index (recommended), use the [`asQueryEngine`](/packages/core/src/indices/BaseIndex.ts) method on your Index. See all query engines [here](/packages/core/src/engines/query).
|
||||
|
||||
- [ChatEngine](/packages/core/src/engines/chat/SimpleChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indices. See all chat engines [here](/packages/core/src/engines/chat).
|
||||
|
||||
- [SimplePrompt](/packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and formats them in a template literal. SimplePrompts can be specialized using currying and combined using other SimplePrompt functions.
|
||||
|
||||
## Using NextJS
|
||||
|
||||
If you're using the NextJS App Router, you can choose between the Node.js and the [Edge runtime](https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#edge-runtime).
|
||||
|
||||
With NextJS 13 and 14, using the Node.js runtime is the default. You can explicitly set the Edge runtime in your [router handler](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) by adding this line:
|
||||
|
||||
```typescript
|
||||
export const runtime = "edge";
|
||||
```
|
||||
|
||||
The following sections explain further differences in using the Node.js or Edge runtime.
|
||||
|
||||
### Using the Node.js runtime
|
||||
|
||||
Add the following config to your `next.config.js` to ignore specific packages in the server-side bundling:
|
||||
|
||||
```js
|
||||
// next.config.js
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: [
|
||||
"pdf2json",
|
||||
"@zilliz/milvus2-sdk-node",
|
||||
"sharp",
|
||||
"onnxruntime-node",
|
||||
],
|
||||
},
|
||||
webpack: (config) => {
|
||||
config.externals.push({
|
||||
pdf2json: "commonjs pdf2json",
|
||||
"@zilliz/milvus2-sdk-node": "commonjs @zilliz/milvus2-sdk-node",
|
||||
sharp: "commonjs sharp",
|
||||
"onnxruntime-node": "commonjs onnxruntime-node",
|
||||
});
|
||||
|
||||
return config;
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
```
|
||||
|
||||
### Using the Edge runtime
|
||||
|
||||
We publish a dedicated package (`@llamaindex/edge` instead of `llamaindex`) for using the Edge runtime. To use it, first install the package:
|
||||
|
||||
```shell
|
||||
pnpm install @llamaindex/edge
|
||||
```
|
||||
|
||||
> _Note_: Ensure that your `package.json` doesn't include the `llamaindex` package if you're using `@llamaindex/edge`.
|
||||
|
||||
Then make sure to use the correct import statement in your code:
|
||||
|
||||
```typescript
|
||||
// replace 'llamaindex' with '@llamaindex/edge'
|
||||
import {} from "@llamaindex/edge";
|
||||
```
|
||||
|
||||
A further difference is that the `@llamaindex/edge` package doesn't export classes from the `readers` or `storage` folders. The reason is that most of these classes are not compatible with the Edge runtime.
|
||||
|
||||
If you need any of those classes, you have to import them instead directly. Here's an example for importing the `PineconeVectorStore` class:
|
||||
|
||||
```typescript
|
||||
import { PineconeVectorStore } from "@llamaindex/edge/storage/vectorStore/PineconeVectorStore";
|
||||
```
|
||||
|
||||
As the `PDFReader` is not working with the Edge runtime, here's how to use the `SimpleDirectoryReader` with the `LlamaParseReader` to load PDFs:
|
||||
|
||||
```typescript
|
||||
import { SimpleDirectoryReader } from "@llamaindex/edge/readers/SimpleDirectoryReader";
|
||||
import { LlamaParseReader } from "@llamaindex/edge/readers/LlamaParseReader";
|
||||
|
||||
export const DATA_DIR = "./data";
|
||||
|
||||
export async function getDocuments() {
|
||||
const reader = new SimpleDirectoryReader();
|
||||
// Load PDFs using LlamaParseReader
|
||||
return await reader.loadData({
|
||||
directoryPath: DATA_DIR,
|
||||
fileExtToReader: {
|
||||
pdf: new LlamaParseReader({ resultType: "markdown" }),
|
||||
},
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
> _Note_: Reader classes have to be added explictly to the `fileExtToReader` map in the Edge version of the `SimpleDirectoryReader`.
|
||||
|
||||
You'll find a complete example of using the Edge runtime with LlamaIndexTS here: https://github.com/run-llama/create_llama_projects/tree/main/nextjs-edge-llamaparse
|
||||
|
||||
## Supported LLMs:
|
||||
|
||||
- OpenAI GPT-3.5-turbo and GPT-4
|
||||
- Anthropic Claude 3 (Opus, Sonnet, and Haiku) and the legacy models (Claude 2 and Instant)
|
||||
- Groq LLMs
|
||||
- Llama2/3 Chat LLMs (70B, 13B, and 7B parameters)
|
||||
- MistralAI Chat LLMs
|
||||
- Fireworks Chat LLMs
|
||||
|
||||
## Contributing:
|
||||
|
||||
We are in the very early days of LlamaIndex.TS. If you’re interested in hacking on it with us check out our [contributing guide](CONTRIBUTING.md)
|
||||
We are in the very early days of LlamaIndex.TS. If you’re interested in hacking on it with us check out our [contributing guide](/CONTRIBUTING.md)
|
||||
|
||||
## Bugs? Questions?
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
lib
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# docs
|
||||
|
||||
## 0.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6277105]
|
||||
- llamaindex@0.2.13
|
||||
|
||||
## 0.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d8d952d]
|
||||
- llamaindex@0.2.12
|
||||
|
||||
## 0.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [87142b2]
|
||||
- Updated dependencies [5a6cc0e]
|
||||
- Updated dependencies [87142b2]
|
||||
- llamaindex@0.2.11
|
||||
|
||||
## 0.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5116ad8]
|
||||
- @llamaindex/env@0.0.5
|
||||
|
||||
## 0.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 09bf27a: Add Groq LLM to LlamaIndex
|
||||
- Updated dependencies [cf87f84]
|
||||
- @llamaindex/env@0.0.4
|
||||
|
||||
## 0.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 0f64084: docs: update API references
|
||||
|
||||
## 0.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 3154f52: chore: add qdrant readme
|
||||
@@ -5,21 +5,27 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta
|
||||
### Installation
|
||||
|
||||
```
|
||||
$ yarn
|
||||
$ pnpm
|
||||
```
|
||||
|
||||
### Local Development
|
||||
|
||||
```
|
||||
$ yarn start
|
||||
$ pnpm start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
However, the searchbar may not function with `yarn start`. Instead, run `yarn build` and launch a server:
|
||||
|
||||
```
|
||||
$ npx http-server ./build
|
||||
```
|
||||
|
||||
### Build
|
||||
|
||||
```
|
||||
$ yarn build
|
||||
$ pnpm build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
@@ -29,13 +35,13 @@ This command generates static content into the `build` directory and can be serv
|
||||
Using SSH:
|
||||
|
||||
```
|
||||
$ USE_SSH=true yarn deploy
|
||||
$ USE_SSH=true pnpm deploy
|
||||
```
|
||||
|
||||
Not using SSH:
|
||||
|
||||
```
|
||||
$ GIT_USER=<Your GitHub username> yarn deploy
|
||||
$ GIT_USER=<Your GitHub username> pnpm deploy
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module.exports = {
|
||||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
||||
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
|
||||
};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
api/
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -1,81 +0,0 @@
|
||||
---
|
||||
id: "BaseEmbedding"
|
||||
title: "Class: BaseEmbedding"
|
||||
sidebar_label: "BaseEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseEmbedding`**
|
||||
|
||||
↳ [`OpenAIEmbedding`](OpenAIEmbedding.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseEmbedding**()
|
||||
|
||||
## Methods
|
||||
|
||||
### aGetQueryEmbedding
|
||||
|
||||
▸ `Abstract` **aGetQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:206](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L206)
|
||||
|
||||
___
|
||||
|
||||
### aGetTextEmbedding
|
||||
|
||||
▸ `Abstract` **aGetTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `text` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L205)
|
||||
|
||||
___
|
||||
|
||||
### similarity
|
||||
|
||||
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `embedding1` | `number`[] | `undefined` |
|
||||
| `embedding2` | `number`[] | `undefined` |
|
||||
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:197](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L197)
|
||||
@@ -1,120 +0,0 @@
|
||||
---
|
||||
id: "BaseIndex"
|
||||
title: "Class: BaseIndex<T>"
|
||||
sidebar_label: "BaseIndex"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Indexes are the data structure that we store our nodes and embeddings in so
|
||||
they can be retrieved for our queries.
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseIndex`**
|
||||
|
||||
↳ [`VectorStoreIndex`](VectorStoreIndex.md)
|
||||
|
||||
↳ [`ListIndex`](ListIndex.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseIndex**<`T`\>(`init`)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<`T`\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:80](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L80)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `BaseDocumentStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
### indexStore
|
||||
|
||||
• `Optional` **indexStore**: `BaseIndexStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: `T`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: `VectorStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ `Abstract` **asRetriever**(): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L89)
|
||||
@@ -1,287 +0,0 @@
|
||||
---
|
||||
id: "BaseNode"
|
||||
title: "Class: BaseNode"
|
||||
sidebar_label: "BaseNode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Generic abstract class for retrievable nodes
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`BaseNode`**
|
||||
|
||||
↳ [`TextNode`](TextNode.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new BaseNode**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`BaseNode`](BaseNode.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:48](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L48)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `Record`<`string`, `any`\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
### getContent
|
||||
|
||||
▸ `Abstract` **getContent**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ `Abstract` **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:55](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
### getType
|
||||
|
||||
▸ `Abstract` **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### setContent
|
||||
|
||||
▸ `Abstract` **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `value` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:56](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L56)
|
||||
@@ -1,113 +0,0 @@
|
||||
---
|
||||
id: "ChatGPTLLMPredictor"
|
||||
title: "Class: ChatGPTLLMPredictor"
|
||||
sidebar_label: "ChatGPTLLMPredictor"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
ChatGPTLLMPredictor is a predictor that uses GPT.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ChatGPTLLMPredictor**(`props?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `props?` | `Partial`<[`ChatGPTLLMPredictor`](ChatGPTLLMPredictor.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L26)
|
||||
|
||||
## Properties
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### languageModel
|
||||
|
||||
• **languageModel**: [`OpenAI`](OpenAI.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: ``"gpt-3.5-turbo"`` \| ``"gpt-3.5-turbo-16k"`` \| ``"gpt-4"`` \| ``"gpt-4-32k"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### retryOnThrottling
|
||||
|
||||
• **retryOnThrottling**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L22)
|
||||
|
||||
## Methods
|
||||
|
||||
### apredict
|
||||
|
||||
▸ **apredict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` \| [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
| `input?` | `Record`<`string`, `string`\> |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseLLMPredictor](../interfaces/BaseLLMPredictor.md).[apredict](../interfaces/BaseLLMPredictor.md#apredict)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### getLlmMetadata
|
||||
|
||||
▸ **getLlmMetadata**(): `Promise`<`void`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseLLMPredictor](../interfaces/BaseLLMPredictor.md).[getLlmMetadata](../interfaces/BaseLLMPredictor.md#getllmmetadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L45)
|
||||
@@ -1,105 +0,0 @@
|
||||
---
|
||||
id: "CompactAndRefine"
|
||||
title: "Class: CompactAndRefine"
|
||||
sidebar_label: "CompactAndRefine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`Refine`](Refine.md)
|
||||
|
||||
↳ **`CompactAndRefine`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new CompactAndRefine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `textQATemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
| `refineTemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[constructor](Refine.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L66)
|
||||
|
||||
## Properties
|
||||
|
||||
### refineTemplate
|
||||
|
||||
• **refineTemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[refineTemplate](Refine.md#refinetemplate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[serviceContext](Refine.md#servicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### textQATemplate
|
||||
|
||||
• **textQATemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[Refine](Refine.md).[textQATemplate](Refine.md#textqatemplate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L63)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`, `prevResponse?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `prevResponse?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[Refine](Refine.md).[agetResponse](Refine.md#agetresponse)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:152](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L152)
|
||||
@@ -1,148 +0,0 @@
|
||||
---
|
||||
id: "CondenseQuestionChatEngine"
|
||||
title: "Class: CondenseQuestionChatEngine"
|
||||
sidebar_label: "CondenseQuestionChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
CondenseQuestionChatEngine is used in conjunction with a Index (for example VectorIndex).
|
||||
It does two steps on taking a user's chat message: first, it condenses the chat message
|
||||
with the previous chat history into a question with more context.
|
||||
Then, it queries the underlying Index using the new question with context and returns
|
||||
the response.
|
||||
CondenseQuestionChatEngine performs well when the input is primarily questions about the
|
||||
underlying data. It performs less well when the chat messages are not questions about the
|
||||
data, or are very referential to previous context.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatEngine`](../interfaces/ChatEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new CondenseQuestionChatEngine**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | `Object` |
|
||||
| `init.chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `init.condenseMessagePrompt?` | [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
| `init.queryEngine` | [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md) |
|
||||
| `init.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L75)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatHistory
|
||||
|
||||
• **chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:71](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
### condenseMessagePrompt
|
||||
|
||||
• **condenseMessagePrompt**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### queryEngine
|
||||
|
||||
• **queryEngine**: [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L72)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `message` | `string` | |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### acondenseQuestion
|
||||
|
||||
▸ `Private` **acondenseQuestion**(`chatHistory`, `question`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `chatHistory` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `question` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:123](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L123)
|
||||
@@ -1,125 +0,0 @@
|
||||
---
|
||||
id: "ContextChatEngine"
|
||||
title: "Class: ContextChatEngine"
|
||||
sidebar_label: "ContextChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
ContextChatEngine uses the Index to get the appropriate context for each query.
|
||||
The context is stored in the system prompt, and the chat history is preserved,
|
||||
ideally allowing the appropriate context to be surfaced for each query.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatEngine`](../interfaces/ChatEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ContextChatEngine**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | `Object` |
|
||||
| `init.chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `init.chatModel?` | [`OpenAI`](OpenAI.md) |
|
||||
| `init.retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L138)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatHistory
|
||||
|
||||
• **chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:136](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L136)
|
||||
|
||||
___
|
||||
|
||||
### chatModel
|
||||
|
||||
• **chatModel**: [`OpenAI`](OpenAI.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:135](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L135)
|
||||
|
||||
___
|
||||
|
||||
### retriever
|
||||
|
||||
• **retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L134)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `message` | `string` | |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### chatRepl
|
||||
|
||||
▸ **chatRepl**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L191)
|
||||
@@ -1,496 +0,0 @@
|
||||
---
|
||||
id: "Document"
|
||||
title: "Class: Document"
|
||||
sidebar_label: "Document"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A document is just a special text node with a docId.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`TextNode`](TextNode.md)
|
||||
|
||||
↳ **`Document`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Document**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`Document`](Document.md)\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:216](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L216)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[hash](TextNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `Record`<`string`, `any`\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[text](TextNode.md#text)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### docId
|
||||
|
||||
• `get` **docId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:225](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L225)
|
||||
|
||||
___
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:221](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L221)
|
||||
|
||||
___
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
|
||||
@@ -1,123 +0,0 @@
|
||||
---
|
||||
id: "IndexDict"
|
||||
title: "Class: IndexDict"
|
||||
sidebar_label: "IndexDict"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The underlying structure of each index.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`IndexStruct`](IndexStruct.md)
|
||||
|
||||
↳ **`IndexDict`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexDict**(`indexId?`, `summary?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `indexId` | `string` | `undefined` |
|
||||
| `summary` | `undefined` | `undefined` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `Record`<`string`, [`Document`](Document.md)\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:36](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L36)
|
||||
|
||||
___
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### nodesDict
|
||||
|
||||
• **nodesDict**: `Record`<`string`, [`BaseNode`](BaseNode.md)\> = `{}`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### summary
|
||||
|
||||
• `Optional` **summary**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
|
||||
|
||||
## Methods
|
||||
|
||||
### addNode
|
||||
|
||||
▸ **addNode**(`node`, `textId?`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `node` | [`BaseNode`](BaseNode.md) |
|
||||
| `textId?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### getSummary
|
||||
|
||||
▸ **getSummary**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L38)
|
||||
@@ -1,112 +0,0 @@
|
||||
---
|
||||
id: "IndexList"
|
||||
title: "Class: IndexList"
|
||||
sidebar_label: "IndexList"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The underlying structure of each index.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`IndexStruct`](IndexStruct.md)
|
||||
|
||||
↳ **`IndexList`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexList**(`indexId?`, `summary?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `indexId` | `string` | `undefined` |
|
||||
| `summary` | `undefined` | `undefined` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[constructor](IndexStruct.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
|
||||
|
||||
## Properties
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[indexId](IndexStruct.md#indexid)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### nodes
|
||||
|
||||
• **nodes**: `string`[] = `[]`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### summary
|
||||
|
||||
• `Optional` **summary**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[summary](IndexStruct.md#summary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
|
||||
|
||||
## Methods
|
||||
|
||||
### addNode
|
||||
|
||||
▸ **addNode**(`node`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `node` | [`BaseNode`](BaseNode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
### getSummary
|
||||
|
||||
▸ **getSummary**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[IndexStruct](IndexStruct.md).[getSummary](IndexStruct.md#getsummary)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L26)
|
||||
@@ -1,492 +0,0 @@
|
||||
---
|
||||
id: "IndexNode"
|
||||
title: "Class: IndexNode"
|
||||
sidebar_label: "IndexNode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`TextNode`](TextNode.md)
|
||||
|
||||
↳ **`IndexNode`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexNode**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`TextNode`](TextNode.md)\> |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[constructor](TextNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:144](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L144)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[embedding](TextNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[endCharIdx](TextNode.md#endcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedEmbedMetadataKeys](TextNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[excludedLlmMetadataKeys](TextNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[hash](TextNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[id_](TextNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string` = `""`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L205)
|
||||
|
||||
___
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `Record`<`string`, `any`\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadata](TextNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[metadataSeparator](TextNode.md#metadataseparator)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[relationships](TextNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[startCharIdx](TextNode.md#startcharidx)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[text](TextNode.md#text)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
TextNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[asRelatedNodeInfo](TextNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[generateHash](TextNode.md#generatehash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getContent](TextNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getEmbedding](TextNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getMetadataStr](TextNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getNodeInfo](TextNode.md#getnodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[getText](TextNode.md#gettext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[TextNode](TextNode.md).[getType](TextNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:207](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L207)
|
||||
|
||||
___
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[TextNode](TextNode.md).[setContent](TextNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
|
||||
@@ -1,68 +0,0 @@
|
||||
---
|
||||
id: "IndexStruct"
|
||||
title: "Class: IndexStruct"
|
||||
sidebar_label: "IndexStruct"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The underlying structure of each index.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`IndexStruct`**
|
||||
|
||||
↳ [`IndexDict`](IndexDict.md)
|
||||
|
||||
↳ [`IndexList`](IndexList.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new IndexStruct**(`indexId?`, `summary?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `indexId` | `string` | `undefined` |
|
||||
| `summary` | `undefined` | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L21)
|
||||
|
||||
## Properties
|
||||
|
||||
### indexId
|
||||
|
||||
• **indexId**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:18](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### summary
|
||||
|
||||
• `Optional` **summary**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L19)
|
||||
|
||||
## Methods
|
||||
|
||||
### getSummary
|
||||
|
||||
▸ **getSummary**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L26)
|
||||
@@ -1,84 +0,0 @@
|
||||
---
|
||||
id: "LLMQuestionGenerator"
|
||||
title: "Class: LLMQuestionGenerator"
|
||||
sidebar_label: "LLMQuestionGenerator"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
LLMQuestionGenerator uses the LLM to generate new questions for the LLM using tools and a user query.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new LLMQuestionGenerator**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`LLMQuestionGenerator`](LLMQuestionGenerator.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:34](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L34)
|
||||
|
||||
## Properties
|
||||
|
||||
### llmPredictor
|
||||
|
||||
• **llmPredictor**: [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
### outputParser
|
||||
|
||||
• **outputParser**: [`BaseOutputParser`](../interfaces/BaseOutputParser.md)<[`StructuredOutput`](../interfaces/StructuredOutput.md)<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### prompt
|
||||
|
||||
• **prompt**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:31](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L31)
|
||||
|
||||
## Methods
|
||||
|
||||
### agenerate
|
||||
|
||||
▸ **agenerate**(`tools`, `query`): `Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `tools` | [`ToolMetadata`](../interfaces/ToolMetadata.md)[] |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`SubQuestion`](../interfaces/SubQuestion.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQuestionGenerator](../interfaces/BaseQuestionGenerator.md).[agenerate](../interfaces/BaseQuestionGenerator.md#agenerate)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L40)
|
||||
@@ -1,281 +0,0 @@
|
||||
---
|
||||
id: "ListIndex"
|
||||
title: "Class: ListIndex"
|
||||
sidebar_label: "ListIndex"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A ListIndex keeps nodes in a sequential list structure
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseIndex`](BaseIndex.md)<[`IndexList`](IndexList.md)\>
|
||||
|
||||
↳ **`ListIndex`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ListIndex**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | [`BaseIndexInit`](../interfaces/BaseIndexInit.md)<[`IndexList`](IndexList.md)\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L37)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `BaseDocumentStore`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
### indexStore
|
||||
|
||||
• `Optional` **indexStore**: `BaseIndexStore`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: [`IndexList`](IndexList.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: `VectorStore`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L76)
|
||||
|
||||
## Methods
|
||||
|
||||
### \_deleteNode
|
||||
|
||||
▸ `Protected` **_deleteNode**(`nodeId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodeId` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:140](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L140)
|
||||
|
||||
___
|
||||
|
||||
### \_insert
|
||||
|
||||
▸ `Protected` **_insert**(`nodes`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L134)
|
||||
|
||||
___
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **asQueryEngine**(`mode?`): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `mode` | [`ListRetrieverMode`](../enums/ListRetrieverMode.md) | `ListRetrieverMode.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:113](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L113)
|
||||
|
||||
___
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ **asRetriever**(`mode?`): [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `mode` | [`ListRetrieverMode`](../enums/ListRetrieverMode.md) | `ListRetrieverMode.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:100](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L100)
|
||||
|
||||
___
|
||||
|
||||
### getRefDocInfo
|
||||
|
||||
▸ **getRefDocInfo**(): `Promise`<`Record`<`string`, `RefDocInfo`\>\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Record`<`string`, `RefDocInfo`\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:146](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L146)
|
||||
|
||||
___
|
||||
|
||||
### \_buildIndexFromNodes
|
||||
|
||||
▸ `Static` **_buildIndexFromNodes**(`nodes`, `docStore`, `indexStruct?`): `Promise`<[`IndexList`](IndexList.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
| `docStore` | `BaseDocumentStore` |
|
||||
| `indexStruct?` | [`IndexList`](IndexList.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexList`](IndexList.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:119](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
### fromDocuments
|
||||
|
||||
▸ `Static` **fromDocuments**(`documents`, `storageContext?`, `serviceContext?`): `Promise`<[`ListIndex`](ListIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](Document.md)[] |
|
||||
| `storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ListIndex`](ListIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### init
|
||||
|
||||
▸ `Static` **init**(`options`): `Promise`<[`ListIndex`](ListIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options` | `ListIndexOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ListIndex`](ListIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L41)
|
||||
@@ -1,137 +0,0 @@
|
||||
---
|
||||
id: "ListIndexLLMRetriever"
|
||||
title: "Class: ListIndexLLMRetriever"
|
||||
sidebar_label: "ListIndexLLMRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
LLM retriever for ListIndex.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ListIndexLLMRetriever**(`index`, `choiceSelectPrompt?`, `choiceBatchSize?`, `formatNodeBatchFn?`, `parseChoiceSelectAnswerFn?`, `serviceContext?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `index` | [`ListIndex`](ListIndex.md) | `undefined` |
|
||||
| `choiceSelectPrompt?` | [`SimplePrompt`](../modules.md#simpleprompt) | `undefined` |
|
||||
| `choiceBatchSize` | `number` | `10` |
|
||||
| `formatNodeBatchFn?` | `NodeFormatterFunction` | `undefined` |
|
||||
| `parseChoiceSelectAnswerFn?` | `ChoiceSelectParserFunction` | `undefined` |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:67](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L67)
|
||||
|
||||
## Properties
|
||||
|
||||
### choiceBatchSize
|
||||
|
||||
• **choiceBatchSize**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### choiceSelectPrompt
|
||||
|
||||
• **choiceSelectPrompt**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
### formatNodeBatchFn
|
||||
|
||||
• **formatNodeBatchFn**: `NodeFormatterFunction`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
### index
|
||||
|
||||
• **index**: [`ListIndex`](ListIndex.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L60)
|
||||
|
||||
___
|
||||
|
||||
### parseChoiceSelectAnswerFn
|
||||
|
||||
• **parseChoiceSelectAnswerFn**: `ChoiceSelectParserFunction`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L65)
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:134](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L134)
|
||||
@@ -1,82 +0,0 @@
|
||||
---
|
||||
id: "ListIndexRetriever"
|
||||
title: "Class: ListIndexRetriever"
|
||||
sidebar_label: "ListIndexRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Simple retriever for ListIndex that returns all nodes
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ListIndexRetriever**(`index`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `index` | [`ListIndex`](ListIndex.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L22)
|
||||
|
||||
## Properties
|
||||
|
||||
### index
|
||||
|
||||
• **index**: [`ListIndex`](ListIndex.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L20)
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndexRetriever.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndexRetriever.ts#L51)
|
||||
@@ -1,193 +0,0 @@
|
||||
---
|
||||
id: "OpenAI"
|
||||
title: "Class: OpenAI"
|
||||
sidebar_label: "OpenAI"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
OpenAI LLM implementation
|
||||
|
||||
## Implements
|
||||
|
||||
- [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new OpenAI**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`OpenAI`](OpenAI.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L76)
|
||||
|
||||
## Properties
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
### maxRetries
|
||||
|
||||
• **maxRetries**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:69](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L69)
|
||||
|
||||
___
|
||||
|
||||
### maxTokens
|
||||
|
||||
• `Optional` **maxTokens**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:71](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: ``"gpt-3.5-turbo"`` \| ``"gpt-3.5-turbo-16k"`` \| ``"gpt-4"`` \| ``"gpt-4-32k"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L66)
|
||||
|
||||
___
|
||||
|
||||
### n
|
||||
|
||||
• **n**: `number` = `1`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
### openAIKey
|
||||
|
||||
• **openAIKey**: ``null`` \| `string` = `null`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### requestTimeout
|
||||
|
||||
• **requestTimeout**: ``null`` \| `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:68](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
### session
|
||||
|
||||
• **session**: `OpenAISession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### temperature
|
||||
|
||||
• **temperature**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:67](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L67)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
|
||||
▸ **achat**(`messages`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](../interfaces/ChatMessage.md)[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[achat](../interfaces/LLM.md#achat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:103](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L103)
|
||||
|
||||
___
|
||||
|
||||
### acomplete
|
||||
|
||||
▸ **acomplete**(`prompt`, `parentEvent?`): `Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](../interfaces/ChatResponse.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[LLM](../interfaces/LLM.md).[acomplete](../interfaces/LLM.md#acomplete)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:145](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L145)
|
||||
|
||||
___
|
||||
|
||||
### mapMessageType
|
||||
|
||||
▸ **mapMessageType**(`type`): `ChatCompletionRequestMessageRoleEnum`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `type` | `MessageType` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`ChatCompletionRequestMessageRoleEnum`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:88](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L88)
|
||||
@@ -1,141 +0,0 @@
|
||||
---
|
||||
id: "OpenAIEmbedding"
|
||||
title: "Class: OpenAIEmbedding"
|
||||
sidebar_label: "OpenAIEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseEmbedding`](BaseEmbedding.md)
|
||||
|
||||
↳ **`OpenAIEmbedding`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new OpenAIEmbedding**()
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[constructor](BaseEmbedding.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:217](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L217)
|
||||
|
||||
## Properties
|
||||
|
||||
### model
|
||||
|
||||
• **model**: `TEXT_EMBED_ADA_002`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:215](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L215)
|
||||
|
||||
___
|
||||
|
||||
### session
|
||||
|
||||
• **session**: `OpenAISession`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:214](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L214)
|
||||
|
||||
## Methods
|
||||
|
||||
### \_aGetOpenAIEmbedding
|
||||
|
||||
▸ `Private` **_aGetOpenAIEmbedding**(`input`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:224](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L224)
|
||||
|
||||
___
|
||||
|
||||
### aGetQueryEmbedding
|
||||
|
||||
▸ **aGetQueryEmbedding**(`query`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[aGetQueryEmbedding](BaseEmbedding.md#agetqueryembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:240](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L240)
|
||||
|
||||
___
|
||||
|
||||
### aGetTextEmbedding
|
||||
|
||||
▸ **aGetTextEmbedding**(`text`): `Promise`<`number`[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `text` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`number`[]\>
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[aGetTextEmbedding](BaseEmbedding.md#agettextembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:236](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L236)
|
||||
|
||||
___
|
||||
|
||||
### similarity
|
||||
|
||||
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `embedding1` | `number`[] | `undefined` |
|
||||
| `embedding2` | `number`[] | `undefined` |
|
||||
| `mode` | [`SimilarityType`](../enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseEmbedding](BaseEmbedding.md).[similarity](BaseEmbedding.md#similarity)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:197](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L197)
|
||||
@@ -1,136 +0,0 @@
|
||||
---
|
||||
id: "Refine"
|
||||
title: "Class: Refine"
|
||||
sidebar_label: "Refine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- **`Refine`**
|
||||
|
||||
↳ [`CompactAndRefine`](CompactAndRefine.md)
|
||||
|
||||
## Implements
|
||||
|
||||
- `BaseResponseBuilder`
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Refine**(`serviceContext`, `textQATemplate?`, `refineTemplate?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `textQATemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
| `refineTemplate?` | [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:66](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L66)
|
||||
|
||||
## Properties
|
||||
|
||||
### refineTemplate
|
||||
|
||||
• **refineTemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### textQATemplate
|
||||
|
||||
• **textQATemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L63)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`, `prevResponse?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `prevResponse?` | `any` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.agetResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:76](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L76)
|
||||
|
||||
___
|
||||
|
||||
### giveResponseSingle
|
||||
|
||||
▸ `Private` **giveResponseSingle**(`queryStr`, `textChunk`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `queryStr` | `string` |
|
||||
| `textChunk` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L95)
|
||||
|
||||
___
|
||||
|
||||
### refineResponseSingle
|
||||
|
||||
▸ `Private` **refineResponseSingle**(`response`, `queryStr`, `textChunk`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `response` | `string` |
|
||||
| `queryStr` | `string` |
|
||||
| `textChunk` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:123](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L123)
|
||||
@@ -1,74 +0,0 @@
|
||||
---
|
||||
id: "Response"
|
||||
title: "Class: Response"
|
||||
sidebar_label: "Response"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Respone is the output of a LLM
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new Response**(`response`, `sourceNodes?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `response` | `string` |
|
||||
| `sourceNodes?` | [`BaseNode`](BaseNode.md)[] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L10)
|
||||
|
||||
## Properties
|
||||
|
||||
### response
|
||||
|
||||
• **response**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### sourceNodes
|
||||
|
||||
• `Optional` **sourceNodes**: [`BaseNode`](BaseNode.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L8)
|
||||
|
||||
## Methods
|
||||
|
||||
### getFormattedSources
|
||||
|
||||
▸ **getFormattedSources**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### toString
|
||||
|
||||
▸ **toString**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Response.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Response.ts#L19)
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
id: "ResponseSynthesizer"
|
||||
title: "Class: ResponseSynthesizer"
|
||||
sidebar_label: "ResponseSynthesizer"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A ResponseSynthesizer is used to generate a response from a query and a list of nodes.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new ResponseSynthesizer**(`«destructured»?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `«destructured»` | `Object` |
|
||||
| › `responseBuilder?` | `BaseResponseBuilder` |
|
||||
| › `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:225](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L225)
|
||||
|
||||
## Properties
|
||||
|
||||
### responseBuilder
|
||||
|
||||
• **responseBuilder**: `BaseResponseBuilder`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:222](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L222)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Optional` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:223](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L223)
|
||||
|
||||
## Methods
|
||||
|
||||
### asynthesize
|
||||
|
||||
▸ **asynthesize**(`query`, `nodes`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `nodes` | [`NodeWithScore`](../interfaces/NodeWithScore.md)[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:237](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L237)
|
||||
@@ -1,74 +0,0 @@
|
||||
---
|
||||
id: "RetrieverQueryEngine"
|
||||
title: "Class: RetrieverQueryEngine"
|
||||
sidebar_label: "RetrieverQueryEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A query engine that uses a retriever to query an index and then synthesizes the response.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new RetrieverQueryEngine**(`retriever`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `retriever` | [`BaseRetriever`](../interfaces/BaseRetriever.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L29)
|
||||
|
||||
## Properties
|
||||
|
||||
### responseSynthesizer
|
||||
|
||||
• **responseSynthesizer**: [`ResponseSynthesizer`](ResponseSynthesizer.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### retriever
|
||||
|
||||
• **retriever**: [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L26)
|
||||
|
||||
## Methods
|
||||
|
||||
### aquery
|
||||
|
||||
▸ **aquery**(`query`, `parentEvent?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[aquery](../interfaces/BaseQueryEngine.md#aquery)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:36](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L36)
|
||||
@@ -1,236 +0,0 @@
|
||||
---
|
||||
id: "SentenceSplitter"
|
||||
title: "Class: SentenceSplitter"
|
||||
sidebar_label: "SentenceSplitter"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SentenceSplitter is our default text splitter that supports splitting into sentences, paragraphs, or fixed length chunks with overlap.
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SentenceSplitter**(`chunkSize?`, `chunkOverlap?`, `tokenizer?`, `tokenizerDecoder?`, `paragraphSeparator?`, `chunkingTokenizerFn?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `chunkSize` | `number` | `DEFAULT_CHUNK_SIZE` |
|
||||
| `chunkOverlap` | `number` | `DEFAULT_CHUNK_OVERLAP` |
|
||||
| `tokenizer` | `any` | `null` |
|
||||
| `tokenizerDecoder` | `any` | `null` |
|
||||
| `paragraphSeparator` | `string` | `"\n\n\n"` |
|
||||
| `chunkingTokenizerFn` | `any` | `undefined` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:33](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L33)
|
||||
|
||||
## Properties
|
||||
|
||||
### chunkOverlap
|
||||
|
||||
• `Private` **chunkOverlap**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### chunkSize
|
||||
|
||||
• `Private` **chunkSize**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### chunkingTokenizerFn
|
||||
|
||||
• `Private` **chunkingTokenizerFn**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L30)
|
||||
|
||||
___
|
||||
|
||||
### paragraphSeparator
|
||||
|
||||
• `Private` **paragraphSeparator**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### tokenizer
|
||||
|
||||
• `Private` **tokenizer**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### tokenizerDecoder
|
||||
|
||||
• `Private` **tokenizerDecoder**: `any`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L28)
|
||||
|
||||
## Methods
|
||||
|
||||
### combineTextSplits
|
||||
|
||||
▸ **combineTextSplits**(`newSentenceSplits`, `effectiveChunkSize`): `TextSplit`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `newSentenceSplits` | `SplitRep`[] |
|
||||
| `effectiveChunkSize` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`TextSplit`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### getEffectiveChunkSize
|
||||
|
||||
▸ `Private` **getEffectiveChunkSize**(`extraInfoStr?`): `number`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `extraInfoStr?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### getParagraphSplits
|
||||
|
||||
▸ **getParagraphSplits**(`text`, `effectiveChunkSize?`): `string`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `text` | `string` |
|
||||
| `effectiveChunkSize?` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:89](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L89)
|
||||
|
||||
___
|
||||
|
||||
### getSentenceSplits
|
||||
|
||||
▸ **getSentenceSplits**(`text`, `effectiveChunkSize?`): `string`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `text` | `string` |
|
||||
| `effectiveChunkSize?` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:115](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L115)
|
||||
|
||||
___
|
||||
|
||||
### processSentenceSplits
|
||||
|
||||
▸ `Private` **processSentenceSplits**(`sentenceSplits`, `effectiveChunkSize`): `SplitRep`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `sentenceSplits` | `string`[] |
|
||||
| `effectiveChunkSize` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`SplitRep`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:128](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
### splitText
|
||||
|
||||
▸ **splitText**(`text`, `extraInfoStr?`): `string`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `text` | `string` |
|
||||
| `extraInfoStr?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:233](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L233)
|
||||
|
||||
___
|
||||
|
||||
### splitTextWithOverlaps
|
||||
|
||||
▸ **splitTextWithOverlaps**(`text`, `extraInfoStr?`): `TextSplit`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `text` | `string` |
|
||||
| `extraInfoStr?` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`TextSplit`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[TextSplitter.ts:205](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/TextSplitter.ts#L205)
|
||||
@@ -1,96 +0,0 @@
|
||||
---
|
||||
id: "SimpleChatEngine"
|
||||
title: "Class: SimpleChatEngine"
|
||||
sidebar_label: "SimpleChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SimpleChatEngine is the simplest possible chat engine. Useful for using your own custom prompts.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`ChatEngine`](../interfaces/ChatEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleChatEngine**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`SimpleChatEngine`](SimpleChatEngine.md)\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L40)
|
||||
|
||||
## Properties
|
||||
|
||||
### chatHistory
|
||||
|
||||
• **chatHistory**: [`ChatMessage`](../interfaces/ChatMessage.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### llm
|
||||
|
||||
• **llm**: [`LLM`](../interfaces/LLM.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L38)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `message` | `string` | |
|
||||
| `chatHistory?` | [`ChatMessage`](../interfaces/ChatMessage.md)[] | optional chat history if you want to customize the chat history |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[achat](../interfaces/ChatEngine.md#achat)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[ChatEngine](../interfaces/ChatEngine.md).[reset](../interfaces/ChatEngine.md#reset)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L54)
|
||||
@@ -1,114 +0,0 @@
|
||||
---
|
||||
id: "SimpleNodeParser"
|
||||
title: "Class: SimpleNodeParser"
|
||||
sidebar_label: "SimpleNodeParser"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SimpleNodeParser is the default NodeParser. It splits documents into TextNodes using a splitter, by default SentenceSplitter
|
||||
|
||||
## Implements
|
||||
|
||||
- [`NodeParser`](../interfaces/NodeParser.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleNodeParser**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Object` |
|
||||
| `init.chunkOverlap?` | `number` |
|
||||
| `init.chunkSize?` | `number` |
|
||||
| `init.includeMetadata?` | `boolean` |
|
||||
| `init.includePrevNextRel?` | `boolean` |
|
||||
| `init.textSplitter?` | [`SentenceSplitter`](SentenceSplitter.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L64)
|
||||
|
||||
## Properties
|
||||
|
||||
### includeMetadata
|
||||
|
||||
• **includeMetadata**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
### includePrevNextRel
|
||||
|
||||
• **includePrevNextRel**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### textSplitter
|
||||
|
||||
• **textSplitter**: [`SentenceSplitter`](SentenceSplitter.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L60)
|
||||
|
||||
## Methods
|
||||
|
||||
### getNodesFromDocuments
|
||||
|
||||
▸ **getNodesFromDocuments**(`documents`): [`TextNode`](TextNode.md)[]
|
||||
|
||||
Generate Node objects from documents
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](Document.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`TextNode`](TextNode.md)[]
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[NodeParser](../interfaces/NodeParser.md).[getNodesFromDocuments](../interfaces/NodeParser.md#getnodesfromdocuments)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L95)
|
||||
|
||||
___
|
||||
|
||||
### fromDefaults
|
||||
|
||||
▸ `Static` **fromDefaults**(`init?`): [`SimpleNodeParser`](SimpleNodeParser.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Object` |
|
||||
| `init.chunkOverlap?` | `number` |
|
||||
| `init.chunkSize?` | `number` |
|
||||
| `init.includeMetadata?` | `boolean` |
|
||||
| `init.includePrevNextRel?` | `boolean` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleNodeParser`](SimpleNodeParser.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:82](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L82)
|
||||
@@ -1,75 +0,0 @@
|
||||
---
|
||||
id: "SimpleResponseBuilder"
|
||||
title: "Class: SimpleResponseBuilder"
|
||||
sidebar_label: "SimpleResponseBuilder"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A response builder that just concatenates responses.
|
||||
|
||||
## Implements
|
||||
|
||||
- `BaseResponseBuilder`
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SimpleResponseBuilder**(`serviceContext?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:37](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L37)
|
||||
|
||||
## Properties
|
||||
|
||||
### llmPredictor
|
||||
|
||||
• **llmPredictor**: [`BaseLLMPredictor`](../interfaces/BaseLLMPredictor.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:34](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### textQATemplate
|
||||
|
||||
• **textQATemplate**: [`SimplePrompt`](../modules.md#simpleprompt)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L35)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.agetResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L43)
|
||||
@@ -1,141 +0,0 @@
|
||||
---
|
||||
id: "SubQuestionQueryEngine"
|
||||
title: "Class: SubQuestionQueryEngine"
|
||||
sidebar_label: "SubQuestionQueryEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
SubQuestionQueryEngine decomposes a question into subquestions and then
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new SubQuestionQueryEngine**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | `Object` |
|
||||
| `init.queryEngineTools` | [`QueryEngineTool`](../interfaces/QueryEngineTool.md)[] |
|
||||
| `init.questionGen` | [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md) |
|
||||
| `init.responseSynthesizer` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:56](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L56)
|
||||
|
||||
## Properties
|
||||
|
||||
### metadatas
|
||||
|
||||
• **metadatas**: [`ToolMetadata`](../interfaces/ToolMetadata.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:54](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L54)
|
||||
|
||||
___
|
||||
|
||||
### queryEngines
|
||||
|
||||
• **queryEngines**: `Record`<`string`, [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:53](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### questionGen
|
||||
|
||||
• **questionGen**: [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### responseSynthesizer
|
||||
|
||||
• **responseSynthesizer**: [`ResponseSynthesizer`](ResponseSynthesizer.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L51)
|
||||
|
||||
## Methods
|
||||
|
||||
### aquery
|
||||
|
||||
▸ **aquery**(`query`): `Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](Response.md)\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseQueryEngine](../interfaces/BaseQueryEngine.md).[aquery](../interfaces/BaseQueryEngine.md#aquery)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:97](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
### aquerySubQ
|
||||
|
||||
▸ `Private` **aquerySubQ**(`subQ`, `parentEvent?`): `Promise`<``null`` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `subQ` | [`SubQuestion`](../interfaces/SubQuestion.md) |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<``null`` \| [`NodeWithScore`](../interfaces/NodeWithScore.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:128](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
### fromDefaults
|
||||
|
||||
▸ `Static` **fromDefaults**(`init`): [`SubQuestionQueryEngine`](SubQuestionQueryEngine.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | `Object` |
|
||||
| `init.queryEngineTools` | [`QueryEngineTool`](../interfaces/QueryEngineTool.md)[] |
|
||||
| `init.questionGen?` | [`BaseQuestionGenerator`](../interfaces/BaseQuestionGenerator.md) |
|
||||
| `init.responseSynthesizer?` | [`ResponseSynthesizer`](ResponseSynthesizer.md) |
|
||||
| `init.serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SubQuestionQueryEngine`](SubQuestionQueryEngine.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QueryEngine.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QueryEngine.ts#L73)
|
||||
@@ -1,458 +0,0 @@
|
||||
---
|
||||
id: "TextNode"
|
||||
title: "Class: TextNode"
|
||||
sidebar_label: "TextNode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TextNode is the default node type for text. Most common node type in LlamaIndex.TS
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseNode`](BaseNode.md)
|
||||
|
||||
↳ **`TextNode`**
|
||||
|
||||
↳↳ [`IndexNode`](IndexNode.md)
|
||||
|
||||
↳↳ [`Document`](Document.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new TextNode**(`init?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init?` | `Partial`<[`TextNode`](TextNode.md)\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[constructor](BaseNode.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:144](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L144)
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• `Optional` **embedding**: `number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[embedding](BaseNode.md#embedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:39](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### endCharIdx
|
||||
|
||||
• `Optional` **endCharIdx**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:139](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
### excludedEmbedMetadataKeys
|
||||
|
||||
• **excludedEmbedMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[excludedEmbedMetadataKeys](BaseNode.md#excludedembedmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:43](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### excludedLlmMetadataKeys
|
||||
|
||||
• **excludedLlmMetadataKeys**: `string`[] = `[]`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[excludedLlmMetadataKeys](BaseNode.md#excludedllmmetadatakeys)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### hash
|
||||
|
||||
• **hash**: `string` = `""`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[hash](BaseNode.md#hash)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L46)
|
||||
|
||||
___
|
||||
|
||||
### id\_
|
||||
|
||||
• **id\_**: `string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[id_](BaseNode.md#id_)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:38](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `Record`<`string`, `any`\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[metadata](BaseNode.md#metadata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L42)
|
||||
|
||||
___
|
||||
|
||||
### metadataSeparator
|
||||
|
||||
• **metadataSeparator**: `string` = `"\n"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:142](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L142)
|
||||
|
||||
___
|
||||
|
||||
### relationships
|
||||
|
||||
• **relationships**: `Partial`<`Record`<[`NodeRelationship`](../enums/NodeRelationship.md), [`RelatedNodeType`](../modules.md#relatednodetype)\>\> = `{}`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[relationships](BaseNode.md#relationships)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:45](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L45)
|
||||
|
||||
___
|
||||
|
||||
### startCharIdx
|
||||
|
||||
• `Optional` **startCharIdx**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:138](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L138)
|
||||
|
||||
___
|
||||
|
||||
### text
|
||||
|
||||
• **text**: `string` = `""`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:137](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L137)
|
||||
|
||||
## Accessors
|
||||
|
||||
### childNodes
|
||||
|
||||
• `get` **childNodes**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.childNodes
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:104](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L104)
|
||||
|
||||
___
|
||||
|
||||
### nextNode
|
||||
|
||||
• `get` **nextNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.nextNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:84](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• `get` **nodeId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.nodeId
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:58](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L58)
|
||||
|
||||
___
|
||||
|
||||
### parentNode
|
||||
|
||||
• `get` **parentNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.parentNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
### prevNode
|
||||
|
||||
• `get` **prevNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.prevNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:72](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L72)
|
||||
|
||||
___
|
||||
|
||||
### sourceNode
|
||||
|
||||
• `get` **sourceNode**(): `undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseNode.sourceNode
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L62)
|
||||
|
||||
## Methods
|
||||
|
||||
### asRelatedNodeInfo
|
||||
|
||||
▸ **asRelatedNodeInfo**(): [`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`RelatedNodeInfo`](../interfaces/RelatedNodeInfo.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[asRelatedNodeInfo](BaseNode.md#asrelatednodeinfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:124](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L124)
|
||||
|
||||
___
|
||||
|
||||
### generateHash
|
||||
|
||||
▸ **generateHash**(): `void`
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:149](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L149)
|
||||
|
||||
___
|
||||
|
||||
### getContent
|
||||
|
||||
▸ **getContent**(`metadataMode?`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) | `MetadataMode.NONE` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[getContent](BaseNode.md#getcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:157](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L157)
|
||||
|
||||
___
|
||||
|
||||
### getEmbedding
|
||||
|
||||
▸ **getEmbedding**(): `number`[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`[]
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseNode](BaseNode.md).[getEmbedding](BaseNode.md#getembedding)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:116](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
### getMetadataStr
|
||||
|
||||
▸ **getMetadataStr**(`metadataMode`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `metadataMode` | [`MetadataMode`](../enums/MetadataMode.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[getMetadataStr](BaseNode.md#getmetadatastr)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:162](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L162)
|
||||
|
||||
___
|
||||
|
||||
### getNodeInfo
|
||||
|
||||
▸ **getNodeInfo**(): `Object`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `end` | `undefined` \| `number` |
|
||||
| `start` | `undefined` \| `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
### getText
|
||||
|
||||
▸ **getText**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:191](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L191)
|
||||
|
||||
___
|
||||
|
||||
### getType
|
||||
|
||||
▸ **getType**(): [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[getType](BaseNode.md#gettype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:153](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### setContent
|
||||
|
||||
▸ **setContent**(`value`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `value` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseNode](BaseNode.md).[setContent](BaseNode.md#setcontent)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:183](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L183)
|
||||
@@ -1,64 +0,0 @@
|
||||
---
|
||||
id: "TreeSummarize"
|
||||
title: "Class: TreeSummarize"
|
||||
sidebar_label: "TreeSummarize"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
TreeSummarize repacks the text chunks into the smallest possible number of chunks and then summarizes them, then recursively does so until there's one chunk left.
|
||||
|
||||
## Implements
|
||||
|
||||
- `BaseResponseBuilder`
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new TreeSummarize**(`serviceContext`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:177](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L177)
|
||||
|
||||
## Properties
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:175](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L175)
|
||||
|
||||
## Methods
|
||||
|
||||
### agetResponse
|
||||
|
||||
▸ **agetResponse**(`query`, `textChunks`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `textChunks` | `string`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
BaseResponseBuilder.agetResponse
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:181](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L181)
|
||||
@@ -1,102 +0,0 @@
|
||||
---
|
||||
id: "VectorIndexRetriever"
|
||||
title: "Class: VectorIndexRetriever"
|
||||
sidebar_label: "VectorIndexRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
VectorIndexRetriever retrieves nodes from a VectorIndex.
|
||||
|
||||
## Implements
|
||||
|
||||
- [`BaseRetriever`](../interfaces/BaseRetriever.md)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new VectorIndexRetriever**(`index`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `index` | [`VectorStoreIndex`](VectorStoreIndex.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L28)
|
||||
|
||||
## Properties
|
||||
|
||||
### index
|
||||
|
||||
• **index**: [`VectorStoreIndex`](VectorStoreIndex.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Private` **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### similarityTopK
|
||||
|
||||
• **similarityTopK**: `number` = `DEFAULT_SIMILARITY_TOP_K`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L25)
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](../interfaces/Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](../interfaces/NodeWithScore.md)[]\>
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[aretrieve](../interfaces/BaseRetriever.md#aretrieve)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:33](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L33)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Implementation of
|
||||
|
||||
[BaseRetriever](../interfaces/BaseRetriever.md).[getServiceContext](../interfaces/BaseRetriever.md#getservicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:70](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L70)
|
||||
@@ -1,253 +0,0 @@
|
||||
---
|
||||
id: "VectorStoreIndex"
|
||||
title: "Class: VectorStoreIndex"
|
||||
sidebar_label: "VectorStoreIndex"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The VectorStoreIndex, an index that stores the nodes only according to their vector embedings.
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- [`BaseIndex`](BaseIndex.md)<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
↳ **`VectorStoreIndex`**
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• `Private` **new VectorStoreIndex**(`init`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `init` | `VectorIndexConstructorProps` |
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[constructor](BaseIndex.md#constructor)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:109](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L109)
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `BaseDocumentStore`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[docStore](BaseIndex.md#docstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:75](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L75)
|
||||
|
||||
___
|
||||
|
||||
### indexStore
|
||||
|
||||
• `Optional` **indexStore**: `BaseIndexStore`
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStore](BaseIndex.md#indexstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: [`IndexDict`](IndexDict.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[indexStruct](BaseIndex.md#indexstruct)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:78](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L78)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](../interfaces/ServiceContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[serviceContext](BaseIndex.md#servicecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:73](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L73)
|
||||
|
||||
___
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](../interfaces/StorageContext.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
[BaseIndex](BaseIndex.md).[storageContext](BaseIndex.md#storagecontext)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• **vectorStore**: `VectorStore`
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[vectorStore](BaseIndex.md#vectorstore)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:107](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L107)
|
||||
|
||||
## Methods
|
||||
|
||||
### asQueryEngine
|
||||
|
||||
▸ **asQueryEngine**(): [`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
Get a retriever query engine for this index.
|
||||
|
||||
NOTE: if you are using a custom query engine you don't have to use this method.
|
||||
|
||||
#### Returns
|
||||
|
||||
[`BaseQueryEngine`](../interfaces/BaseQueryEngine.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:252](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L252)
|
||||
|
||||
___
|
||||
|
||||
### asRetriever
|
||||
|
||||
▸ **asRetriever**(): [`VectorIndexRetriever`](VectorIndexRetriever.md)
|
||||
|
||||
Get a VectorIndexRetriever for this index.
|
||||
|
||||
NOTE: if you want to use a custom retriever you don't have to use this method.
|
||||
|
||||
#### Returns
|
||||
|
||||
[`VectorIndexRetriever`](VectorIndexRetriever.md)
|
||||
|
||||
retriever for the index
|
||||
|
||||
#### Overrides
|
||||
|
||||
[BaseIndex](BaseIndex.md).[asRetriever](BaseIndex.md#asretriever)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:242](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L242)
|
||||
|
||||
___
|
||||
|
||||
### agetNodeEmbeddingResults
|
||||
|
||||
▸ `Static` **agetNodeEmbeddingResults**(`nodes`, `serviceContext`, `logProgress?`): `Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
|
||||
|
||||
Get the embeddings for nodes.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] | `undefined` | |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) | `undefined` | |
|
||||
| `logProgress` | `boolean` | `false` | log progress to console (useful for debugging) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithEmbedding`](../interfaces/NodeWithEmbedding.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:159](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L159)
|
||||
|
||||
___
|
||||
|
||||
### buildIndexFromNodes
|
||||
|
||||
▸ `Static` **buildIndexFromNodes**(`nodes`, `serviceContext`, `vectorStore`): `Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
Get embeddings for nodes and place them into the index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `nodes` | [`BaseNode`](BaseNode.md)[] |
|
||||
| `serviceContext` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
| `vectorStore` | `VectorStore` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`IndexDict`](IndexDict.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:187](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L187)
|
||||
|
||||
___
|
||||
|
||||
### fromDocuments
|
||||
|
||||
▸ `Static` **fromDocuments**(`documents`, `storageContext?`, `serviceContext?`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
High level API: split documents, get embeddings, and build index.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](Document.md)[] |
|
||||
| `storageContext?` | [`StorageContext`](../interfaces/StorageContext.md) |
|
||||
| `serviceContext?` | [`ServiceContext`](../interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:214](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L214)
|
||||
|
||||
___
|
||||
|
||||
### init
|
||||
|
||||
▸ `Static` **init**(`options`): `Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options` | [`VectorIndexOptions`](../interfaces/VectorIndexOptions.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`VectorStoreIndex`](VectorStoreIndex.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:114](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L114)
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
id: "ListRetrieverMode"
|
||||
title: "Enumeration: ListRetrieverMode"
|
||||
sidebar_label: "ListRetrieverMode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DEFAULT
|
||||
|
||||
• **DEFAULT** = ``"default"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### LLM
|
||||
|
||||
• **LLM** = ``"llm"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[index/list/ListIndex.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/index/list/ListIndex.ts#L23)
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
id: "MetadataMode"
|
||||
title: "Enumeration: MetadataMode"
|
||||
sidebar_label: "MetadataMode"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### ALL
|
||||
|
||||
• **ALL** = ``"ALL"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
### EMBED
|
||||
|
||||
• **EMBED** = ``"EMBED"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L20)
|
||||
|
||||
___
|
||||
|
||||
### LLM
|
||||
|
||||
• **LLM** = ``"LLM"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### NONE
|
||||
|
||||
• **NONE** = ``"NONE"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L22)
|
||||
@@ -1,57 +0,0 @@
|
||||
---
|
||||
id: "NodeRelationship"
|
||||
title: "Enumeration: NodeRelationship"
|
||||
sidebar_label: "NodeRelationship"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### CHILD
|
||||
|
||||
• **CHILD** = ``"CHILD"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:8](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
### NEXT
|
||||
|
||||
• **NEXT** = ``"NEXT"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
### PARENT
|
||||
|
||||
• **PARENT** = ``"PARENT"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### PREVIOUS
|
||||
|
||||
• **PREVIOUS** = ``"PREVIOUS"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
### SOURCE
|
||||
|
||||
• **SOURCE** = ``"SOURCE"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L4)
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
id: "ObjectType"
|
||||
title: "Enumeration: ObjectType"
|
||||
sidebar_label: "ObjectType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DOCUMENT
|
||||
|
||||
• **DOCUMENT** = ``"DOCUMENT"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### IMAGE
|
||||
|
||||
• **IMAGE** = ``"IMAGE"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### INDEX
|
||||
|
||||
• **INDEX** = ``"INDEX"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### TEXT
|
||||
|
||||
• **TEXT** = ``"TEXT"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L12)
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
id: "SimilarityType"
|
||||
title: "Enumeration: SimilarityType"
|
||||
sidebar_label: "SimilarityType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Similarity type
|
||||
Default is cosine similarity. Dot product and negative Euclidean distance are also supported.
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### DEFAULT
|
||||
|
||||
• **DEFAULT** = ``"cosine"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### DOT\_PRODUCT
|
||||
|
||||
• **DOT\_PRODUCT** = ``"dot_product"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### EUCLIDEAN
|
||||
|
||||
• **EUCLIDEAN** = ``"euclidean"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L12)
|
||||
@@ -1,86 +0,0 @@
|
||||
---
|
||||
id: "index"
|
||||
title: "llamaindex"
|
||||
sidebar_label: "Readme"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
# LlamaIndex.TS
|
||||
|
||||
Use your own data with large language models (LLMs, OpenAI ChatGPT and others) in Typescript and Javascript.
|
||||
|
||||
## What is LlamaIndex.TS?
|
||||
|
||||
LlamaIndex.TS aims to be a lightweight, easy to use set of libraries to help you integrate large language models into your applications with your own data.
|
||||
|
||||
## Getting started with an example:
|
||||
|
||||
LlamaIndex.TS requries Node v18 or higher. You can download it from https://nodejs.org or use https://nvm.sh (our preferred option).
|
||||
|
||||
In a new folder:
|
||||
|
||||
```bash
|
||||
export OPEN_AI_KEY="sk-......" # Replace with your key from https://platform.openai.com/account/api-keys
|
||||
npx tsc –-init # if needed
|
||||
pnpm install llamaindex
|
||||
```
|
||||
|
||||
Create the file example.ts
|
||||
|
||||
```ts
|
||||
// example.ts
|
||||
import fs from "fs/promises";
|
||||
import { Document, VectorStoreIndex } from "llamaindex";
|
||||
|
||||
async function main() {
|
||||
// Load essay from abramov.txt in Node
|
||||
const essay = await fs.readFile(
|
||||
"node_modules/llamaindex/examples/abramov.txt",
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
// Create Document object with essay
|
||||
const document = new Document({ text: essay });
|
||||
|
||||
// Split text and create embeddings. Store them in a VectorStoreIndex
|
||||
const index = await VectorStoreIndex.fromDocuments([document]);
|
||||
|
||||
// Query the index
|
||||
const queryEngine = index.asQueryEngine();
|
||||
const response = await queryEngine.aquery(
|
||||
"What did the author do in college?"
|
||||
);
|
||||
|
||||
// Output response
|
||||
console.log(response.toString());
|
||||
}
|
||||
```
|
||||
|
||||
Then you can run it using
|
||||
|
||||
```bash
|
||||
npx ts-node example.ts
|
||||
```
|
||||
|
||||
## Core concepts:
|
||||
|
||||
- [Document](packages/core/src/Node.ts): A document represents a text file, PDF file or other contiguous piece of data.
|
||||
|
||||
- [Node](packages/core/src/Node.ts): The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
|
||||
- Indexes: indexes store the Nodes and the embeddings of those nodes.
|
||||
|
||||
- [QueryEngine](packages/core/src/QueryEngine.ts): Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
|
||||
|
||||
- [ChatEngine](packages/core/src/ChatEngine.ts): A ChatEngine helps you build a chatbot that will interact with your Indexes.
|
||||
|
||||
- [SimplePrompt](packages/core/src/Prompt.ts): A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
|
||||
|
||||
## Contributing:
|
||||
|
||||
We are in the very early days of LlamaIndex.TS. If you’re interested in hacking on it with us check out our [contributing guide](CONTRIBUTING.md)
|
||||
|
||||
## Bugs? Questions?
|
||||
|
||||
Please join our Discord! https://discord.com/invite/eN6D2HQ4aX
|
||||
@@ -1,73 +0,0 @@
|
||||
---
|
||||
id: "BaseIndexInit"
|
||||
title: "Interface: BaseIndexInit<T>"
|
||||
sidebar_label: "BaseIndexInit"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `BaseDocumentStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### indexStore
|
||||
|
||||
• `Optional` **indexStore**: `BaseIndexStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:64](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L64)
|
||||
|
||||
___
|
||||
|
||||
### indexStruct
|
||||
|
||||
• **indexStruct**: `T`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:65](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• **serviceContext**: [`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:60](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L60)
|
||||
|
||||
___
|
||||
|
||||
### storageContext
|
||||
|
||||
• **storageContext**: [`StorageContext`](StorageContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:61](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• `Optional` **vectorStore**: `VectorStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:63](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L63)
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
id: "BaseLLMPredictor"
|
||||
title: "Interface: BaseLLMPredictor"
|
||||
sidebar_label: "BaseLLMPredictor"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
LLM Predictors are an abstraction to predict the response to a prompt.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`ChatGPTLLMPredictor`](../classes/ChatGPTLLMPredictor.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### apredict
|
||||
|
||||
▸ **apredict**(`prompt`, `input?`, `parentEvent?`): `Promise`<`string`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `prompt` | `string` \| [`SimplePrompt`](../modules.md#simpleprompt) |
|
||||
| `input?` | `Record`<`string`, `string`\> |
|
||||
| `parentEvent?` | [`Event`](Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### getLlmMetadata
|
||||
|
||||
▸ **getLlmMetadata**(): `Promise`<`any`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLMPredictor.ts:9](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLMPredictor.ts#L9)
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
id: "BaseReader"
|
||||
title: "Interface: BaseReader"
|
||||
sidebar_label: "BaseReader"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A reader takes imports data into Document objects.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`TextFileReader`](../classes/TextFileReader.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### loadData
|
||||
|
||||
▸ **loadData**(`...args`): `Promise`<[`Document`](../classes/Document.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `...args` | `any`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Document`](../classes/Document.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/base.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/base.ts#L7)
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
id: "BaseRetriever"
|
||||
title: "Interface: BaseRetriever"
|
||||
sidebar_label: "BaseRetriever"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Retrievers retrieve the nodes that most closely match our query in similarity.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`ListIndexLLMRetriever`](../classes/ListIndexLLMRetriever.md)
|
||||
- [`ListIndexRetriever`](../classes/ListIndexRetriever.md)
|
||||
- [`VectorIndexRetriever`](../classes/VectorIndexRetriever.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### aretrieve
|
||||
|
||||
▸ **aretrieve**(`query`, `parentEvent?`): `Promise`<[`NodeWithScore`](NodeWithScore.md)[]\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `query` | `string` |
|
||||
| `parentEvent?` | [`Event`](Event.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`NodeWithScore`](NodeWithScore.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### getServiceContext
|
||||
|
||||
▸ **getServiceContext**(): [`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Retriever.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Retriever.ts#L17)
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
id: "ChatEngine"
|
||||
title: "Interface: ChatEngine"
|
||||
sidebar_label: "ChatEngine"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A ChatEngine is used to handle back and forth chats between the application and the LLM.
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`CondenseQuestionChatEngine`](../classes/CondenseQuestionChatEngine.md)
|
||||
- [`ContextChatEngine`](../classes/ContextChatEngine.md)
|
||||
- [`SimpleChatEngine`](../classes/SimpleChatEngine.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
|
||||
▸ **achat**(`message`, `chatHistory?`): `Promise`<[`Response`](../classes/Response.md)\>
|
||||
|
||||
Send message along with the class's current chat history to the LLM.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `message` | `string` | |
|
||||
| `chatHistory?` | [`ChatMessage`](ChatMessage.md)[] | optional chat history if you want to customize the chat history |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Response`](../classes/Response.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### reset
|
||||
|
||||
▸ **reset**(): `void`
|
||||
|
||||
Resets the chat history so that it's empty.
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ChatEngine.ts:30](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ChatEngine.ts#L30)
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
id: "ChatMessage"
|
||||
title: "Interface: ChatMessage"
|
||||
sidebar_label: "ChatMessage"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### content
|
||||
|
||||
• **content**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### role
|
||||
|
||||
• **role**: `MessageType`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L15)
|
||||
@@ -1,37 +0,0 @@
|
||||
---
|
||||
id: "ChatResponse"
|
||||
title: "Interface: ChatResponse"
|
||||
sidebar_label: "ChatResponse"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### delta
|
||||
|
||||
• `Optional` **delta**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
|
||||
• **message**: [`ChatMessage`](ChatMessage.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:19](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
### raw
|
||||
|
||||
• `Optional` **raw**: `Record`<`string`, `any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:20](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L20)
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
id: "Event"
|
||||
title: "Interface: Event"
|
||||
sidebar_label: "Event"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### id
|
||||
|
||||
• **id**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### parentId
|
||||
|
||||
• `Optional` **parentId**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### tags
|
||||
|
||||
• `Optional` **tags**: [`EventTag`](../modules.md#eventtag)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### type
|
||||
|
||||
• **type**: [`EventType`](../modules.md#eventtype)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L15)
|
||||
@@ -1,57 +0,0 @@
|
||||
---
|
||||
id: "LLM"
|
||||
title: "Interface: LLM"
|
||||
sidebar_label: "LLM"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Unified language model interface
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`OpenAI`](../classes/OpenAI.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### achat
|
||||
|
||||
▸ **achat**(`messages`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
|
||||
Get a chat response from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:35](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### acomplete
|
||||
|
||||
▸ **acomplete**(`prompt`): `Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
|
||||
Get a prompt completion from the LLM
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `prompt` | `string` | the prompt to complete |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`ChatResponse`](ChatResponse.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L41)
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
id: "NodeParser"
|
||||
title: "Interface: NodeParser"
|
||||
sidebar_label: "NodeParser"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A node parser generates TextNodes from Documents
|
||||
|
||||
## Implemented by
|
||||
|
||||
- [`SimpleNodeParser`](../classes/SimpleNodeParser.md)
|
||||
|
||||
## Methods
|
||||
|
||||
### getNodesFromDocuments
|
||||
|
||||
▸ **getNodesFromDocuments**(`documents`): [`TextNode`](../classes/TextNode.md)[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `documents` | [`Document`](../classes/Document.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`TextNode`](../classes/TextNode.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:53](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L53)
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
id: "NodeWithEmbedding"
|
||||
title: "Interface: NodeWithEmbedding"
|
||||
sidebar_label: "NodeWithEmbedding"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A node with an embedding
|
||||
|
||||
## Properties
|
||||
|
||||
### embedding
|
||||
|
||||
• **embedding**: `number`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:247](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L247)
|
||||
|
||||
___
|
||||
|
||||
### node
|
||||
|
||||
• **node**: [`BaseNode`](../classes/BaseNode.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:246](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L246)
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
id: "NodeWithScore"
|
||||
title: "Interface: NodeWithScore"
|
||||
sidebar_label: "NodeWithScore"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
A node with a similarity score
|
||||
|
||||
## Properties
|
||||
|
||||
### node
|
||||
|
||||
• **node**: [`BaseNode`](../classes/BaseNode.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:238](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L238)
|
||||
|
||||
___
|
||||
|
||||
### score
|
||||
|
||||
• **score**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:239](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L239)
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
id: "RelatedNodeInfo"
|
||||
title: "Interface: RelatedNodeInfo"
|
||||
sidebar_label: "RelatedNodeInfo"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### hash
|
||||
|
||||
• `Optional` **hash**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### metadata
|
||||
|
||||
• **metadata**: `Record`<`string`, `any`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
### nodeId
|
||||
|
||||
• **nodeId**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### nodeType
|
||||
|
||||
• `Optional` **nodeType**: [`ObjectType`](../enums/ObjectType.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L27)
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
id: "RetrievalCallbackResponse"
|
||||
title: "Interface: RetrievalCallbackResponse"
|
||||
sidebar_label: "RetrievalCallbackResponse"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `BaseCallbackResponse`
|
||||
|
||||
↳ **`RetrievalCallbackResponse`**
|
||||
|
||||
## Properties
|
||||
|
||||
### event
|
||||
|
||||
• **event**: [`Event`](Event.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseCallbackResponse.event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### nodes
|
||||
|
||||
• **nodes**: [`NodeWithScore`](NodeWithScore.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:47](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
### query
|
||||
|
||||
• **query**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:46](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L46)
|
||||
@@ -1,59 +0,0 @@
|
||||
---
|
||||
id: "ServiceContext"
|
||||
title: "Interface: ServiceContext"
|
||||
sidebar_label: "ServiceContext"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
The ServiceContext is a collection of components that are used in different parts of the application.
|
||||
|
||||
## Properties
|
||||
|
||||
### callbackManager
|
||||
|
||||
• **callbackManager**: [`CallbackManager`](../classes/CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### embedModel
|
||||
|
||||
• **embedModel**: [`BaseEmbedding`](../classes/BaseEmbedding.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:14](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### llmPredictor
|
||||
|
||||
• **llmPredictor**: [`BaseLLMPredictor`](BaseLLMPredictor.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### nodeParser
|
||||
|
||||
• **nodeParser**: [`NodeParser`](NodeParser.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### promptHelper
|
||||
|
||||
• **promptHelper**: `PromptHelper`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:13](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L13)
|
||||
@@ -1,87 +0,0 @@
|
||||
---
|
||||
id: "ServiceContextOptions"
|
||||
title: "Interface: ServiceContextOptions"
|
||||
sidebar_label: "ServiceContextOptions"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### callbackManager
|
||||
|
||||
• `Optional` **callbackManager**: [`CallbackManager`](../classes/CallbackManager.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### chunkOverlap
|
||||
|
||||
• `Optional` **chunkOverlap**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### chunkSize
|
||||
|
||||
• `Optional` **chunkSize**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
### embedModel
|
||||
|
||||
• `Optional` **embedModel**: [`BaseEmbedding`](../classes/BaseEmbedding.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:24](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### llm
|
||||
|
||||
• `Optional` **llm**: [`OpenAI`](../classes/OpenAI.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### llmPredictor
|
||||
|
||||
• `Optional` **llmPredictor**: [`BaseLLMPredictor`](BaseLLMPredictor.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### nodeParser
|
||||
|
||||
• `Optional` **nodeParser**: [`NodeParser`](NodeParser.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### promptHelper
|
||||
|
||||
• `Optional` **promptHelper**: `PromptHelper`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:23](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L23)
|
||||
@@ -1,37 +0,0 @@
|
||||
---
|
||||
id: "StorageContext"
|
||||
title: "Interface: StorageContext"
|
||||
sidebar_label: "StorageContext"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### docStore
|
||||
|
||||
• **docStore**: `BaseDocumentStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### indexStore
|
||||
|
||||
• **indexStore**: `BaseIndexStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### vectorStore
|
||||
|
||||
• **vectorStore**: `VectorStore`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:17](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L17)
|
||||
@@ -1,57 +0,0 @@
|
||||
---
|
||||
id: "StreamCallbackResponse"
|
||||
title: "Interface: StreamCallbackResponse"
|
||||
sidebar_label: "StreamCallbackResponse"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `BaseCallbackResponse`
|
||||
|
||||
↳ **`StreamCallbackResponse`**
|
||||
|
||||
## Properties
|
||||
|
||||
### event
|
||||
|
||||
• **event**: [`Event`](Event.md)
|
||||
|
||||
#### Inherited from
|
||||
|
||||
BaseCallbackResponse.event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:21](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### index
|
||||
|
||||
• **index**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:40](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
### isDone
|
||||
|
||||
• `Optional` **isDone**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:41](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L41)
|
||||
|
||||
___
|
||||
|
||||
### token
|
||||
|
||||
• `Optional` **token**: [`StreamToken`](StreamToken.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L42)
|
||||
@@ -1,57 +0,0 @@
|
||||
---
|
||||
id: "StreamToken"
|
||||
title: "Interface: StreamToken"
|
||||
sidebar_label: "StreamToken"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### choices
|
||||
|
||||
• **choices**: { `delta`: { `content?`: `string` ; `role?`: `ChatCompletionResponseMessageRoleEnum` } ; `finish_reason`: ``null`` \| `string` ; `index`: `number` }[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:29](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### created
|
||||
|
||||
• **created**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:27](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### id
|
||||
|
||||
• **id**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### model
|
||||
|
||||
• **model**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
### object
|
||||
|
||||
• **object**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L26)
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
id: "SubQuestion"
|
||||
title: "Interface: SubQuestion"
|
||||
sidebar_label: "SubQuestion"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### subQuestion
|
||||
|
||||
• **subQuestion**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### toolName
|
||||
|
||||
• **toolName**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[QuestionGenerator.ts:16](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/QuestionGenerator.ts#L16)
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
id: "VectorIndexOptions"
|
||||
title: "Interface: VectorIndexOptions"
|
||||
sidebar_label: "VectorIndexOptions"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### indexStruct
|
||||
|
||||
• `Optional` **indexStruct**: [`IndexDict`](../classes/IndexDict.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:94](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L94)
|
||||
|
||||
___
|
||||
|
||||
### nodes
|
||||
|
||||
• `Optional` **nodes**: [`BaseNode`](../classes/BaseNode.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:93](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L93)
|
||||
|
||||
___
|
||||
|
||||
### serviceContext
|
||||
|
||||
• `Optional` **serviceContext**: [`ServiceContext`](ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:95](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L95)
|
||||
|
||||
___
|
||||
|
||||
### storageContext
|
||||
|
||||
• `Optional` **storageContext**: [`StorageContext`](StorageContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[BaseIndex.ts:96](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/BaseIndex.ts#L96)
|
||||
@@ -1,914 +0,0 @@
|
||||
---
|
||||
id: "modules"
|
||||
title: "llamaindex"
|
||||
sidebar_label: "Exports"
|
||||
sidebar_position: 0.5
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumerations
|
||||
|
||||
- [ListRetrieverMode](enums/ListRetrieverMode.md)
|
||||
- [MetadataMode](enums/MetadataMode.md)
|
||||
- [NodeRelationship](enums/NodeRelationship.md)
|
||||
- [ObjectType](enums/ObjectType.md)
|
||||
- [SimilarityType](enums/SimilarityType.md)
|
||||
|
||||
## Classes
|
||||
|
||||
- [BaseEmbedding](classes/BaseEmbedding.md)
|
||||
- [BaseIndex](classes/BaseIndex.md)
|
||||
- [BaseNode](classes/BaseNode.md)
|
||||
- [CallbackManager](classes/CallbackManager.md)
|
||||
- [ChatGPTLLMPredictor](classes/ChatGPTLLMPredictor.md)
|
||||
- [CompactAndRefine](classes/CompactAndRefine.md)
|
||||
- [CondenseQuestionChatEngine](classes/CondenseQuestionChatEngine.md)
|
||||
- [ContextChatEngine](classes/ContextChatEngine.md)
|
||||
- [Document](classes/Document.md)
|
||||
- [InMemoryFileSystem](classes/InMemoryFileSystem.md)
|
||||
- [IndexDict](classes/IndexDict.md)
|
||||
- [IndexList](classes/IndexList.md)
|
||||
- [IndexNode](classes/IndexNode.md)
|
||||
- [IndexStruct](classes/IndexStruct.md)
|
||||
- [LLMQuestionGenerator](classes/LLMQuestionGenerator.md)
|
||||
- [ListIndex](classes/ListIndex.md)
|
||||
- [ListIndexLLMRetriever](classes/ListIndexLLMRetriever.md)
|
||||
- [ListIndexRetriever](classes/ListIndexRetriever.md)
|
||||
- [OpenAI](classes/OpenAI.md)
|
||||
- [OpenAIEmbedding](classes/OpenAIEmbedding.md)
|
||||
- [Refine](classes/Refine.md)
|
||||
- [Response](classes/Response.md)
|
||||
- [ResponseSynthesizer](classes/ResponseSynthesizer.md)
|
||||
- [RetrieverQueryEngine](classes/RetrieverQueryEngine.md)
|
||||
- [SentenceSplitter](classes/SentenceSplitter.md)
|
||||
- [SimpleChatEngine](classes/SimpleChatEngine.md)
|
||||
- [SimpleNodeParser](classes/SimpleNodeParser.md)
|
||||
- [SimpleResponseBuilder](classes/SimpleResponseBuilder.md)
|
||||
- [SubQuestionOutputParser](classes/SubQuestionOutputParser.md)
|
||||
- [SubQuestionQueryEngine](classes/SubQuestionQueryEngine.md)
|
||||
- [TextFileReader](classes/TextFileReader.md)
|
||||
- [TextNode](classes/TextNode.md)
|
||||
- [TreeSummarize](classes/TreeSummarize.md)
|
||||
- [VectorIndexRetriever](classes/VectorIndexRetriever.md)
|
||||
- [VectorStoreIndex](classes/VectorStoreIndex.md)
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [BaseIndexInit](interfaces/BaseIndexInit.md)
|
||||
- [BaseLLMPredictor](interfaces/BaseLLMPredictor.md)
|
||||
- [BaseOutputParser](interfaces/BaseOutputParser.md)
|
||||
- [BaseQueryEngine](interfaces/BaseQueryEngine.md)
|
||||
- [BaseQuestionGenerator](interfaces/BaseQuestionGenerator.md)
|
||||
- [BaseReader](interfaces/BaseReader.md)
|
||||
- [BaseRetriever](interfaces/BaseRetriever.md)
|
||||
- [BaseTool](interfaces/BaseTool.md)
|
||||
- [ChatEngine](interfaces/ChatEngine.md)
|
||||
- [ChatMessage](interfaces/ChatMessage.md)
|
||||
- [ChatResponse](interfaces/ChatResponse.md)
|
||||
- [Event](interfaces/Event.md)
|
||||
- [GenericFileSystem](interfaces/GenericFileSystem.md)
|
||||
- [LLM](interfaces/LLM.md)
|
||||
- [NodeParser](interfaces/NodeParser.md)
|
||||
- [NodeWithEmbedding](interfaces/NodeWithEmbedding.md)
|
||||
- [NodeWithScore](interfaces/NodeWithScore.md)
|
||||
- [QueryEngineTool](interfaces/QueryEngineTool.md)
|
||||
- [RelatedNodeInfo](interfaces/RelatedNodeInfo.md)
|
||||
- [RetrievalCallbackResponse](interfaces/RetrievalCallbackResponse.md)
|
||||
- [ServiceContext](interfaces/ServiceContext.md)
|
||||
- [ServiceContextOptions](interfaces/ServiceContextOptions.md)
|
||||
- [StorageContext](interfaces/StorageContext.md)
|
||||
- [StreamCallbackResponse](interfaces/StreamCallbackResponse.md)
|
||||
- [StreamToken](interfaces/StreamToken.md)
|
||||
- [StructuredOutput](interfaces/StructuredOutput.md)
|
||||
- [SubQuestion](interfaces/SubQuestion.md)
|
||||
- [ToolMetadata](interfaces/ToolMetadata.md)
|
||||
- [VectorIndexOptions](interfaces/VectorIndexOptions.md)
|
||||
- [WalkableFileSystem](interfaces/WalkableFileSystem.md)
|
||||
|
||||
## Type Aliases
|
||||
|
||||
### CompleteFileSystem
|
||||
|
||||
Ƭ **CompleteFileSystem**: [`GenericFileSystem`](interfaces/GenericFileSystem.md) & [`WalkableFileSystem`](interfaces/WalkableFileSystem.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### CompletionResponse
|
||||
|
||||
Ƭ **CompletionResponse**: [`ChatResponse`](interfaces/ChatResponse.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:25](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L25)
|
||||
|
||||
___
|
||||
|
||||
### EventTag
|
||||
|
||||
Ƭ **EventTag**: ``"intermediate"`` \| ``"final"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### EventType
|
||||
|
||||
Ƭ **EventType**: ``"retrieve"`` \| ``"llmPredict"`` \| ``"wrapper"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[callbacks/CallbackManager.ts:12](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/callbacks/CallbackManager.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### RelatedNodeType
|
||||
|
||||
Ƭ **RelatedNodeType**: [`RelatedNodeInfo`](interfaces/RelatedNodeInfo.md) \| [`RelatedNodeInfo`](interfaces/RelatedNodeInfo.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Node.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Node.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### SimpleDirectoryReaderLoadDataProps
|
||||
|
||||
Ƭ **SimpleDirectoryReaderLoadDataProps**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `defaultReader?` | [`BaseReader`](interfaces/BaseReader.md) \| ``null`` |
|
||||
| `directoryPath` | `string` |
|
||||
| `fileExtToReader?` | `Record`<`string`, [`BaseReader`](interfaces/BaseReader.md)\> |
|
||||
| `fs?` | [`CompleteFileSystem`](modules.md#completefilesystem) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[readers/SimpleDirectoryReader.ts:26](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/readers/SimpleDirectoryReader.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### SimplePrompt
|
||||
|
||||
Ƭ **SimplePrompt**: (`input`: `Record`<`string`, `string`\>) => `string`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
##### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
## Variables
|
||||
|
||||
### ALL\_AVAILABLE\_MODELS
|
||||
|
||||
• `Const` **ALL\_AVAILABLE\_MODELS**: `Object`
|
||||
|
||||
We currently support GPT-3.5 and GPT-4 models
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `gpt-3.5-turbo` | `number` |
|
||||
| `gpt-3.5-turbo-16k` | `number` |
|
||||
| `gpt-4` | `number` |
|
||||
| `gpt-4-32k` | `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:57](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_CHUNK\_OVERLAP
|
||||
|
||||
• `Const` **DEFAULT\_CHUNK\_OVERLAP**: ``20``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_CHUNK\_OVERLAP\_RATIO
|
||||
|
||||
• `Const` **DEFAULT\_CHUNK\_OVERLAP\_RATIO**: ``0.1``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_CHUNK\_SIZE
|
||||
|
||||
• `Const` **DEFAULT\_CHUNK\_SIZE**: ``1024``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_COLLECTION
|
||||
|
||||
• `Const` **DEFAULT\_COLLECTION**: ``"data"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L1)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_CONTEXT\_WINDOW
|
||||
|
||||
• `Const` **DEFAULT\_CONTEXT\_WINDOW**: ``3900``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:1](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L1)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_DOC\_STORE\_PERSIST\_FILENAME
|
||||
|
||||
• `Const` **DEFAULT\_DOC\_STORE\_PERSIST\_FILENAME**: ``"docstore.json"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:4](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_EMBEDDING\_DIM
|
||||
|
||||
• `Const` **DEFAULT\_EMBEDDING\_DIM**: ``1536``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_FS
|
||||
|
||||
• `Const` **DEFAULT\_FS**: [`GenericFileSystem`](interfaces/GenericFileSystem.md) \| [`CompleteFileSystem`](modules.md#completefilesystem)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:62](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_GRAPH\_STORE\_PERSIST\_FILENAME
|
||||
|
||||
• `Const` **DEFAULT\_GRAPH\_STORE\_PERSIST\_FILENAME**: ``"graph_store.json"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:6](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L6)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_INDEX\_STORE\_PERSIST\_FILENAME
|
||||
|
||||
• `Const` **DEFAULT\_INDEX\_STORE\_PERSIST\_FILENAME**: ``"index_store.json"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:3](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L3)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_NAMESPACE
|
||||
|
||||
• `Const` **DEFAULT\_NAMESPACE**: ``"docstore"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_NUM\_OUTPUTS
|
||||
|
||||
• `Const` **DEFAULT\_NUM\_OUTPUTS**: ``256``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L2)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_PADDING
|
||||
|
||||
• `Const` **DEFAULT\_PADDING**: ``5``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:11](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_PERSIST\_DIR
|
||||
|
||||
• `Const` **DEFAULT\_PERSIST\_DIR**: ``"./storage"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:2](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L2)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_SIMILARITY\_TOP\_K
|
||||
|
||||
• `Const` **DEFAULT\_SIMILARITY\_TOP\_K**: ``2``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[constants.ts:7](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/constants.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### DEFAULT\_VECTOR\_STORE\_PERSIST\_FILENAME
|
||||
|
||||
• `Const` **DEFAULT\_VECTOR\_STORE\_PERSIST\_FILENAME**: ``"vector_store.json"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/constants.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/constants.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
### GPT4\_MODELS
|
||||
|
||||
• `Const` **GPT4\_MODELS**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `gpt-4` | `number` |
|
||||
| `gpt-4-32k` | `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:44](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### TURBO\_MODELS
|
||||
|
||||
• `Const` **TURBO\_MODELS**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `gpt-3.5-turbo` | `number` |
|
||||
| `gpt-3.5-turbo-16k` | `number` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[LLM.ts:49](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/LLM.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### globalsHelper
|
||||
|
||||
• `Const` **globalsHelper**: `GlobalsHelper`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[GlobalsHelper.ts:42](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/GlobalsHelper.ts#L42)
|
||||
|
||||
## Functions
|
||||
|
||||
### buildToolsText
|
||||
|
||||
▸ **buildToolsText**(`tools`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `tools` | [`ToolMetadata`](interfaces/ToolMetadata.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:198](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L198)
|
||||
|
||||
___
|
||||
|
||||
### contextSystemPrompt
|
||||
|
||||
▸ **contextSystemPrompt**(`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### defaultChoiceSelectPrompt
|
||||
|
||||
▸ **defaultChoiceSelectPrompt**(`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### defaultCondenseQuestionPrompt
|
||||
|
||||
▸ **defaultCondenseQuestionPrompt**(`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### defaultRefinePrompt
|
||||
|
||||
▸ **defaultRefinePrompt**(`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### defaultSubQuestionPrompt
|
||||
|
||||
▸ **defaultSubQuestionPrompt**(`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### defaultSummaryPrompt
|
||||
|
||||
▸ **defaultSummaryPrompt**(`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### defaultTextQaPrompt
|
||||
|
||||
▸ **defaultTextQaPrompt**(`input`): `string`
|
||||
|
||||
A SimplePrompt is a function that takes a dictionary of inputs and returns a string.
|
||||
NOTE this is a different interface compared to LlamaIndex Python
|
||||
NOTE 2: we default to empty string to make it easy to calculate prompt sizes
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `input` | `Record`<`string`, `string`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:10](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### exists
|
||||
|
||||
▸ **exists**(`fs`, `path`): `Promise`<`boolean`\>
|
||||
|
||||
Checks if a file exists.
|
||||
Analogous to the os.path.exists function from Python.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fs` | [`GenericFileSystem`](interfaces/GenericFileSystem.md) | The filesystem to use. |
|
||||
| `path` | `string` | The path to the file to check. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`boolean`\>
|
||||
|
||||
A promise that resolves to true if the file exists, false otherwise.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:74](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
### getNodeFS
|
||||
|
||||
▸ **getNodeFS**(): [`CompleteFileSystem`](modules.md#completefilesystem)
|
||||
|
||||
#### Returns
|
||||
|
||||
[`CompleteFileSystem`](modules.md#completefilesystem)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:51](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L51)
|
||||
|
||||
___
|
||||
|
||||
### getNodesFromDocument
|
||||
|
||||
▸ **getNodesFromDocument**(`document`, `textSplitter`, `includeMetadata?`, `includePrevNextRel?`): [`TextNode`](classes/TextNode.md)[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `document` | [`Document`](classes/Document.md) | `undefined` |
|
||||
| `textSplitter` | [`SentenceSplitter`](classes/SentenceSplitter.md) | `undefined` |
|
||||
| `includeMetadata` | `boolean` | `true` |
|
||||
| `includePrevNextRel` | `boolean` | `true` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`TextNode`](classes/TextNode.md)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:15](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### getResponseBuilder
|
||||
|
||||
▸ **getResponseBuilder**(`serviceContext?`): [`SimpleResponseBuilder`](classes/SimpleResponseBuilder.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `serviceContext?` | [`ServiceContext`](interfaces/ServiceContext.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`SimpleResponseBuilder`](classes/SimpleResponseBuilder.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ResponseSynthesizer.ts:212](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ResponseSynthesizer.ts#L212)
|
||||
|
||||
___
|
||||
|
||||
### getTextSplitsFromDocument
|
||||
|
||||
▸ **getTextSplitsFromDocument**(`document`, `textSplitter`): `string`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `document` | [`Document`](classes/Document.md) |
|
||||
| `textSplitter` | [`SentenceSplitter`](classes/SentenceSplitter.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[NodeParser.ts:5](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/NodeParser.ts#L5)
|
||||
|
||||
___
|
||||
|
||||
### getTopKEmbeddings
|
||||
|
||||
▸ **getTopKEmbeddings**(`queryEmbedding`, `embeddings`, `similarityTopK?`, `embeddingIds?`, `similarityCutoff?`): [`number`[], `any`[]]
|
||||
|
||||
Get the top K embeddings from a list of embeddings ordered by similarity to the query.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `queryEmbedding` | `number`[] | `undefined` | |
|
||||
| `embeddings` | `number`[][] | `undefined` | list of embeddings to consider |
|
||||
| `similarityTopK` | `number` | `DEFAULT_SIMILARITY_TOP_K` | max number of embeddings to return, default 2 |
|
||||
| `embeddingIds` | ``null`` \| `any`[] | `null` | ids of embeddings in the embeddings list |
|
||||
| `similarityCutoff` | ``null`` \| `number` | `null` | minimum similarity score |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`number`[], `any`[]]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:77](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### getTopKEmbeddingsLearner
|
||||
|
||||
▸ **getTopKEmbeddingsLearner**(`queryEmbedding`, `embeddings`, `similarityTopK?`, `embeddingsIds?`, `queryMode?`): [`number`[], `any`[]]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `queryEmbedding` | `number`[] | `undefined` |
|
||||
| `embeddings` | `number`[][] | `undefined` |
|
||||
| `similarityTopK?` | `number` | `undefined` |
|
||||
| `embeddingsIds?` | `any`[] | `undefined` |
|
||||
| `queryMode` | `VectorStoreQueryMode` | `VectorStoreQueryMode.SVM` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`number`[], `any`[]]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:119](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
### getTopKMMREmbeddings
|
||||
|
||||
▸ **getTopKMMREmbeddings**(`queryEmbedding`, `embeddings`, `similarityFn?`, `similarityTopK?`, `embeddingIds?`, `_similarityCutoff?`, `mmrThreshold?`): [`number`[], `any`[]]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `queryEmbedding` | `number`[] | `undefined` |
|
||||
| `embeddings` | `number`[][] | `undefined` |
|
||||
| `similarityFn` | ``null`` \| (...`args`: `any`[]) => `number` | `null` |
|
||||
| `similarityTopK` | ``null`` \| `number` | `null` |
|
||||
| `embeddingIds` | ``null`` \| `any`[] | `null` |
|
||||
| `_similarityCutoff` | ``null`` \| `number` | `null` |
|
||||
| `mmrThreshold` | ``null`` \| `number` | `null` |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`number`[], `any`[]]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:131](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
### messagesToHistoryStr
|
||||
|
||||
▸ **messagesToHistoryStr**(`messages`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `messages` | [`ChatMessage`](interfaces/ChatMessage.md)[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Prompt.ts:300](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Prompt.ts#L300)
|
||||
|
||||
___
|
||||
|
||||
### serviceContextFromDefaults
|
||||
|
||||
▸ **serviceContextFromDefaults**(`options?`): [`ServiceContext`](interfaces/ServiceContext.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options?` | [`ServiceContextOptions`](interfaces/ServiceContextOptions.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ServiceContext`](interfaces/ServiceContext.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:32](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L32)
|
||||
|
||||
___
|
||||
|
||||
### serviceContextFromServiceContext
|
||||
|
||||
▸ **serviceContextFromServiceContext**(`serviceContext`, `options`): `Object`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `serviceContext` | [`ServiceContext`](interfaces/ServiceContext.md) |
|
||||
| `options` | [`ServiceContextOptions`](interfaces/ServiceContextOptions.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Object`
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `callbackManager` | [`CallbackManager`](classes/CallbackManager.md) |
|
||||
| `embedModel` | [`BaseEmbedding`](classes/BaseEmbedding.md) |
|
||||
| `llmPredictor` | [`BaseLLMPredictor`](interfaces/BaseLLMPredictor.md) |
|
||||
| `nodeParser` | [`NodeParser`](interfaces/NodeParser.md) |
|
||||
| `promptHelper` | `PromptHelper` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[ServiceContext.ts:52](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/ServiceContext.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### similarity
|
||||
|
||||
▸ **similarity**(`embedding1`, `embedding2`, `mode?`): `number`
|
||||
|
||||
The similarity between two embeddings.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `embedding1` | `number`[] | `undefined` |
|
||||
| `embedding2` | `number`[] | `undefined` |
|
||||
| `mode` | [`SimilarityType`](enums/SimilarityType.md) | `SimilarityType.DEFAULT` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
similartiy score with higher numbers meaning the two embeddings are more similar
|
||||
|
||||
#### Defined in
|
||||
|
||||
[Embedding.ts:22](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/Embedding.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### storageContextFromDefaults
|
||||
|
||||
▸ **storageContextFromDefaults**(`«destructured»`): `Promise`<[`StorageContext`](interfaces/StorageContext.md)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `«destructured»` | `BuilderParams` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`StorageContext`](interfaces/StorageContext.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/StorageContext.ts:28](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/StorageContext.ts#L28)
|
||||
|
||||
___
|
||||
|
||||
### walk
|
||||
|
||||
▸ **walk**(`fs`, `dirPath`): `AsyncIterable`<`string`\>
|
||||
|
||||
Recursively traverses a directory and yields all the paths to the files in it.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fs` | [`WalkableFileSystem`](interfaces/WalkableFileSystem.md) | The filesystem to use. |
|
||||
| `dirPath` | `string` | The path to the directory to traverse. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`AsyncIterable`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[storage/FileSystem.ts:91](https://github.com/run-llama/llamascript/blob/6ea89db/packages/core/src/storage/FileSystem.ts#L91)
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Concepts
|
||||
|
||||
## High Level API
|
||||
|
||||
- Document: A document represents a text file, PDF file or other contiguous piece of data.
|
||||
|
||||
- Node: The basic data building block. Most commonly, these are parts of the document split into manageable pieces that are small enough to be fed into an embedding model and LLM.
|
||||
|
||||
- Indexes: indexes store the Nodes and the embeddings of those nodes.
|
||||
|
||||
- QueryEngine: Query engines are what generate the query you put in and give you back the result. Query engines generally combine a pre-built prompt with selected nodes from your Index to give the LLM the context it needs to answer your query.
|
||||
|
||||
- ChatEngine: A ChatEngine helps you build a chatbot that will interact with your Indexes.
|
||||
|
||||
## Low Level API
|
||||
|
||||
- SimplePrompt: A simple standardized function call definition that takes in inputs and puts them in a prebuilt template.
|
||||
|
||||
- LLM: The LLM class is a unified interface over a large language model provider such as OpenAI GPT-4, Anthropic Claude, or Meta LLaMA. You can subclass it to write a connector to your own large language model.
|
||||
|
||||
- Embedding: An embedding is represented as a vector of floating point numbers. OpenAI's text-embedding-ada-002 is our default embedding model and each embedding it generates consists of 1,536 floating point numbers. Another popular embedding model is BERT which uses 768 floating point numbers to represent each Node. We provide a number of utilities to work with embeddings including 3 similarity calculation options and Maximum Marginal Relevance
|
||||
|
||||
- Reader/Loader: A reader or loader is something that takes in a document in the real world and transforms into a Document class that can then be used in your Index and queries. We currently support plain text files and PDFs with many many more to come.
|
||||
|
||||
- TextSplitter: Text splitting strategies are incredibly important to the overall efficacy of the embedding search. Currently, while we do have a default, there's no one size fits all solution. Depending on the source documents, you may want to use different splitting sizes and strategies. Currently we support spliltting by fixed size, splitting by fixed size with overlapping sections, splitting by sentence, and splitting by paragraph.
|
||||
|
||||
- Retriever: The Retriever is what actually chooses the Nodes to retrieve from the index. Here, you may wish to try retrieving more or fewer Nodes per query, changing your similarity function, or creating your own retriever for each individual use case in your application. For example, you may wish to have a separate retriever for code content vs. text content.
|
||||
|
||||
- Storage: At some point you're going to want to store your indexes, data and vectors instead of re-running the embedding models every time. IndexStore, DocStore, VectorStore, and KVStore are abstractions that let you do that. Combined, they form the StorageContext. Currently, we allow you to persist your embeddings in files on the filesystem (or a virtual in memory file system), but we are also actively adding integrations to Vector Databases.
|
||||
@@ -0,0 +1,2 @@
|
||||
label: Examples
|
||||
position: 2
|
||||
@@ -0,0 +1,10 @@
|
||||
# Agents
|
||||
|
||||
A built-in agent that can take decisions and reasoning based on the tools provided to it.
|
||||
|
||||
## OpenAI Agent
|
||||
|
||||
import CodeBlock from "@theme/CodeBlock";
|
||||
import CodeSource from "!raw-loader!../../../../examples/agent/openai";
|
||||
|
||||
<CodeBlock language="ts">{CodeSource}</CodeBlock>
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
import CodeBlock from "@theme/CodeBlock";
|
||||
import CodeSource from "!raw-loader!../../../../examples/chatEngine";
|
||||
|
||||
# Chat Engine
|
||||
|
||||
Chat Engine is a class that allows you to create a chatbot from a retriever. It is a wrapper around a retriever that allows you to chat with it in a conversational manner.
|
||||
|
||||
<CodeBlock language="ts">{CodeSource}</CodeBlock>
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# More examples
|
||||
|
||||
You can check out more examples in the [examples](https://github.com/run-llama/LlamaIndexTS/tree/main/examples) folder of the repository.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
import CodeBlock from "@theme/CodeBlock";
|
||||
import CodeSource from "!raw-loader!../../../../examples/storageContext";
|
||||
|
||||
# Save/Load an Index
|
||||
|
||||
<CodeBlock language="ts">{CodeSource}</CodeBlock>
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
import CodeBlock from "@theme/CodeBlock";
|
||||
import CodeSource from "!raw-loader!../../../../examples/summaryIndex";
|
||||
|
||||
# Summary Index
|
||||
|
||||
<CodeBlock language="ts">{CodeSource}</CodeBlock>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user