@futdevpro/nts-dynamo 1.10.77 → 1.11.2

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 (316) hide show
  1. package/build/_collections/atlas-default-db-options.const.d.ts +28 -0
  2. package/build/_collections/atlas-default-db-options.const.d.ts.map +1 -0
  3. package/build/_collections/atlas-default-db-options.const.js +10 -0
  4. package/build/_collections/atlas-default-db-options.const.js.map +1 -0
  5. package/build/_collections/get-environment-settings.util.d.ts +3 -0
  6. package/build/_collections/get-environment-settings.util.d.ts.map +1 -0
  7. package/build/_collections/get-environment-settings.util.js +45 -0
  8. package/build/_collections/get-environment-settings.util.js.map +1 -0
  9. package/build/_collections/global-settings.const.d.ts.map +1 -1
  10. package/build/_collections/global-settings.const.js +9 -4
  11. package/build/_collections/global-settings.const.js.map +1 -1
  12. package/build/_models/control-models/app-params.control-model.d.ts +6 -0
  13. package/build/_models/control-models/app-params.control-model.d.ts.map +1 -1
  14. package/build/_models/control-models/app-params.control-model.js +29 -2
  15. package/build/_models/control-models/app-params.control-model.js.map +1 -1
  16. package/build/_models/control-models/app-params.control-model.spec.js +5 -4
  17. package/build/_models/control-models/app-params.control-model.spec.js.map +1 -1
  18. package/build/_models/control-models/endpoint-params.control-model.js +1 -1
  19. package/build/_models/control-models/endpoint-params.control-model.js.map +1 -1
  20. package/build/_models/interfaces/environment-settings.interface.d.ts +35 -0
  21. package/build/_models/interfaces/environment-settings.interface.d.ts.map +1 -0
  22. package/build/_models/interfaces/environment-settings.interface.js +3 -0
  23. package/build/_models/interfaces/environment-settings.interface.js.map +1 -0
  24. package/build/_models/interfaces/global-settings.interface.d.ts +34 -2
  25. package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
  26. package/build/_modules/custom-data/index.d.ts.map +1 -1
  27. package/build/_modules/custom-data/index.js +1 -0
  28. package/build/_modules/custom-data/index.js.map +1 -1
  29. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.d.ts +3 -0
  30. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.d.ts.map +1 -0
  31. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js +17 -0
  32. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js.map +1 -0
  33. package/build/_modules/discord-assistant/_collections/dias.util.d.ts +6 -0
  34. package/build/_modules/discord-assistant/_collections/dias.util.d.ts.map +1 -0
  35. package/build/_modules/discord-assistant/_collections/dias.util.js +36 -0
  36. package/build/_modules/discord-assistant/_collections/dias.util.js.map +1 -0
  37. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.d.ts +18 -0
  38. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.d.ts.map +1 -0
  39. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.js +3 -0
  40. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.js.map +1 -0
  41. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.d.ts +10 -0
  42. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.d.ts.map +1 -0
  43. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.js +41 -0
  44. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.js.map +1 -0
  45. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +14 -0
  46. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -0
  47. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +88 -0
  48. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -0
  49. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts +10 -0
  50. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts.map +1 -0
  51. package/build/_modules/discord-assistant/_services/dias-io.control-service.js +40 -0
  52. package/build/_modules/discord-assistant/_services/dias-io.control-service.js.map +1 -0
  53. package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts +8 -0
  54. package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts.map +1 -0
  55. package/build/_modules/discord-assistant/_services/dias-main.control-service.js +23 -0
  56. package/build/_modules/discord-assistant/_services/dias-main.control-service.js.map +1 -0
  57. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts +11 -0
  58. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts.map +1 -0
  59. package/build/_modules/discord-assistant/_services/dias.service-base.js +33 -0
  60. package/build/_modules/discord-assistant/_services/dias.service-base.js.map +1 -0
  61. package/build/_modules/discord-assistant/index.d.ts +10 -0
  62. package/build/_modules/discord-assistant/index.d.ts.map +1 -0
  63. package/build/_modules/discord-assistant/index.js +23 -0
  64. package/build/_modules/discord-assistant/index.js.map +1 -0
  65. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.d.ts +4 -0
  66. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.d.ts.map +1 -0
  67. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.js +8 -0
  68. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.js.map +1 -0
  69. package/build/_modules/discord-assistant-voiced/index.d.ts +3 -0
  70. package/build/_modules/discord-assistant-voiced/index.d.ts.map +1 -0
  71. package/build/_modules/discord-assistant-voiced/index.js +26 -0
  72. package/build/_modules/discord-assistant-voiced/index.js.map +1 -0
  73. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.d.ts +3 -0
  74. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.d.ts.map +1 -0
  75. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.js +13 -0
  76. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.js.map +1 -0
  77. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts +3 -0
  78. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts.map +1 -0
  79. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.js +44 -0
  80. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.js.map +1 -0
  81. package/build/_modules/discord-bot/_collections/dibo-operations.util.d.ts +22 -0
  82. package/build/_modules/discord-bot/_collections/dibo-operations.util.d.ts.map +1 -0
  83. package/build/_modules/discord-bot/_collections/dibo-operations.util.js +261 -0
  84. package/build/_modules/discord-bot/_collections/dibo-operations.util.js.map +1 -0
  85. package/build/_modules/discord-bot/_models/dibo-command.interface.d.ts +8 -0
  86. package/build/_modules/discord-bot/_models/dibo-command.interface.d.ts.map +1 -0
  87. package/build/_modules/discord-bot/_models/dibo-command.interface.js +3 -0
  88. package/build/_modules/discord-bot/_models/dibo-command.interface.js.map +1 -0
  89. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.d.ts +7 -0
  90. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.d.ts.map +1 -0
  91. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.js +3 -0
  92. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.js.map +1 -0
  93. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.d.ts +6 -0
  94. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.d.ts.map +1 -0
  95. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.js +3 -0
  96. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.js.map +1 -0
  97. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.d.ts +88 -0
  98. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.d.ts.map +1 -0
  99. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.js +3 -0
  100. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.js.map +1 -0
  101. package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts +12 -0
  102. package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts.map +1 -0
  103. package/build/_modules/discord-bot/_services/dibo-commands.control-service.js +72 -0
  104. package/build/_modules/discord-bot/_services/dibo-commands.control-service.js.map +1 -0
  105. package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts +19 -0
  106. package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts.map +1 -0
  107. package/build/_modules/discord-bot/_services/dibo-io.control-service.js +176 -0
  108. package/build/_modules/discord-bot/_services/dibo-io.control-service.js.map +1 -0
  109. package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts +85 -0
  110. package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts.map +1 -0
  111. package/build/_modules/discord-bot/_services/dibo-main.control-service.js +228 -0
  112. package/build/_modules/discord-bot/_services/dibo-main.control-service.js.map +1 -0
  113. package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts +13 -0
  114. package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts.map +1 -0
  115. package/build/_modules/discord-bot/_services/dibo-routines.control-service.js +38 -0
  116. package/build/_modules/discord-bot/_services/dibo-routines.control-service.js.map +1 -0
  117. package/build/_modules/discord-bot/index.d.ts +12 -0
  118. package/build/_modules/discord-bot/index.d.ts.map +1 -0
  119. package/build/_modules/discord-bot/index.js +30 -0
  120. package/build/_modules/discord-bot/index.js.map +1 -0
  121. package/build/_modules/oauth2/index.d.ts.map +1 -1
  122. package/build/_modules/oauth2/index.js +7 -0
  123. package/build/_modules/oauth2/index.js.map +1 -1
  124. package/build/_modules/open-ai/_collections/oai-chunking.util.d.ts +74 -0
  125. package/build/_modules/open-ai/_collections/oai-chunking.util.d.ts.map +1 -0
  126. package/build/_modules/open-ai/_collections/oai-chunking.util.js +385 -0
  127. package/build/_modules/open-ai/_collections/oai-chunking.util.js.map +1 -0
  128. package/build/_modules/open-ai/_collections/oai-document.util.d.ts +4 -0
  129. package/build/_modules/open-ai/_collections/oai-document.util.d.ts.map +1 -0
  130. package/build/_modules/open-ai/_collections/oai-document.util.js +12 -0
  131. package/build/_modules/open-ai/_collections/oai-document.util.js.map +1 -0
  132. package/build/_modules/open-ai/_collections/oai-global-settings.const.d.ts +3 -0
  133. package/build/_modules/open-ai/_collections/oai-global-settings.const.d.ts.map +1 -0
  134. package/build/_modules/open-ai/_collections/oai-global-settings.const.js +9 -0
  135. package/build/_modules/open-ai/_collections/oai-global-settings.const.js.map +1 -0
  136. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts +3 -0
  137. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts.map +1 -0
  138. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js +75 -0
  139. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js.map +1 -0
  140. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts +3 -0
  141. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts.map +1 -0
  142. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js +68 -0
  143. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js.map +1 -0
  144. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts +6 -0
  145. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts.map +1 -0
  146. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js +10 -0
  147. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js.map +1 -0
  148. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts +18 -0
  149. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts.map +1 -0
  150. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.js +40 -0
  151. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.js.map +1 -0
  152. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts +7 -0
  153. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts.map +1 -0
  154. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.js +3 -0
  155. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.js.map +1 -0
  156. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts +15 -0
  157. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts.map +1 -0
  158. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.js +3 -0
  159. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.js.map +1 -0
  160. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts +6 -0
  161. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts.map +1 -0
  162. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js +3 -0
  163. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js.map +1 -0
  164. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts +6 -0
  165. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts.map +1 -0
  166. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js +3 -0
  167. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js.map +1 -0
  168. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts +52 -0
  169. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts.map +1 -0
  170. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js +3 -0
  171. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js.map +1 -0
  172. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts +13 -0
  173. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts.map +1 -0
  174. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js +3 -0
  175. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js.map +1 -0
  176. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.d.ts +18 -0
  177. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.d.ts.map +1 -0
  178. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js +80 -0
  179. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js.map +1 -0
  180. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts +13 -0
  181. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts.map +1 -0
  182. package/build/_modules/open-ai/_services/oai-chunk.service-base.js +170 -0
  183. package/build/_modules/open-ai/_services/oai-chunk.service-base.js.map +1 -0
  184. package/build/_modules/open-ai/_services/{embedding.control-service.d.ts → oai-embedding.control-service.d.ts} +3 -3
  185. package/build/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +1 -0
  186. package/build/_modules/open-ai/_services/{embedding.control-service.js → oai-embedding.control-service.js} +5 -5
  187. package/build/_modules/open-ai/_services/oai-embedding.control-service.js.map +1 -0
  188. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +181 -0
  189. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -0
  190. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js +344 -0
  191. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -0
  192. package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts +234 -0
  193. package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -0
  194. package/build/_modules/open-ai/_services/oai-llm.service-base.js +441 -0
  195. package/build/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -0
  196. package/build/_modules/open-ai/_services/{vector-data.service.d.ts → oai-vector-data.service.d.ts} +4 -4
  197. package/build/_modules/open-ai/_services/oai-vector-data.service.d.ts.map +1 -0
  198. package/build/_modules/open-ai/_services/{vector-data.service.js → oai-vector-data.service.js} +27 -7
  199. package/build/_modules/open-ai/_services/oai-vector-data.service.js.map +1 -0
  200. package/build/_modules/open-ai/index.d.ts +19 -4
  201. package/build/_modules/open-ai/index.d.ts.map +1 -1
  202. package/build/_modules/open-ai/index.js +36 -4
  203. package/build/_modules/open-ai/index.js.map +1 -1
  204. package/build/_modules/server/index.d.ts +1 -1
  205. package/build/_modules/server/index.d.ts.map +1 -1
  206. package/build/_modules/server/index.js +16 -2
  207. package/build/_modules/server/index.js.map +1 -1
  208. package/build/_modules/server/server-status/server-status.controller.d.ts.map +1 -1
  209. package/build/_modules/server/server-status/server-status.controller.js +10 -0
  210. package/build/_modules/server/server-status/server-status.controller.js.map +1 -1
  211. package/build/_modules/socket/index.d.ts.map +1 -1
  212. package/build/_modules/socket/index.js +18 -0
  213. package/build/_modules/socket/index.js.map +1 -1
  214. package/build/_modules/test/index.d.ts.map +1 -1
  215. package/build/_modules/test/index.js +5 -0
  216. package/build/_modules/test/index.js.map +1 -1
  217. package/build/_modules/usage/index.d.ts.map +1 -1
  218. package/build/_modules/usage/index.js +5 -0
  219. package/build/_modules/usage/index.js.map +1 -1
  220. package/build/_services/base/data.service.d.ts +6 -0
  221. package/build/_services/base/data.service.d.ts.map +1 -1
  222. package/build/_services/base/data.service.js +6 -0
  223. package/build/_services/base/data.service.js.map +1 -1
  224. package/build/_services/base/db.service.d.ts +10 -0
  225. package/build/_services/base/db.service.d.ts.map +1 -1
  226. package/build/_services/base/db.service.js +10 -0
  227. package/build/_services/base/db.service.js.map +1 -1
  228. package/build/_services/server/app.server.js +1 -2
  229. package/build/_services/server/app.server.js.map +1 -1
  230. package/build/index.d.ts +3 -1
  231. package/build/index.d.ts.map +1 -1
  232. package/build/index.js +26 -1
  233. package/build/index.js.map +1 -1
  234. package/package.json +40 -10
  235. package/src/_collections/atlas-default-db-options.const.ts +10 -0
  236. package/src/_collections/get-environment-settings.util.ts +49 -0
  237. package/src/_collections/global-settings.const.ts +15 -4
  238. package/src/_collections/sample.env +21 -0
  239. package/src/_models/control-models/app-params.control-model.spec.ts +5 -4
  240. package/src/_models/control-models/app-params.control-model.ts +31 -2
  241. package/src/_models/control-models/endpoint-params.control-model.ts +1 -1
  242. package/src/_models/interfaces/environment-settings.interface.ts +59 -0
  243. package/src/_models/interfaces/global-settings.interface.ts +41 -1
  244. package/src/_modules/custom-data/index.ts +3 -0
  245. package/src/_modules/discord-assistant/_collections/dias-global-settings.const.ts +19 -0
  246. package/src/_modules/discord-assistant/_collections/dias.util.ts +43 -0
  247. package/src/_modules/discord-assistant/_models/dias-global-settings.interface.ts +20 -0
  248. package/src/_modules/discord-assistant/_models/dias-knowledge.data-model.ts +46 -0
  249. package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +152 -0
  250. package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +64 -0
  251. package/src/_modules/discord-assistant/_services/dias-main.control-service.ts +28 -0
  252. package/src/_modules/discord-assistant/_services/dias.service-base.ts +49 -0
  253. package/src/_modules/discord-assistant/index.ts +36 -0
  254. package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.ts +11 -0
  255. package/src/_modules/discord-assistant-voiced/index.ts +36 -0
  256. package/src/_modules/discord-bot/_collections/dibo-default-commands.const.ts +17 -0
  257. package/src/_modules/discord-bot/_collections/dibo-global-settings.conts.ts +56 -0
  258. package/src/_modules/discord-bot/_collections/dibo-operations.util.ts +372 -0
  259. package/src/_modules/discord-bot/_models/dibo-command.interface.ts +12 -0
  260. package/src/_modules/discord-bot/_models/dibo-last-mention-date.inteface.ts +8 -0
  261. package/src/_modules/discord-bot/_models/dibo-last-message-date.interface.ts +6 -0
  262. package/src/_modules/discord-bot/_models/global-bot-log-settings.interface.ts +98 -0
  263. package/src/_modules/discord-bot/_services/dibo-commands.control-service.ts +120 -0
  264. package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +245 -0
  265. package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +304 -0
  266. package/src/_modules/discord-bot/_services/dibo-routines.control-service.ts +60 -0
  267. package/src/_modules/discord-bot/index.ts +36 -0
  268. package/src/_modules/oauth2/index.ts +8 -0
  269. package/src/_modules/open-ai/_collections/oai-chunking.util.ts +496 -0
  270. package/src/_modules/open-ai/_collections/oai-document.util.ts +10 -0
  271. package/src/_modules/open-ai/_collections/oai-global-settings.const.ts +9 -0
  272. package/src/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.ts +83 -0
  273. package/src/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.ts +76 -0
  274. package/src/_modules/open-ai/_enums/oai-compare-result-type.enum.ts +7 -0
  275. package/src/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +45 -0
  276. package/src/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.ts +10 -0
  277. package/src/_modules/open-ai/_models/interfaces/oai-document-page.interface.ts +21 -0
  278. package/src/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +8 -0
  279. package/src/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +7 -0
  280. package/src/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.ts +57 -0
  281. package/src/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.ts +18 -0
  282. package/src/_modules/open-ai/_models/oai-doc-chunk.data-model.ts +92 -0
  283. package/src/_modules/open-ai/_services/oai-chunk.service-base.ts +214 -0
  284. package/src/_modules/open-ai/_services/{embedding.control-service.ts → oai-embedding.control-service.ts} +2 -2
  285. package/src/_modules/open-ai/_services/oai-llm-chat.service-base.ts +621 -0
  286. package/src/_modules/open-ai/_services/oai-llm.service-base.ts +651 -0
  287. package/src/_modules/open-ai/_services/{vector-data.service.ts → oai-vector-data.service.ts} +32 -5
  288. package/src/_modules/open-ai/index.ts +43 -4
  289. package/src/_modules/server/index.ts +18 -2
  290. package/src/_modules/server/server-status/server-status.controller.ts +13 -0
  291. package/src/_modules/socket/index.ts +23 -0
  292. package/src/_modules/test/index.ts +8 -0
  293. package/src/_modules/usage/index.ts +8 -0
  294. package/src/_services/base/data.service.ts +6 -0
  295. package/src/_services/base/db.service.ts +10 -0
  296. package/src/_services/server/app.server.ts +1 -1
  297. package/src/index.ts +28 -1
  298. package/build/_modules/open-ai/_services/embedding.control-service.d.ts.map +0 -1
  299. package/build/_modules/open-ai/_services/embedding.control-service.js.map +0 -1
  300. package/build/_modules/open-ai/_services/gpt.service-base.d.ts +0 -98
  301. package/build/_modules/open-ai/_services/gpt.service-base.d.ts.map +0 -1
  302. package/build/_modules/open-ai/_services/gpt.service-base.js +0 -284
  303. package/build/_modules/open-ai/_services/gpt.service-base.js.map +0 -1
  304. package/build/_modules/open-ai/_services/open-ai.service-base.d.ts +0 -21
  305. package/build/_modules/open-ai/_services/open-ai.service-base.d.ts.map +0 -1
  306. package/build/_modules/open-ai/_services/open-ai.service-base.js +0 -50
  307. package/build/_modules/open-ai/_services/open-ai.service-base.js.map +0 -1
  308. package/build/_modules/open-ai/_services/vector-data.service.d.ts.map +0 -1
  309. package/build/_modules/open-ai/_services/vector-data.service.js.map +0 -1
  310. package/build/_services/server/env-set.d.ts +0 -2
  311. package/build/_services/server/env-set.d.ts.map +0 -1
  312. package/build/_services/server/env-set.js +0 -20
  313. package/build/_services/server/env-set.js.map +0 -1
  314. package/src/_modules/open-ai/_services/gpt.service-base.ts +0 -438
  315. package/src/_modules/open-ai/_services/open-ai.service-base.ts +0 -69
  316. package/src/_services/server/env-set.ts +0 -21
