@ax-llm/ax 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +547 -0
  3. package/build/module/docs/assets/icons.d.ts +1 -0
  4. package/build/module/docs/assets/icons.js +19 -0
  5. package/build/module/docs/assets/icons.js.map +1 -0
  6. package/build/module/docs/assets/main.d.ts +1 -0
  7. package/build/module/docs/assets/main.js +629 -0
  8. package/build/module/docs/assets/main.js.map +1 -0
  9. package/build/module/docs/assets/navigation.d.ts +1 -0
  10. package/build/module/docs/assets/navigation.js +3 -0
  11. package/build/module/docs/assets/navigation.js.map +1 -0
  12. package/build/module/docs/assets/search.d.ts +1 -0
  13. package/build/module/docs/assets/search.js +3 -0
  14. package/build/module/docs/assets/search.js.map +1 -0
  15. package/build/module/src/ai/anthropic/api.d.ts +24 -0
  16. package/build/module/src/ai/anthropic/api.js +188 -0
  17. package/build/module/src/ai/anthropic/api.js.map +1 -0
  18. package/build/module/src/ai/anthropic/index.d.ts +2 -0
  19. package/build/module/src/ai/anthropic/index.js +3 -0
  20. package/build/module/src/ai/anthropic/index.js.map +1 -0
  21. package/build/module/src/ai/anthropic/info.d.ts +2 -0
  22. package/build/module/src/ai/anthropic/info.js +34 -0
  23. package/build/module/src/ai/anthropic/info.js.map +1 -0
  24. package/build/module/src/ai/anthropic/types.d.ts +140 -0
  25. package/build/module/src/ai/anthropic/types.js +13 -0
  26. package/build/module/src/ai/anthropic/types.js.map +1 -0
  27. package/build/module/src/ai/azure-openai/api.d.ts +34 -0
  28. package/build/module/src/ai/azure-openai/api.js +42 -0
  29. package/build/module/src/ai/azure-openai/api.js.map +1 -0
  30. package/build/module/src/ai/azure-openai/index.d.ts +1 -0
  31. package/build/module/src/ai/azure-openai/index.js +2 -0
  32. package/build/module/src/ai/azure-openai/index.js.map +1 -0
  33. package/build/module/src/ai/balance.d.ts +26 -0
  34. package/build/module/src/ai/balance.js +87 -0
  35. package/build/module/src/ai/balance.js.map +1 -0
  36. package/build/module/src/ai/base.d.ts +56 -0
  37. package/build/module/src/ai/base.js +328 -0
  38. package/build/module/src/ai/base.js.map +1 -0
  39. package/build/module/src/ai/cohere/api.d.ts +35 -0
  40. package/build/module/src/ai/cohere/api.js +214 -0
  41. package/build/module/src/ai/cohere/api.js.map +1 -0
  42. package/build/module/src/ai/cohere/index.d.ts +2 -0
  43. package/build/module/src/ai/cohere/index.js +3 -0
  44. package/build/module/src/ai/cohere/index.js.map +1 -0
  45. package/build/module/src/ai/cohere/info.d.ts +2 -0
  46. package/build/module/src/ai/cohere/info.js +52 -0
  47. package/build/module/src/ai/cohere/info.js.map +1 -0
  48. package/build/module/src/ai/cohere/types.d.ts +85 -0
  49. package/build/module/src/ai/cohere/types.js +23 -0
  50. package/build/module/src/ai/cohere/types.js.map +1 -0
  51. package/build/module/src/ai/deepseek/api.d.ts +27 -0
  52. package/build/module/src/ai/deepseek/api.js +38 -0
  53. package/build/module/src/ai/deepseek/api.js.map +1 -0
  54. package/build/module/src/ai/deepseek/index.d.ts +2 -0
  55. package/build/module/src/ai/deepseek/index.js +3 -0
  56. package/build/module/src/ai/deepseek/index.js.map +1 -0
  57. package/build/module/src/ai/deepseek/info.d.ts +2 -0
  58. package/build/module/src/ai/deepseek/info.js +16 -0
  59. package/build/module/src/ai/deepseek/info.js.map +1 -0
  60. package/build/module/src/ai/deepseek/types.d.ts +8 -0
  61. package/build/module/src/ai/deepseek/types.js +10 -0
  62. package/build/module/src/ai/deepseek/types.js.map +1 -0
  63. package/build/module/src/ai/google-gemini/api.d.ts +34 -0
  64. package/build/module/src/ai/google-gemini/api.js +268 -0
  65. package/build/module/src/ai/google-gemini/api.js.map +1 -0
  66. package/build/module/src/ai/google-gemini/index.d.ts +2 -0
  67. package/build/module/src/ai/google-gemini/index.js +3 -0
  68. package/build/module/src/ai/google-gemini/index.js.map +1 -0
  69. package/build/module/src/ai/google-gemini/info.d.ts +6 -0
  70. package/build/module/src/ai/google-gemini/info.js +29 -0
  71. package/build/module/src/ai/google-gemini/info.js.map +1 -0
  72. package/build/module/src/ai/google-gemini/types.d.ts +151 -0
  73. package/build/module/src/ai/google-gemini/types.js +38 -0
  74. package/build/module/src/ai/google-gemini/types.js.map +1 -0
  75. package/build/module/src/ai/groq/api.d.ts +22 -0
  76. package/build/module/src/ai/groq/api.js +29 -0
  77. package/build/module/src/ai/groq/api.js.map +1 -0
  78. package/build/module/src/ai/groq/index.d.ts +1 -0
  79. package/build/module/src/ai/groq/index.js +2 -0
  80. package/build/module/src/ai/groq/index.js.map +1 -0
  81. package/build/module/src/ai/huggingface/api.d.ts +32 -0
  82. package/build/module/src/ai/huggingface/api.js +99 -0
  83. package/build/module/src/ai/huggingface/api.js.map +1 -0
  84. package/build/module/src/ai/huggingface/index.d.ts +2 -0
  85. package/build/module/src/ai/huggingface/index.js +3 -0
  86. package/build/module/src/ai/huggingface/index.js.map +1 -0
  87. package/build/module/src/ai/huggingface/info.d.ts +6 -0
  88. package/build/module/src/ai/huggingface/info.js +6 -0
  89. package/build/module/src/ai/huggingface/info.js.map +1 -0
  90. package/build/module/src/ai/huggingface/types.d.ts +42 -0
  91. package/build/module/src/ai/huggingface/types.js +9 -0
  92. package/build/module/src/ai/huggingface/types.js.map +1 -0
  93. package/build/module/src/ai/index.d.ts +28 -0
  94. package/build/module/src/ai/index.js +54 -0
  95. package/build/module/src/ai/index.js.map +1 -0
  96. package/build/module/src/ai/mistral/api.d.ts +27 -0
  97. package/build/module/src/ai/mistral/api.js +38 -0
  98. package/build/module/src/ai/mistral/api.js.map +1 -0
  99. package/build/module/src/ai/mistral/index.d.ts +2 -0
  100. package/build/module/src/ai/mistral/index.js +3 -0
  101. package/build/module/src/ai/mistral/index.js.map +1 -0
  102. package/build/module/src/ai/mistral/info.d.ts +2 -0
  103. package/build/module/src/ai/mistral/info.js +34 -0
  104. package/build/module/src/ai/mistral/info.js.map +1 -0
  105. package/build/module/src/ai/mistral/types.d.ts +18 -0
  106. package/build/module/src/ai/mistral/types.js +21 -0
  107. package/build/module/src/ai/mistral/types.js.map +1 -0
  108. package/build/module/src/ai/ollama/api.d.ts +24 -0
  109. package/build/module/src/ai/ollama/api.js +28 -0
  110. package/build/module/src/ai/ollama/api.js.map +1 -0
  111. package/build/module/src/ai/ollama/index.d.ts +1 -0
  112. package/build/module/src/ai/ollama/index.js +2 -0
  113. package/build/module/src/ai/ollama/index.js.map +1 -0
  114. package/build/module/src/ai/openai/api.d.ts +49 -0
  115. package/build/module/src/ai/openai/api.js +333 -0
  116. package/build/module/src/ai/openai/api.js.map +1 -0
  117. package/build/module/src/ai/openai/index.d.ts +2 -0
  118. package/build/module/src/ai/openai/index.js +3 -0
  119. package/build/module/src/ai/openai/index.js.map +1 -0
  120. package/build/module/src/ai/openai/info.d.ts +6 -0
  121. package/build/module/src/ai/openai/info.js +50 -0
  122. package/build/module/src/ai/openai/info.js.map +1 -0
  123. package/build/module/src/ai/openai/types.d.ts +192 -0
  124. package/build/module/src/ai/openai/types.js +35 -0
  125. package/build/module/src/ai/openai/types.js.map +1 -0
  126. package/build/module/src/ai/together/api.d.ts +22 -0
  127. package/build/module/src/ai/together/api.js +29 -0
  128. package/build/module/src/ai/together/api.js.map +1 -0
  129. package/build/module/src/ai/together/index.d.ts +1 -0
  130. package/build/module/src/ai/together/index.js +2 -0
  131. package/build/module/src/ai/together/index.js.map +1 -0
  132. package/build/module/src/ai/together/info.d.ts +2 -0
  133. package/build/module/src/ai/together/info.js +2 -0
  134. package/build/module/src/ai/together/info.js.map +1 -0
  135. package/build/module/src/ai/types.d.ts +70 -0
  136. package/build/module/src/ai/types.js +2 -0
  137. package/build/module/src/ai/types.js.map +1 -0
  138. package/build/module/src/ai/util.d.ts +13 -0
  139. package/build/module/src/ai/util.js +112 -0
  140. package/build/module/src/ai/util.js.map +1 -0
  141. package/build/module/src/db/base.d.ts +24 -0
  142. package/build/module/src/db/base.js +90 -0
  143. package/build/module/src/db/base.js.map +1 -0
  144. package/build/module/src/db/cloudflare.d.ts +20 -0
  145. package/build/module/src/db/cloudflare.js +98 -0
  146. package/build/module/src/db/cloudflare.js.map +1 -0
  147. package/build/module/src/db/index.d.ts +12 -0
  148. package/build/module/src/db/index.js +23 -0
  149. package/build/module/src/db/index.js.map +1 -0
  150. package/build/module/src/db/memory.d.ts +23 -0
  151. package/build/module/src/db/memory.js +125 -0
  152. package/build/module/src/db/memory.js.map +1 -0
  153. package/build/module/src/db/pinecone.d.ts +20 -0
  154. package/build/module/src/db/pinecone.js +71 -0
  155. package/build/module/src/db/pinecone.js.map +1 -0
  156. package/build/module/src/db/types.d.ts +35 -0
  157. package/build/module/src/db/types.js +3 -0
  158. package/build/module/src/db/types.js.map +1 -0
  159. package/build/module/src/db/weaviate.d.ts +20 -0
  160. package/build/module/src/db/weaviate.js +127 -0
  161. package/build/module/src/db/weaviate.js.map +1 -0
  162. package/build/module/src/docs/index.d.ts +4 -0
  163. package/build/module/src/docs/index.js +5 -0
  164. package/build/module/src/docs/index.js.map +1 -0
  165. package/build/module/src/docs/manager.d.ts +45 -0
  166. package/build/module/src/docs/manager.js +159 -0
  167. package/build/module/src/docs/manager.js.map +1 -0
  168. package/build/module/src/docs/reranker.d.ts +7 -0
  169. package/build/module/src/docs/reranker.js +26 -0
  170. package/build/module/src/docs/reranker.js.map +1 -0
  171. package/build/module/src/docs/rewriter.d.ts +4 -0
  172. package/build/module/src/docs/rewriter.js +9 -0
  173. package/build/module/src/docs/rewriter.js.map +1 -0
  174. package/build/module/src/docs/tika.d.ts +21 -0
  175. package/build/module/src/docs/tika.js +46 -0
  176. package/build/module/src/docs/tika.js.map +1 -0
  177. package/build/module/src/dsp/asserts.d.ts +32 -0
  178. package/build/module/src/dsp/asserts.js +88 -0
  179. package/build/module/src/dsp/asserts.js.map +1 -0
  180. package/build/module/src/dsp/eval.d.ts +62 -0
  181. package/build/module/src/dsp/eval.js +120 -0
  182. package/build/module/src/dsp/eval.js.map +1 -0
  183. package/build/module/src/dsp/evaluate.d.ts +12 -0
  184. package/build/module/src/dsp/evaluate.js +32 -0
  185. package/build/module/src/dsp/evaluate.js.map +1 -0
  186. package/build/module/src/dsp/extract.d.ts +25 -0
  187. package/build/module/src/dsp/extract.js +152 -0
  188. package/build/module/src/dsp/extract.js.map +1 -0
  189. package/build/module/src/dsp/generate.d.ts +52 -0
  190. package/build/module/src/dsp/generate.js +335 -0
  191. package/build/module/src/dsp/generate.js.map +1 -0
  192. package/build/module/src/dsp/generate.test.d.ts +1 -0
  193. package/build/module/src/dsp/generate.test.js +41 -0
  194. package/build/module/src/dsp/generate.test.js.map +1 -0
  195. package/build/module/src/dsp/index.d.ts +14 -0
  196. package/build/module/src/dsp/index.js +10 -0
  197. package/build/module/src/dsp/index.js.map +1 -0
  198. package/build/module/src/dsp/loader.d.ts +25 -0
  199. package/build/module/src/dsp/loader.js +87 -0
  200. package/build/module/src/dsp/loader.js.map +1 -0
  201. package/build/module/src/dsp/optimize.d.ts +29 -0
  202. package/build/module/src/dsp/optimize.js +100 -0
  203. package/build/module/src/dsp/optimize.js.map +1 -0
  204. package/build/module/src/dsp/parser.d.ts +86 -0
  205. package/build/module/src/dsp/parser.js +1437 -0
  206. package/build/module/src/dsp/parser.js.map +1 -0
  207. package/build/module/src/dsp/program.d.ts +64 -0
  208. package/build/module/src/dsp/program.js +129 -0
  209. package/build/module/src/dsp/program.js.map +1 -0
  210. package/build/module/src/dsp/prompt.d.ts +25 -0
  211. package/build/module/src/dsp/prompt.js +178 -0
  212. package/build/module/src/dsp/prompt.js.map +1 -0
  213. package/build/module/src/dsp/registry.d.ts +6 -0
  214. package/build/module/src/dsp/registry.js +15 -0
  215. package/build/module/src/dsp/registry.js.map +1 -0
  216. package/build/module/src/dsp/router.d.ts +24 -0
  217. package/build/module/src/dsp/router.js +72 -0
  218. package/build/module/src/dsp/router.js.map +1 -0
  219. package/build/module/src/dsp/sig.d.ts +37 -0
  220. package/build/module/src/dsp/sig.js +160 -0
  221. package/build/module/src/dsp/sig.js.map +1 -0
  222. package/build/module/src/dsp/sig.test.d.ts +1 -0
  223. package/build/module/src/dsp/sig.test.js +25 -0
  224. package/build/module/src/dsp/sig.test.js.map +1 -0
  225. package/build/module/src/dsp/stopwords.d.ts +1 -0
  226. package/build/module/src/dsp/stopwords.js +1163 -0
  227. package/build/module/src/dsp/stopwords.js.map +1 -0
  228. package/build/module/src/dsp/strutil.d.ts +9 -0
  229. package/build/module/src/dsp/strutil.js +52 -0
  230. package/build/module/src/dsp/strutil.js.map +1 -0
  231. package/build/module/src/dsp/util.d.ts +1 -0
  232. package/build/module/src/dsp/util.js +14 -0
  233. package/build/module/src/dsp/util.js.map +1 -0
  234. package/build/module/src/examples/agent.d.ts +1 -0
  235. package/build/module/src/examples/agent.js +24 -0
  236. package/build/module/src/examples/agent.js.map +1 -0
  237. package/build/module/src/examples/chain-of-thought.d.ts +1 -0
  238. package/build/module/src/examples/chain-of-thought.js +18 -0
  239. package/build/module/src/examples/chain-of-thought.js.map +1 -0
  240. package/build/module/src/examples/customer-support.d.ts +1 -0
  241. package/build/module/src/examples/customer-support.js +22 -0
  242. package/build/module/src/examples/customer-support.js.map +1 -0
  243. package/build/module/src/examples/fibonacci.d.ts +1 -0
  244. package/build/module/src/examples/fibonacci.js +9 -0
  245. package/build/module/src/examples/fibonacci.js.map +1 -0
  246. package/build/module/src/examples/food-search.d.ts +1 -0
  247. package/build/module/src/examples/food-search.js +137 -0
  248. package/build/module/src/examples/food-search.js.map +1 -0
  249. package/build/module/src/examples/marketing.d.ts +1 -0
  250. package/build/module/src/examples/marketing.js +26 -0
  251. package/build/module/src/examples/marketing.js.map +1 -0
  252. package/build/module/src/examples/meetings.d.ts +1 -0
  253. package/build/module/src/examples/meetings.js +149 -0
  254. package/build/module/src/examples/meetings.js.map +1 -0
  255. package/build/module/src/examples/qna-tune.d.ts +1 -0
  256. package/build/module/src/examples/qna-tune.js +29 -0
  257. package/build/module/src/examples/qna-tune.js.map +1 -0
  258. package/build/module/src/examples/qna-use-tuned.d.ts +1 -0
  259. package/build/module/src/examples/qna-use-tuned.js +25 -0
  260. package/build/module/src/examples/qna-use-tuned.js.map +1 -0
  261. package/build/module/src/examples/rag-docs.d.ts +1 -0
  262. package/build/module/src/examples/rag-docs.js +14 -0
  263. package/build/module/src/examples/rag-docs.js.map +1 -0
  264. package/build/module/src/examples/rag.d.ts +1 -0
  265. package/build/module/src/examples/rag.js +14 -0
  266. package/build/module/src/examples/rag.js.map +1 -0
  267. package/build/module/src/examples/react.d.ts +1 -0
  268. package/build/module/src/examples/react.js +36 -0
  269. package/build/module/src/examples/react.js.map +1 -0
  270. package/build/module/src/examples/routing.d.ts +1 -0
  271. package/build/module/src/examples/routing.js +48 -0
  272. package/build/module/src/examples/routing.js.map +1 -0
  273. package/build/module/src/examples/streaming1.d.ts +1 -0
  274. package/build/module/src/examples/streaming1.js +15 -0
  275. package/build/module/src/examples/streaming1.js.map +1 -0
  276. package/build/module/src/examples/streaming2.d.ts +1 -0
  277. package/build/module/src/examples/streaming2.js +24 -0
  278. package/build/module/src/examples/streaming2.js.map +1 -0
  279. package/build/module/src/examples/summarize.d.ts +1 -0
  280. package/build/module/src/examples/summarize.js +27 -0
  281. package/build/module/src/examples/summarize.js.map +1 -0
  282. package/build/module/src/examples/vectordb.d.ts +1 -0
  283. package/build/module/src/examples/vectordb.js +14 -0
  284. package/build/module/src/examples/vectordb.js.map +1 -0
  285. package/build/module/src/funcs/code.d.ts +10 -0
  286. package/build/module/src/funcs/code.js +63 -0
  287. package/build/module/src/funcs/code.js.map +1 -0
  288. package/build/module/src/funcs/embed.d.ts +8 -0
  289. package/build/module/src/funcs/embed.js +29 -0
  290. package/build/module/src/funcs/embed.js.map +1 -0
  291. package/build/module/src/funcs/index.d.ts +2 -0
  292. package/build/module/src/funcs/index.js +3 -0
  293. package/build/module/src/funcs/index.js.map +1 -0
  294. package/build/module/src/index.d.ts +9 -0
  295. package/build/module/src/index.js +15 -0
  296. package/build/module/src/index.js.map +1 -0
  297. package/build/module/src/prompts/agent.d.ts +24 -0
  298. package/build/module/src/prompts/agent.js +65 -0
  299. package/build/module/src/prompts/agent.js.map +1 -0
  300. package/build/module/src/prompts/cot.d.ts +9 -0
  301. package/build/module/src/prompts/cot.js +17 -0
  302. package/build/module/src/prompts/cot.js.map +1 -0
  303. package/build/module/src/prompts/index.d.ts +4 -0
  304. package/build/module/src/prompts/index.js +5 -0
  305. package/build/module/src/prompts/index.js.map +1 -0
  306. package/build/module/src/prompts/prompts.test.d.ts +1 -0
  307. package/build/module/src/prompts/prompts.test.js +48 -0
  308. package/build/module/src/prompts/prompts.test.js.map +1 -0
  309. package/build/module/src/prompts/rag.d.ts +23 -0
  310. package/build/module/src/prompts/rag.js +30 -0
  311. package/build/module/src/prompts/rag.js.map +1 -0
  312. package/build/module/src/prompts/react.d.ts +8 -0
  313. package/build/module/src/prompts/react.js +22 -0
  314. package/build/module/src/prompts/react.js.map +1 -0
  315. package/build/module/src/text/functions.d.ts +25 -0
  316. package/build/module/src/text/functions.js +55 -0
  317. package/build/module/src/text/functions.js.map +1 -0
  318. package/build/module/src/text/index.d.ts +3 -0
  319. package/build/module/src/text/index.js +4 -0
  320. package/build/module/src/text/index.js.map +1 -0
  321. package/build/module/src/text/jsonschema.d.ts +2 -0
  322. package/build/module/src/text/jsonschema.js +96 -0
  323. package/build/module/src/text/jsonschema.js.map +1 -0
  324. package/build/module/src/text/memory.d.ts +21 -0
  325. package/build/module/src/text/memory.js +73 -0
  326. package/build/module/src/text/memory.js.map +1 -0
  327. package/build/module/src/text/types.d.ts +57 -0
  328. package/build/module/src/text/types.js +2 -0
  329. package/build/module/src/text/types.js.map +1 -0
  330. package/build/module/src/trace/index.d.ts +171 -0
  331. package/build/module/src/trace/index.js +67 -0
  332. package/build/module/src/trace/index.js.map +1 -0
  333. package/build/module/src/types/index.d.ts +81 -0
  334. package/build/module/src/types/index.js +2 -0
  335. package/build/module/src/types/index.js.map +1 -0
  336. package/build/module/src/util/apicall.d.ts +21 -0
  337. package/build/module/src/util/apicall.js +137 -0
  338. package/build/module/src/util/apicall.js.map +1 -0
  339. package/build/module/src/util/log.d.ts +14 -0
  340. package/build/module/src/util/log.js +30 -0
  341. package/build/module/src/util/log.js.map +1 -0
  342. package/build/module/src/util/other.d.ts +1 -0
  343. package/build/module/src/util/other.js +4 -0
  344. package/build/module/src/util/other.js.map +1 -0
  345. package/build/module/src/util/stream.d.ts +10 -0
  346. package/build/module/src/util/stream.js +28 -0
  347. package/build/module/src/util/stream.js.map +1 -0
  348. package/build/module/src/util/transform.d.ts +8 -0
  349. package/build/module/src/util/transform.js +57 -0
  350. package/build/module/src/util/transform.js.map +1 -0
  351. package/package.json +111 -0
package/README.md ADDED
@@ -0,0 +1,547 @@
1
+ # Ax - Build LLMs Powered Agents (Typescript)
2
+
3
+ JS/TS library to make to easy to build with agents and agentic workflows with LLMs. Full support for various LLMs and VectorDBs, Function Calling, Chain-of-Thought, RAG, Semantic Router and more. Based on the popular Stanford DSP paper. Build agents or teams of agents to solve complex problems.
4
+
5
+ [![NPM Package](https://img.shields.io/npm/v/ax?style=for-the-badge&color=green)](https://www.npmjs.com/package/@ax-llm/ax)
6
+ [![Twitter](https://img.shields.io/twitter/follow/dosco?style=for-the-badge&color=red)](https://twitter.com/dosco)
7
+ [![Discord Chat](https://dcbadge.vercel.app/api/server/DSHg3dU7dW?style=for-the-badge)](https://discord.gg/DSHg3dU7dW)
8
+
9
+ ![llama-small](https://github.com/dosco/llm-client/assets/832235/b959fdd6-c723-49b1-9fb9-bf879e75c147)
10
+
11
+ ## Build with prompt signatures
12
+
13
+ Ax is an easy to use library built around "Prompt Signatures" from the `Stanford DSP` paper. This library will automatically generate efficient and typed prompts from prompt signatures like `question:string -> answer:string`.
14
+
15
+ Build powerful workflows using components like RAG, ReAcT, Chain of Thought, Function calling, Agents, etc all built on prompt signatures and easy to compose together to build whatever you want. Using prompt signatures automatically gives you the ability to fine tune your prompt programs using optimizers. Tune with a larger model and have your program run efficiently on a smaller model. The tuning here is not the traditional model tuning but what we call prompt tuning.
16
+
17
+ ## Why use Ax?
18
+
19
+ - Support for various LLMs and Vector DBs
20
+ - Prompts auto-generated from simple signatures
21
+ - Multi-Hop RAG, ReAcT, CoT, Function Calling and more
22
+ - Build Agents that can call other agents
23
+ - Convert docs of any format to text
24
+ - RAG, smart chunking, embedding, querying
25
+ - Output field processing, validation while streaming
26
+ - Automatic prompt tuning using optimizers
27
+ - OpenTelemetry tracing / observability
28
+ - Production ready Typescript code
29
+ - Lite weight, zero-dependencies
30
+
31
+ ## Whats a prompt signature?
32
+
33
+ <img width="860" alt="shapes at 24-03-31 00 05 55" src="https://github.com/dosco/llm-client/assets/832235/0f0306ea-1812-4a0a-9ed5-76cd908cd26b">
34
+
35
+ Efficient type-safe prompts are auto-generated from a simple signature. A prompt signature is made of a `"task description" inputField:type "field description" -> outputField:type"`. The idea behind prompt signatures is based off work done in the "Demonstrate-Search-Predict" paper.
36
+
37
+ You can have multiple input and output fields and each field has one of these types `string`, `number`, `boolean`, `json` or a array of any of these eg. `string[]`. When a type is not defined it defaults to `string`. When the `json` type if used the underlying AI is encouraged to generate correct JSON.
38
+
39
+ ## LLMs Supported
40
+
41
+ | Provider | Best Models | Tested |
42
+ | ------------- | ----------------------- | ------- |
43
+ | OpenAI | GPT: 4o, 4T, 4, 3.5 | 🟢 100% |
44
+ | Azure OpenAI | GPT: 4, 4T, 3.5 | 🟢 100% |
45
+ | Together | Several OSS Models | 🟢 100% |
46
+ | Cohere | CommandR, Command | 🟢 100% |
47
+ | Anthropic | Claude 2, Claude 3 | 🟢 100% |
48
+ | Mistral | 7B, 8x7B, S, M & L | 🟢 100% |
49
+ | Groq | Lama2-70B, Mixtral-8x7b | 🟢 100% |
50
+ | DeepSeek | Chat and Code | 🟢 100% |
51
+ | Ollama | All models | 🟢 100% |
52
+ | Google Gemini | Gemini: Flash, Pro | 🟢 100% |
53
+ | Hugging Face | OSS Model | 🟡 50% |
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ npm install @ax-llm/ax
59
+ # or
60
+ yarn add @ax-llm/ax
61
+ ```
62
+
63
+ ## Example: Using chain-of-thought to summarize text
64
+
65
+ ```typescript
66
+ import { AI, ChainOfThought, OpenAIArgs } from '@ax-llm/ax';
67
+
68
+ const textToSummarize = `
69
+ The technological singularity—or simply the singularity[1]—is a hypothetical future point in time at which technological growth becomes uncontrollable and irreversible, resulting in unforeseeable changes to human civilization.[2][3] ...`;
70
+
71
+ const ai = AI('openai', { apiKey: process.env.OPENAI_APIKEY } as OpenAIArgs);
72
+ const gen = new ChainOfThought(
73
+ ai,
74
+ `textToSummarize -> shortSummary "summarize in 5 to 10 words"`
75
+ );
76
+ const res = await gen.forward({ textToSummarize });
77
+
78
+ console.log('>', res);
79
+ ```
80
+
81
+ ## Example: Building an agent
82
+
83
+ Use the agent prompt (framework) to build agents that work with other agents to complete tasks. Agents are easy to build with prompt signatures. Try out the agent example.
84
+
85
+ ```typescript
86
+ # npm run tsx ./src/examples/agent.ts
87
+
88
+ const researcher = new Agent(ai, {
89
+ name: 'researcher',
90
+ description: 'Researcher agent',
91
+ signature: `physicsQuestion "physics questions" -> answer "reply in bullet points"`
92
+ });
93
+
94
+ const summarizer = new Agent(ai, {
95
+ name: 'summarizer',
96
+ description: 'Summarizer agent',
97
+ signature: `text "text so summarize" -> shortSummary "summarize in 5 to 10 words"`
98
+ });
99
+
100
+ const agent = new Agent(ai, {
101
+ name: 'agent',
102
+ description: 'A an agent to research complex topics',
103
+ signature: `question -> answer`,
104
+ agents: [researcher, summarizer]
105
+ });
106
+
107
+ agent.forward({ questions: "How many atoms are there in the universe" })
108
+ ```
109
+
110
+ ## Fast LLM Router
111
+
112
+ A special router that uses no LLM calls only embeddings to route user requests smartly.
113
+
114
+ Use the Router to efficiently route user queries to specific routes designed to handle certain types of questions or tasks. Each route is tailored to a particular domain or service area. Instead of using a slow or expensive LLM to decide how input from the user should be handled use our fast "Semantic Router" that uses inexpensive and fast embedding queries.
115
+
116
+ ```typescript
117
+ # npm run tsx ./src/examples/routing.ts
118
+
119
+ const customerSupport = new Route('customerSupport', [
120
+ 'how can I return a product?',
121
+ 'where is my order?',
122
+ 'can you help me with a refund?',
123
+ 'I need to update my shipping address',
124
+ 'my product arrived damaged, what should I do?'
125
+ ]);
126
+
127
+ const technicalSupport = new Route('technicalSupport', [
128
+ 'how do I install your software?',
129
+ 'I’m having trouble logging in',
130
+ 'can you help me configure my settings?',
131
+ 'my application keeps crashing',
132
+ 'how do I update to the latest version?'
133
+ ]);
134
+
135
+ const ai = AI('openai', { apiKey: process.env.OPENAI_APIKEY } as OpenAIArgs);
136
+
137
+ const router = new Router(ai);
138
+ await router.setRoutes(
139
+ [customerSupport, technicalSupport],
140
+ { filename: 'router.json' }
141
+ );
142
+
143
+ const tag = await router.forward('I need help with my order');
144
+
145
+ if (tag === "customerSupport") {
146
+ ...
147
+ }
148
+ if (tag === "technicalSupport") {
149
+ ...
150
+ }
151
+ ```
152
+
153
+ ## Vector DBs Supported
154
+
155
+ Vector databases are critical to building LLM workflows. We have clean abstractions over popular vector db's as well as our own quick in memory vector database.
156
+
157
+ | Provider | Tested |
158
+ | ---------- | ------- |
159
+ | In Memory | 🟢 100% |
160
+ | Weaviate | 🟢 100% |
161
+ | Cloudflare | 🟡 50% |
162
+ | Pinecone | 🟡 50% |
163
+
164
+ ```typescript
165
+ // Create embeddings from text using an LLM
166
+ const ret = await this.ai.embed({ texts: 'hello world' });
167
+
168
+ // Create an in memory vector db
169
+ const db = new DB('memory');
170
+
171
+ // Insert into vector db
172
+ await this.db.upsert({
173
+ id: 'abc',
174
+ table: 'products',
175
+ values: ret.embeddings[0]
176
+ });
177
+
178
+ // Query for similar entries using embeddings
179
+ const matches = await this.db.query({
180
+ table: 'products',
181
+ values: embeddings[0]
182
+ });
183
+ ```
184
+
185
+ Alternatively you can use the `DBManager` which handles smart chunking, embedding and querying everything
186
+ for you, it makes things almost too easy.
187
+
188
+ ```typescript
189
+ const manager = new DBManager({ ai, db });
190
+ await manager.insert(text);
191
+
192
+ const matches = await manager.query(
193
+ 'John von Neumann on human intelligence and singularity.'
194
+ );
195
+ console.log(matches);
196
+ ```
197
+
198
+ ## RAG Documents
199
+
200
+ Using documents like PDF, DOCX, PPT, XLS, etc with LLMs is a huge pain. We make it easy with the help of Apache Tika an open source document processing engine.
201
+
202
+ Launch Apache Tika
203
+
204
+ ```shell
205
+ docker run -p 9998:9998 apache/tika
206
+ ```
207
+
208
+ Convert documents to text and embed them for retrieval using the `DBManager` it also supports a reranker and query rewriter. Two default implementations `DefaultResultReranker` and `DefaultQueryRewriter` are available to use.
209
+
210
+ ```typescript
211
+ const tika = new ApacheTika();
212
+ const text = await tika.convert('/path/to/document.pdf');
213
+
214
+ const manager = new DBManager({ ai, db });
215
+ await manager.insert(text);
216
+
217
+ const matches = await manager.query('Find some text');
218
+ console.log(matches);
219
+ ```
220
+
221
+ ## Streaming
222
+
223
+ We support parsing output fields and function execution while streaming. This allows for fail-fast and error correction without having to wait for the whole output saving tokens, cost and reducing latency. Assertions are a powerful way to ensure the output matches your requirements these work with streaming as well.
224
+
225
+ ```typescript
226
+ // setup the prompt program
227
+ const gen = new ChainOfThought(
228
+ ai,
229
+ `startNumber:number -> next10Numbers:number[]`
230
+ );
231
+
232
+ // add a assertion to ensure that the number 5 is not in an output field
233
+ gen.addAssert(({ next10Numbers }: Readonly<{ next10Numbers: number[] }>) => {
234
+ return next10Numbers ? !next10Numbers.includes(5) : undefined;
235
+ }, 'Numbers 5 is not allowed');
236
+
237
+ // run the program with streaming enabled
238
+ const res = await gen.forward({ startNumber: 1 }, { stream: true });
239
+ ```
240
+
241
+ The above example will allow you to validate entire output fields as they are streamed in. This validation works with streaming and when not streaming and is triggered when the entire field value is available. For true validation while streaming checkout the below example. This will massively improve performance and save tokens at scale in production
242
+
243
+ ```typescript
244
+ // add a assertion to ensure all lines start with a number and a dot.
245
+ gen.addStreamingAssert(
246
+ 'answerInPoints',
247
+ (value: string) => {
248
+ const re = /^\d+\./;
249
+
250
+ // split the value by lines, trim each line,
251
+ // filter out empty lines and check if all lines match the regex
252
+ return value
253
+ .split('\n')
254
+ .map((x) => x.trim())
255
+ .filter((x) => x.length > 0)
256
+ .every((x) => re.test(x));
257
+ },
258
+ 'Lines must start with a number and a dot. Eg: 1. This is a line.'
259
+ );
260
+
261
+ // run the program with streaming enabled
262
+ const res = await gen.forward(
263
+ {
264
+ question: 'Provide a list of optimizations to speedup LLM inference.'
265
+ },
266
+ { stream: true, debug: true }
267
+ );
268
+ ```
269
+
270
+ ## OpenTelemetry support
271
+
272
+ Ability to trace and observe your llm workflow is critical to building production workflows. OpenTelemetry is an industry standard and we support the new `gen_ai` attribute namespace.
273
+
274
+ ```typescript
275
+ import { trace } from '@opentelemetry/api';
276
+ import {
277
+ BasicTracerProvider,
278
+ ConsoleSpanExporter,
279
+ SimpleSpanProcessor
280
+ } from '@opentelemetry/sdk-trace-base';
281
+
282
+ const provider = new BasicTracerProvider();
283
+ provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
284
+ trace.setGlobalTracerProvider(provider);
285
+
286
+ const tracer = trace.getTracer('test');
287
+
288
+ const ai = AI('ollama', {
289
+ model: 'nous-hermes2',
290
+ options: { tracer }
291
+ } as unknown as OllamaArgs);
292
+
293
+ const gen = new ChainOfThought(
294
+ ai,
295
+ `text -> shortSummary "summarize in 5 to 10 words"`
296
+ );
297
+
298
+ const res = await gen.forward({ text });
299
+ ```
300
+
301
+ ```json
302
+ {
303
+ "traceId": "ddc7405e9848c8c884e53b823e120845",
304
+ "name": "Chat Request",
305
+ "id": "d376daad21da7a3c",
306
+ "kind": "SERVER",
307
+ "timestamp": 1716622997025000,
308
+ "duration": 14190456.542,
309
+ "attributes": {
310
+ "gen_ai.system": "Ollama",
311
+ "gen_ai.request.model": "nous-hermes2",
312
+ "gen_ai.request.max_tokens": 500,
313
+ "gen_ai.request.temperature": 0.1,
314
+ "gen_ai.request.top_p": 0.9,
315
+ "gen_ai.request.frequency_penalty": 0.5,
316
+ "gen_ai.request.llm_is_streaming": false,
317
+ "http.request.method": "POST",
318
+ "url.full": "http://localhost:11434/v1/chat/completions",
319
+ "gen_ai.usage.completion_tokens": 160,
320
+ "gen_ai.usage.prompt_tokens": 290
321
+ }
322
+ }
323
+ ```
324
+
325
+ Alternatively you can use the `DBManager` which handles smart chunking, embedding and querying everything
326
+ for you, it makes things almost too easy.
327
+
328
+ ```typescript
329
+ const manager = new DBManager({ ai, db });
330
+ await manager.insert(text);
331
+
332
+ const matches = await manager.query(
333
+ 'John von Neumann on human intelligence and singularity.'
334
+ );
335
+ console.log(matches);
336
+ ```
337
+
338
+ ## Tuning the prompts (programs)
339
+
340
+ You can tune your prompts using a larger model to help them run more efficiently and give you better results. This is done by using an optimizer like `BootstrapFewShot` with and examples from the popular `HotPotQA` dataset. The optimizer generates demonstrations `demos` which when used with the prompt help improve its efficiency.
341
+
342
+ ```typescript
343
+ // Download the HotPotQA dataset from huggingface
344
+ const hf = new HFDataLoader();
345
+ const examples = await hf.getData<{ question: string; answer: string }>({
346
+ dataset: 'hotpot_qa',
347
+ split: 'train',
348
+ count: 100,
349
+ fields: ['question', 'answer']
350
+ });
351
+
352
+ const ai = AI('openai', { apiKey: process.env.OPENAI_APIKEY } as OpenAIArgs);
353
+
354
+ // Setup the program to tune
355
+ const program = new ChainOfThought<{ question: string }, { answer: string }>(
356
+ ai,
357
+ `question -> answer "in short 2 or 3 words"`
358
+ );
359
+
360
+ // Setup a Bootstrap Few Shot optimizer to tune the above program
361
+ const optimize = new BootstrapFewShot<{ question: string }, { answer: string }>(
362
+ {
363
+ program,
364
+ examples
365
+ }
366
+ );
367
+
368
+ // Setup a evaluation metric em, f1 scores are a popular way measure retrieval performance.
369
+ const metricFn: MetricFn = ({ prediction, example }) =>
370
+ emScore(prediction.answer as string, example.answer as string);
371
+
372
+ // Run the optimizer and save the result
373
+ await optimize.compile(metricFn, { filename: 'demos.json' });
374
+ ```
375
+
376
+ <img width="853" alt="tune-prompt" src="https://github.com/dosco/llm-client/assets/832235/f924baa7-8922-424c-9c2c-f8b2018d8d74">
377
+
378
+ And to use the generated demos with the above `ChainOfThought` program
379
+
380
+ ```typescript
381
+ const ai = AI('openai', { apiKey: process.env.OPENAI_APIKEY } as OpenAIArgs);
382
+
383
+ // Setup the program to use the tuned data
384
+ const program = new ChainOfThought<{ question: string }, { answer: string }>(
385
+ ai,
386
+ `question -> answer "in short 2 or 3 words"`
387
+ );
388
+
389
+ // load tuning data
390
+ program.loadDemos('demos.json');
391
+
392
+ const res = await program.forward({
393
+ question: 'What castle did David Gregory inherit?'
394
+ });
395
+
396
+ console.log(res);
397
+ ```
398
+
399
+ ## Checkout all the examples
400
+
401
+ Use the `tsx` command to run the examples it makes node run typescript code. It also support using a `.env` file to pass the AI API Keys as opposed to putting them in the commandline.
402
+
403
+ ```shell
404
+ OPENAI_APIKEY=openai_key npm run tsx ./src/examples/marketing.ts
405
+ ```
406
+
407
+ | Example | Description |
408
+ | ------------------- | ------------------------------------------------------- |
409
+ | customer-support.ts | Extract valuable details from customer communications |
410
+ | food-search.ts | Use multiple APIs are used to find dinning options |
411
+ | marketing.ts | Generate short effective marketing sms messages |
412
+ | vectordb.ts | Chunk, embed and search text |
413
+ | fibonacci.ts | Use the JS code interpreter to compute fibonacci |
414
+ | summarize.ts | Generate a short summary of a large block of text |
415
+ | chain-of-thought.ts | Use chain-of-thought prompting to answer questions |
416
+ | rag.ts | Use multi-hop retrieval to answer questions |
417
+ | rag-docs.ts | Convert PDF to text and embed for rag search |
418
+ | react.ts | Use function calling and reasoning to answer questions |
419
+ | agent.ts | Agent framework, agents can use other agents, tools etc |
420
+ | qna-tune.ts | Use an optimizer to improve prompt efficiency |
421
+ | qna-use-tuned.ts | Use the optimized tuned prompts |
422
+ | streaming1.ts | Output fields validation while streaming |
423
+ | streaming2.ts | Per output field validation while streaming |
424
+
425
+ ## Built-in Functions
426
+
427
+ | Function | Description |
428
+ | ------------------ | ------------------------------------------------------ |
429
+ | Code Interpreter | Used by the LLM to execute JS code in a sandboxed env. |
430
+ | Embeddings Adapter | Wrapper to fetch and pass embedding to your function |
431
+
432
+ ## Our Goal
433
+
434
+ Large language models (LLMs) are getting really powerful and have reached a point where they can work as the backend for your entire product. However there's still a lot of complexity to manage from using the right prompts, models, streaming, function calling, error-correction, and much more. Our goal is to package all this complexity into a well maintained easy to use library that can work with all the LLMs out there. Additionally we are using the latest research to add useful new capabilities like DSP to the library.
435
+
436
+ ## How to use this library?
437
+
438
+ ### 1. Pick an AI to work with
439
+
440
+ ```ts
441
+ // Pick a LLM
442
+ const ai = new OpenAI({ apiKey: process.env.OPENAI_APIKEY } as OpenAIArgs);
443
+ ```
444
+
445
+ ### 2. Create a prompt signature based on your usecase
446
+
447
+ ```ts
448
+ // Signature defines the inputs and outputs of your prompt program
449
+ const cot = new ChainOfThought(ai, `question:string -> answer:string`, { mem });
450
+ ```
451
+
452
+ ### 3. Execute this new prompt program
453
+
454
+ ```ts
455
+ // Pass in the input fields defined in the above signature
456
+ const res = await cot.forward({ question: 'Are we in a simulation?' });
457
+ ```
458
+
459
+ ### 4. Or if you just want to directly use the LLM
460
+
461
+ ```ts
462
+ const res = await ai.chat([
463
+ { role: "system", content: "Help the customer with his questions" }
464
+ { role: "user", content: "I'm looking for a Macbook Pro M2 With 96GB RAM?" }
465
+ ]);
466
+ ```
467
+
468
+ ## How do you use function calling
469
+
470
+ ### 1. Define the functions
471
+
472
+ ```ts
473
+ // define one or more functions and a function handler
474
+ const functions = [
475
+ {
476
+ name: 'getCurrentWeather',
477
+ description: 'get the current weather for a location',
478
+ parameters: {
479
+ type: 'object',
480
+ properties: {
481
+ location: {
482
+ type: 'string',
483
+ description: 'location to get weather for'
484
+ },
485
+ units: {
486
+ type: 'string',
487
+ enum: ['imperial', 'metric'],
488
+ default: 'imperial',
489
+ description: 'units to use'
490
+ }
491
+ },
492
+ required: ['location']
493
+ },
494
+ func: async (args: Readonly<{ location: string; units: string }>) => {
495
+ return `The weather in ${args.location} is 72 degrees`;
496
+ }
497
+ }
498
+ ];
499
+ ```
500
+
501
+ ### 2. Pass the functions to a prompt
502
+
503
+ ```ts
504
+ const cot = new ReAct(ai, `question:string -> answer:string`, { functions });
505
+ ```
506
+
507
+ ## Enable debug logs
508
+
509
+ ```ts
510
+ const ai = new OpenAI({ apiKey: process.env.OPENAI_APIKEY } as OpenAIArgs);
511
+ ai.setOptions({ debug: true });
512
+ ```
513
+
514
+ ## Reach out
515
+
516
+ We're happy to help reach out if you have questions or join the Discord
517
+ [twitter/dosco](https://twitter.com/dosco)
518
+
519
+ ## FAQ
520
+
521
+ ### 1. The LLM can't find the right function to use
522
+
523
+ Improve the function naming and description be very clear on what the function does. Also ensure the function parameter's also have good descriptions. The descriptions don't have to be very long but need to be clear.
524
+
525
+ ### 2. How do I change the configuration of the LLM used
526
+
527
+ You can pass a configuration object as the second parameter when creating a new LLM object
528
+
529
+ ```ts
530
+ const apiKey = process.env.OPENAI_APIKEY;
531
+ const conf = OpenAIBestConfig();
532
+ const ai = new OpenAI({ apiKey, conf } as OpenAIArgs);
533
+ ```
534
+
535
+ ## 3. My prompt is too long and can I change the max tokens
536
+
537
+ ```ts
538
+ const conf = OpenAIDefaultConfig(); // or OpenAIBestOptions()
539
+ conf.maxTokens = 2000;
540
+ ```
541
+
542
+ ## 4. How do I change the model say I want to use GPT4
543
+
544
+ ```ts
545
+ const conf = OpenAIDefaultConfig(); // or OpenAIBestOptions()
546
+ conf.model = OpenAIModel.GPT4Turbo;
547
+ ```
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ (function (svg) {
2
+ svg.innerHTML = `<g id="icon-1"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-2"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g><g id="icon-16"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-32"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)"></path></g><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g><g id="icon-512"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-4096"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-8192"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-16384"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-32768"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-65536"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-131072"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-262144"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-524288"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-1048576"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="#FF4D82" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z" fill="var(--color-text)"></path></g><g id="icon-chevronDown"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></g><g id="icon-chevronSmall"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></g><g id="icon-checkbox"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></g><g id="icon-menu"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></g><g id="icon-search"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></g><g id="icon-anchor"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g>`;
3
+ svg.style.display = 'none';
4
+ if (location.protocol === 'file:') {
5
+ if (document.readyState === 'loading')
6
+ document.addEventListener('DOMContentLoaded', updateUseElements);
7
+ else
8
+ updateUseElements();
9
+ function updateUseElements() {
10
+ document.querySelectorAll('use').forEach(el => {
11
+ if (el.getAttribute('href').includes('#icon-')) {
12
+ el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#'));
13
+ }
14
+ });
15
+ }
16
+ }
17
+ })(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg')));
18
+ export {};
19
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../../docs/assets/icons.js"],"names":[],"mappings":"AAAA,CAAC,UAAS,GAAG;IACT,GAAG,CAAC,SAAS,GAAG,wkcAAwkc,CAAC;IACzlc,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAC3B,IAAI,QAAQ,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAChC,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS;YAAE,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;;YACnG,iBAAiB,EAAE,CAAA;QACxB,SAAS,iBAAiB;YACtB,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;gBAC1C,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC7C,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;gBACzE,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export {};