@@ -1,438 +0,0 @@
1
-
2
- import { ChatCompletion, ChatCompletionMessageParam } from 'openai/resources';
3
-
4
- import { DyFM_AnyError, DyFM_Error, DyFM_Error_Settings, DyFM_Log } from '@futdevpro/fsm-dynamo';
5
- import { DyFM_GPTCall_Settings } from '@futdevpro/fsm-dynamo/open-ai';
6
-
7
- import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
8
- import { DyNTS_OpenAI_ServiceBase } from './open-ai.service-base';
9
- import { RequestOptions } from 'openai/core';
10
- import { ChatCompletionCreateParamsBase } from 'openai/resources/chat/completions';
11
-
12
- /**
13
- * {
14
- organization: 'org-XY',
15
- apiKey: 'sk-XY',
16
- project: 'proj_XY',
17
- }
18
- */
19
-
20
- // Di Dictionary DiModel DiEz DiAz
21
-
22
- export class DyNTS_GPT_ServiceBase extends DyNTS_OpenAI_ServiceBase {
23
-
24
- defaultLogReplacer: string = '...';
25
-
26
- async askYesNoQuestion(
27
- question: string,
28
- issuer: string,
29
- replaceThisInLog?: string
30
- ): Promise<boolean> {
31
- question += ' (Only answer with "Yes" or "No")';
32
-
33
- this.logQuestion(question, issuer, replaceThisInLog);
34
-
35
- const answer = await this.getQuestionAnswer(question, issuer);
36
-
37
- return answer.toUpperCase().includes('YES');
38
- }
39
-
40
- async askSimpleQuestion(
41
- question: string,
42
- issuer: string,
43
- replaceThisInLog?: string
44
- ): Promise<string> {
45
- this.logQuestion(question, issuer, replaceThisInLog);
46
-
47
- return await this.getQuestionAnswer(question, issuer);
48
- }
49
-
50
- async askPercentageQuestion(
51
- question: string,
52
- issuer: string,
53
- replaceThisInLog?: string
54
- ): Promise<number> {
55
- question += ' (Only answer with a number between 0 and 1, e.g.: 0.65)';
56
-
57
- this.logQuestion(question, issuer, replaceThisInLog);
58
-
59
- const answer = await this.getQuestionAnswer(question, issuer);
60
-
61
- if (isNaN(+answer)) {
62
- DyFM_Log.error('GPT_ServiceBase', 'asykPercentageQuestion', 'Invalid answer', {
63
- question,
64
- answer,
65
- });
66
-
67
- return null;
68
- }
69
-
70
- return +answer;
71
- }
72
-
73
- async askSelectQuestion(
74
- question: string,
75
- selectFrom: string[],
76
- issuer: string,
77
- replaceThisInLog?: string
78
- ): Promise<string> {
79
- question += ` (Only answer with one of the following: ${this.getListAsText(selectFrom)})`;
80
-
81
- this.logQuestion(question, issuer, replaceThisInLog);
82
-
83
- let answer = await this.getQuestionAnswer(question, issuer);
84
-
85
- answer = answer.toLocaleUpperCase();
86
-
87
- for (const item of selectFrom) {
88
- if (answer.includes(item.toLocaleUpperCase())) return item;
89
- }
90
-
91
- return null;
92
- }
93
-
94
- async askMultipleSelectQuestionWithOptions(
95
- question: string,
96
- options: string[],
97
- issuer: string,
98
- replaceThisInLog?: string
99
- ): Promise<string[]> {
100
- question += (` (You can choose one or more of the following: ${this.getListAsText(options)})`);
101
-
102
- this.logQuestion(question, issuer, replaceThisInLog);
103
-
104
- let answer = await this.getQuestionAnswer(question, issuer);
105
-
106
- answer = answer.toLocaleUpperCase();
107
-
108
- const result: string[] = [];
109
-
110
- for (const item of options) {
111
- if (answer.includes(item.toLocaleUpperCase())) {
112
- result.push(item);
113
- }
114
- }
115
-
116
- return result;
117
- }
118
-
119
- /**
120
- * Azt kérjük tőle, hogy adjon egy JSON formában választ.
121
- * Amit aztán megpróbálunk JSON.parse-olni.
122
- * Ha nem sikerül, akkor { unparsable: answer }-t adunk vissza.
123
- */
124
- async askJSONQuestion(
125
- question: string,
126
- issuer: string,
127
- replaceThisInLog?: string
128
- ): Promise<any> {
129
- question += ' (The answer must be in JSON format)';
130
-
131
- this.logQuestion(question, issuer, replaceThisInLog);
132
-
133
- const answer = await this.getQuestionAnswer(question, issuer);
134
-
135
- try {
136
- // replace all ```json, ```, \n
137
- return JSON.parse(
138
- answer.replaceAll('```json', '').replaceAll('```', '').replaceAll('\n', '')
139
- );
140
- } catch (error) {
141
- return {
142
- unparsable: answer,
143
- };
144
- }
145
- }
146
-
147
- /**
148
- * Azt kérjük tőle, hogy adjon egy JSON formában választ.
149
- * Amit aztán megpróbálunk JSON.parse-olni.
150
- * Ha nem sikerül, akkor { unparsable: answer }-t adunk vissza.
151
- *
152
- * A keysDescription-be leírjuk, milyen kulcsokat várunk. (nem konkrét kulcsneveket)
153
- */
154
- async askJSONQuestionWithKeysDescription(
155
- question: string,
156
- keysDescription: string,
157
- issuer: string,
158
- replaceThisInLog?: string
159
- ): Promise<any> {
160
- question += ` (The answer must be in JSON format, ${keysDescription})`;
161
-
162
- this.logQuestion(question, issuer, replaceThisInLog);
163
-
164
- const answer = await this.getQuestionAnswer(question, issuer);
165
-
166
- try {
167
- // replace all ```json, ```, \n
168
- return JSON.parse(
169
- answer.replaceAll('```json', '').replaceAll('```', '').replaceAll('\n', '')
170
- );
171
- } catch (error) {
172
- return {
173
- unparsable: answer,
174
- };
175
- }
176
- }
177
-
178
- /**
179
- * Azt kérjük tőle, hogy adjon egy JSON formában választ.
180
- * Amit aztán megpróbálunk JSON.parse-olni.
181
- * Ha nem sikerül, akkor { unparsable: answer }-t adunk vissza.
182
- *
183
- * A keys-be leírjuk a konkrét kulcsneveket.
184
- */
185
- async askJSONQuestionWithExactKeys(
186
- question: string,
187
- keys: string[],
188
- issuer: string,
189
- replaceThisInLog?: string
190
- ): Promise<any> {
191
- question += ` (The answer must be in JSON format, ` +
192
- `where the keys are: ${this.getListAsText(keys)})`;
193
-
194
- this.logQuestion(question, issuer, replaceThisInLog);
195
-
196
- const answer = await this.getQuestionAnswer(question, issuer);
197
-
198
- try {
199
- // replace all ```json, ```, \n
200
- return JSON.parse(
201
- answer.replaceAll('```json', '').replaceAll('```', '').replaceAll('\n', '')
202
- );
203
- } catch (error) {
204
- return {
205
- unparsable: answer,
206
- };
207
- }
208
- }
209
-
210
- async askListQuestion(
211
- question: string,
212
- issuer: string,
213
- replaceThisInLog?: string
214
- ): Promise<string[]> {
215
- question += ' (The answer must be in JSON format, a list of strings)';
216
-
217
- this.logQuestion(question, issuer, replaceThisInLog);
218
-
219
- const answer = await this.getQuestionAnswer(question, issuer);
220
-
221
- try {
222
- const parsed = JSON.parse(
223
- answer.replaceAll('```json', '').replaceAll('```', '').replaceAll('\n', '')
224
- );
225
-
226
- if (Array.isArray(parsed)) {
227
- return parsed;
228
- } else if (typeof parsed === 'object') {
229
- return Object.values(parsed);
230
- } else {
231
- DyFM_Log.error('GPT_ServiceBase', 'askListQuestion', 'Invalid answer', {
232
- question,
233
- answer,
234
- });
235
-
236
- return [ parsed ];
237
- }
238
- } catch (error) {
239
- return answer.split('\n').filter(item => item);
240
- }
241
- }
242
-
243
- private logQuestion(question: string, issuer: string, replaceThisInLog?: string): void {
244
- if (this.debugLog) {
245
- if (replaceThisInLog) {
246
- question = question.replace(replaceThisInLog, this.defaultLogReplacer);
247
- }
248
-
249
- console.log('\n - ', question);
250
- }
251
- }
252
-
253
- /**
254
- * This function will log the answer if the debugLog is true
255
- */
256
- async getQuestionAnswer(
257
- question: string,
258
- issuer: string,
259
- messageSettings: DyFM_GPTCall_Settings = this.defaultSettings
260
- ): Promise<string> {
261
- const answer = await this.resolveSimpleUserMessage(question, issuer, messageSettings);
262
-
263
- console.log(' - ', answer);
264
-
265
- return answer;
266
- }
267
-
268
- /**
269
- * olvasható mondatszerű-listaszerű formába teszi a listaelemeket
270
- * pl.: ['a', 'b', 'c'] -> '"a", "b" or "c"'
271
- */
272
- getListAsText(list: string[]): string {
273
- list = list.filter(item => item?.trim()).map(item => `"${item}"`);
274
-
275
- /* list = list.map(item => item.toLocaleLowerCase()); */
276
-
277
- list.push(list.pop() + ' or ' + list.pop());
278
-
279
- return list.join(', ');
280
- }
281
-
282
- /**
283
- * This function will log the question and the answer if the debugLog is true
284
- */
285
- async getAnswer(
286
- question: string,
287
- issuer: string,
288
- settings?: DyFM_GPTCall_Settings
289
- ): Promise<string> {
290
- if (this.debugLog) {
291
- console.log('\n - ', question);
292
- }
293
-
294
- const answer = await this.resolveSimpleUserMessage(question, issuer, settings);
295
-
296
- if (this.debugLog) {
297
- console.log(' - ', answer);
298
- }
299
-
300
- return answer;
301
- }
302
-
303
- async resolveSimpleUserMessage(
304
- message: string,
305
- issuer: string,
306
- settings?: DyFM_GPTCall_Settings
307
- ): Promise<string> {
308
- return this.resolveConversation(
309
- [{ role: 'user', content: message }],
310
- issuer,
311
- settings,
312
- false
313
- ) as Promise<string>;
314
- }
315
-
316
- async resolveConversation(
317
- conversation: DyNTS_GPT_Message[],
318
- issuer: string,
319
- settings?: DyFM_GPTCall_Settings,
320
- getFullResponse?: boolean
321
- ): Promise<string | ChatCompletion> {
322
- try {
323
- const result: ChatCompletion = await this.openai.chat.completions.create(
324
- this.getMessageCreateInput(conversation, issuer, settings)
325
- ) as ChatCompletion;
326
-
327
- if (getFullResponse) {
328
- return result;
329
- }
330
-
331
- return result.choices[0].message.content;
332
- } catch (error) {
333
- throw new DyFM_Error({
334
- ...this.getDefaultErrorSettings('resolveConversation', error, issuer),
335
-
336
- errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-OAB-RC0`,
337
- });
338
- }
339
- }
340
-
341
- /**
342
- * TODO: Overview this: maybe it should use each setting from default if not provided here
343
- */
344
- private getMessageCreateInput(
345
- messages: DyNTS_GPT_Message[],
346
- issuer: string,
347
- settings: DyFM_GPTCall_Settings = this.defaultSettings
348
- ): ChatCompletionCreateParamsBase {
349
- try {
350
- messages.unshift(this.getDefaultSystemMessage(settings));
351
-
352
- const result: ChatCompletionCreateParamsBase = {
353
- model: settings.useModel ?? this.defaultModel,
354
- messages: messages as ChatCompletionMessageParam[],
355
- };
356
-
357
- if (DyFM_notNull(settings.temperature)) {
358
- result.temperature = settings.temperature;
359
- }
360
-
361
- if (DyFM_notNull(settings.maxTokens)) {
362
- result.max_tokens = settings.maxTokens;
363
- }
364
-
365
- if (DyFM_notNull(settings.topP)) {
366
- result.top_p = settings.topP;
367
- }
368
-
369
- if (DyFM_notNull(settings.frequencyPenalty)) {
370
- result.frequency_penalty = settings.frequencyPenalty;
371
- }
372
-
373
- if (DyFM_notNull(settings.presencePenalty)) {
374
- result.presence_penalty = settings.presencePenalty;
375
- }
376
-
377
- return result;
378
- } catch (error) {
379
- throw new DyFM_Error({
380
- ...this.getDefaultErrorSettings('getMessageCreateSettings', error, issuer),
381
-
382
- errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-OAB-RC0`,
383
- });
384
- }
385
- }
386
-
387
- private getDefaultSystemMessage(settings: DyFM_GPTCall_Settings): DyNTS_GPT_Message {
388
- return {
389
- role: DyNTS_GPT_Message_Role.system,
390
- content: settings.systemPrompt || this.defaultSystemPrompt,
391
- };
392
- }
393
- }
394
-
395
- export interface DyNTS_GPT_Message {
396
- role: DyNTS_GPT_Message_Role | string;
397
- content: string;
398
- }
399
-
400
- export enum DyNTS_GPT_Message_Role {
401
- /**
402
- * Developer-provided instructions that the model should follow, regardless of
403
- * messages sent by the user. With o1 models and newer, `developer` messages
404
- * replace the previous `system` messages.
405
- */
406
- developer = 'developer',
407
-
408
- /**
409
- * Developer-provided instructions that the model should follow, regardless of
410
- * messages sent by the user. With o1 models and newer, use `developer` messages
411
- * for this purpose instead.
412
- */
413
- system = 'system',
414
-
415
- /**
416
- * Messages sent by an end user, containing prompts or additional context
417
- * information.
418
- */
419
- user = 'user',
420
-
421
- /**
422
- * Messages sent by the model in response to user messages.
423
- */
424
- assistant = 'assistant',
425
-
426
- /** ??? */
427
- tool = 'tool',
428
-
429
- /**
430
- * ???
431
- * @deprecated
432
- */
433
- function = 'function',
434
- }
435
-
436
- export function DyFM_notNull(value: any): boolean {
437
- return value !== null && value !== undefined;
438
- }
@@ -1,69 +0,0 @@
1
- import { OpenAI } from 'openai';
2
-
3
- import { DyFM_OpenAI_Settings, DyFM_OpenAIModel, DyFM_GPTCall_Settings } from '@futdevpro/fsm-dynamo/open-ai';
4
- import { DyFM_AnyError, DyFM_Error, DyFM_Error_Settings, DyFM_Log } from '@futdevpro/fsm-dynamo';
5
-
6
- import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
7
-
8
-
9
- /**
10
- * {
11
- * organization: 'org-XY',
12
- * apiKey: 'sk-XY',
13
- * project: 'proj_XY',
14
- * }
15
- */
16
-
17
- // Di Dictionary DiModel DiEz DiAz
18
-
19
- export class DyNTS_OpenAI_ServiceBase {
20
-
21
- readonly defaultErrorUserMsg: string =
22
- `We encountered an unhandled Control Service Error, ` +
23
- `\nplease contact the responsible development team.`;
24
-
25
- readonly openai: OpenAI;
26
-
27
- /* readonly defaultSystemPrompt: string;
28
- readonly defaultModel: DyFM_OpenAIModel | string; */
29
- readonly defaultSettings: DyFM_GPTCall_Settings;
30
-
31
- get debugLog(): boolean {
32
- return this.defaultSettings.debugLog;
33
- }
34
-
35
- get defaultSystemPrompt(): string {
36
- return this.defaultSettings.systemPrompt;
37
- }
38
-
39
- get defaultModel(): DyFM_OpenAIModel | string {
40
- return this.defaultSettings.useModel;
41
- }
42
-
43
- constructor(
44
- set: DyFM_OpenAI_Settings
45
- ) {
46
- this.openai = new OpenAI(set.openAIConfig);
47
- this.defaultSettings = set.defaultSettings ?? new DyFM_GPTCall_Settings();
48
- }
49
-
50
- protected getDefaultErrorSettings(
51
- fnName: string,
52
- error: DyFM_AnyError,
53
- issuer: string
54
- ): DyFM_Error_Settings {
55
- return {
56
- status: (error as DyFM_Error)?.___status ?? 500,
57
- message: (error as Error)?.message ??
58
- (error as DyFM_Error)?._message ??
59
- `${fnName} was UNSUCCESSFUL (${DyNTS_global_settings.systemShortCodeName})`,
60
- addECToUserMsg: !(error as DyFM_Error)?.__userMessage,
61
- userMessage: (error as DyFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
62
- issuer: issuer,
63
- issuerService: this.constructor?.name,
64
- error: error,
65
- };
66
- }
67
- }
68
-
69
-
@@ -1,21 +0,0 @@
1
-
2
-
3
- export function setEnv(): void {
4
- if (process.env.NODE_ENV) {
5
- switch (process.env.NODE_ENV) {
6
- case 'dev':
7
-
8
- break;
9
-
10
- case 'prod':
11
-
12
- break;
13
-
14
- default:
15
- if (process.env.NODE_ENV) {
16
- }
17
- console.log('Unknown environment code:', process.env.NODE_ENV);
18
- break;
19
- }
20
- }
21
- }