@futdevpro/nts-dynamo 1.12.15 → 1.14.1

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 (247) hide show
  1. package/build/_modules/ai/_models/ai-input-interfaces.d.ts +61 -0
  2. package/build/_modules/ai/_models/ai-input-interfaces.d.ts.map +1 -0
  3. package/build/_modules/{open-ai/_models/interfaces/oai-document-page.interface.js → ai/_models/ai-input-interfaces.js} +1 -1
  4. package/build/_modules/ai/_models/ai-input-interfaces.js.map +1 -0
  5. package/build/_modules/{open-ai/_collections/oai-chunking.util.d.ts → ai/_modules/document-ai/_collections/dai-chunking.util.d.ts} +10 -10
  6. package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.d.ts.map +1 -0
  7. package/build/_modules/{open-ai/_collections/oai-chunking.util.js → ai/_modules/document-ai/_collections/dai-chunking.util.js} +58 -41
  8. package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.js.map +1 -0
  9. package/build/_modules/ai/_modules/document-ai/_collections/dai-document.util.d.ts +29 -0
  10. package/build/_modules/ai/_modules/document-ai/_collections/dai-document.util.d.ts.map +1 -0
  11. package/build/_modules/ai/_modules/document-ai/_collections/dai-document.util.js +74 -0
  12. package/build/_modules/ai/_modules/document-ai/_collections/dai-document.util.js.map +1 -0
  13. package/build/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.d.ts +7 -0
  14. package/build/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.d.ts.map +1 -0
  15. package/build/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.js +11 -0
  16. package/build/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.js.map +1 -0
  17. package/build/_modules/{open-ai/_models/oai-doc-chunk.data-model.d.ts → ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.d.ts} +25 -13
  18. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.d.ts.map +1 -0
  19. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.js +132 -0
  20. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.js.map +1 -0
  21. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.d.ts +29 -0
  22. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.d.ts.map +1 -0
  23. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.js +112 -0
  24. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.js.map +1 -0
  25. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.d.ts +18 -0
  26. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.d.ts.map +1 -0
  27. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.js +71 -0
  28. package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.js.map +1 -0
  29. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.d.ts +9 -0
  30. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.d.ts.map +1 -0
  31. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.js +3 -0
  32. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.js.map +1 -0
  33. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.d.ts +12 -0
  34. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.d.ts.map +1 -0
  35. package/build/_modules/{open-ai/_models/interfaces/oai-chunk-compare-result.interface.js → ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.js} +1 -1
  36. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.js.map +1 -0
  37. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.d.ts +13 -0
  38. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.d.ts.map +1 -0
  39. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.js +3 -0
  40. package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.js.map +1 -0
  41. package/build/_modules/ai/_modules/document-ai/index.d.ts +11 -0
  42. package/build/_modules/ai/_modules/document-ai/index.d.ts.map +1 -0
  43. package/build/_modules/ai/_modules/document-ai/index.js +26 -0
  44. package/build/_modules/ai/_modules/document-ai/index.js.map +1 -0
  45. package/build/_modules/ai/_modules/open-ai/_collections/oai-global-settings.const.d.ts.map +1 -0
  46. package/build/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-global-settings.const.js +2 -2
  47. package/build/_modules/ai/_modules/open-ai/_collections/oai-global-settings.const.js.map +1 -0
  48. package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts.map +1 -0
  49. package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js.map +1 -0
  50. package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts.map +1 -0
  51. package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js.map +1 -0
  52. package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts.map +1 -0
  53. package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.js.map +1 -0
  54. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts +6 -0
  55. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts.map +1 -0
  56. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js.map +1 -0
  57. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts.map +1 -0
  58. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js.map +1 -0
  59. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts.map +1 -0
  60. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js.map +1 -0
  61. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.d.ts +22 -0
  62. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.d.ts.map +1 -0
  63. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.js +223 -0
  64. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.js.map +1 -0
  65. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.d.ts +26 -0
  66. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.d.ts.map +1 -0
  67. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.js +232 -0
  68. package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.js.map +1 -0
  69. package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.d.ts +23 -0
  70. package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.d.ts.map +1 -0
  71. package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.js +284 -0
  72. package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.js.map +1 -0
  73. package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts +7 -0
  74. package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +1 -0
  75. package/build/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-embedding.control-service.js +5 -5
  76. package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js.map +1 -0
  77. package/build/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-llm-chat.service-base.d.ts +16 -16
  78. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -0
  79. package/build/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-llm-chat.service-base.js +3 -3
  80. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -0
  81. package/build/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-llm.service-base.d.ts +19 -19
  82. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -0
  83. package/build/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-llm.service-base.js +6 -6
  84. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -0
  85. package/build/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-vector-data.service.d.ts +6 -6
  86. package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.d.ts.map +1 -0
  87. package/build/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-vector-data.service.js +138 -6
  88. package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.js.map +1 -0
  89. package/build/_modules/{open-ai → ai/_modules/open-ai}/index.d.ts +4 -10
  90. package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -0
  91. package/build/_modules/{open-ai → ai/_modules/open-ai}/index.js +22 -11
  92. package/build/_modules/ai/_modules/open-ai/index.js.map +1 -0
  93. package/build/_modules/ai/_services/ai-embedding.service-base.d.ts +31 -0
  94. package/build/_modules/ai/_services/ai-embedding.service-base.d.ts.map +1 -0
  95. package/build/_modules/ai/_services/ai-embedding.service-base.js +12 -0
  96. package/build/_modules/ai/_services/ai-embedding.service-base.js.map +1 -0
  97. package/build/_modules/ai/_services/ai-llm-chat.service-base.d.ts +36 -0
  98. package/build/_modules/ai/_services/ai-llm-chat.service-base.d.ts.map +1 -0
  99. package/build/_modules/ai/_services/ai-llm-chat.service-base.js +12 -0
  100. package/build/_modules/ai/_services/ai-llm-chat.service-base.js.map +1 -0
  101. package/build/_modules/ai/_services/ai-llm.service-base.d.ts +45 -0
  102. package/build/_modules/ai/_services/ai-llm.service-base.d.ts.map +1 -0
  103. package/build/_modules/ai/_services/ai-llm.service-base.js +12 -0
  104. package/build/_modules/ai/_services/ai-llm.service-base.js.map +1 -0
  105. package/build/_modules/ai/_services/ai-provider.service-base.d.ts +25 -0
  106. package/build/_modules/ai/_services/ai-provider.service-base.d.ts.map +1 -0
  107. package/build/_modules/ai/_services/ai-provider.service-base.js +11 -0
  108. package/build/_modules/ai/_services/ai-provider.service-base.js.map +1 -0
  109. package/build/_modules/ai/index.d.ts +7 -0
  110. package/build/_modules/ai/index.d.ts.map +1 -0
  111. package/build/_modules/ai/index.js +13 -0
  112. package/build/_modules/ai/index.js.map +1 -0
  113. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js +2 -2
  114. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js.map +1 -1
  115. package/build/_modules/discord-assistant/_collections/dias.util.d.ts +1 -1
  116. package/build/_modules/discord-assistant/_collections/dias.util.d.ts.map +1 -1
  117. package/build/_modules/discord-assistant/_collections/dias.util.js +5 -5
  118. package/build/_modules/discord-assistant/_collections/dias.util.js.map +1 -1
  119. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +9 -9
  120. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -1
  121. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +11 -10
  122. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
  123. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts +2 -2
  124. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts.map +1 -1
  125. package/build/_modules/discord-assistant/_services/dias-io.control-service.js +2 -2
  126. package/build/_modules/discord-assistant/_services/dias-io.control-service.js.map +1 -1
  127. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts +2 -2
  128. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts.map +1 -1
  129. package/build/_modules/discord-assistant/_services/dias.service-base.js +1 -1
  130. package/build/_modules/discord-assistant/_services/dias.service-base.js.map +1 -1
  131. package/build/_modules/discord-assistant/index.d.ts +2 -1
  132. package/build/_modules/discord-assistant/index.d.ts.map +1 -1
  133. package/build/_modules/discord-assistant/index.js +2 -1
  134. package/build/_modules/discord-assistant/index.js.map +1 -1
  135. package/package.json +32 -12
  136. package/src/_modules/ai/_models/ai-input-interfaces.ts +79 -0
  137. package/src/_modules/{open-ai/_collections/oai-chunking.util.ts → ai/_modules/document-ai/_collections/dai-chunking.util.ts} +139 -90
  138. package/src/_modules/ai/_modules/document-ai/_collections/dai-document.util.ts +85 -0
  139. package/src/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.ts +8 -0
  140. package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.ts +144 -0
  141. package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.ts +136 -0
  142. package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.ts +93 -0
  143. package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.ts +18 -0
  144. package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.ts +19 -0
  145. package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.ts +25 -0
  146. package/src/_modules/ai/_modules/document-ai/index.ts +28 -0
  147. package/src/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-global-settings.const.ts +2 -2
  148. package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +8 -0
  149. package/src/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.ts +284 -0
  150. package/src/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.ts +508 -0
  151. package/src/_modules/ai/_modules/open-ai/_services/oai-document.data-service.ts +377 -0
  152. package/src/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-embedding.control-service.ts +6 -6
  153. package/src/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-llm-chat.service-base.ts +20 -19
  154. package/src/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-llm.service-base.ts +24 -24
  155. package/src/_modules/{open-ai → ai/_modules/open-ai}/_services/oai-vector-data.service.ts +145 -9
  156. package/src/_modules/ai/_modules/open-ai/index.ts +72 -0
  157. package/src/_modules/ai/_services/ai-embedding.service-base.ts +41 -0
  158. package/src/_modules/ai/_services/ai-llm-chat.service-base.ts +48 -0
  159. package/src/_modules/ai/_services/ai-llm.service-base.ts +81 -0
  160. package/src/_modules/ai/_services/ai-provider.service-base.ts +28 -0
  161. package/src/_modules/ai/index.ts +11 -0
  162. package/src/_modules/discord-assistant/_collections/dias-global-settings.const.ts +2 -2
  163. package/src/_modules/discord-assistant/_collections/dias.util.ts +5 -3
  164. package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +25 -18
  165. package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +5 -3
  166. package/src/_modules/discord-assistant/_services/dias.service-base.ts +3 -3
  167. package/src/_modules/discord-assistant/index.ts +2 -1
  168. package/src/index.ts +0 -4
  169. package/build/_modules/open-ai/_collections/oai-chunking.util.d.ts.map +0 -1
  170. package/build/_modules/open-ai/_collections/oai-chunking.util.js.map +0 -1
  171. package/build/_modules/open-ai/_collections/oai-document.util.d.ts +0 -4
  172. package/build/_modules/open-ai/_collections/oai-document.util.d.ts.map +0 -1
  173. package/build/_modules/open-ai/_collections/oai-document.util.js +0 -12
  174. package/build/_modules/open-ai/_collections/oai-document.util.js.map +0 -1
  175. package/build/_modules/open-ai/_collections/oai-global-settings.const.d.ts.map +0 -1
  176. package/build/_modules/open-ai/_collections/oai-global-settings.const.js.map +0 -1
  177. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts.map +0 -1
  178. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js.map +0 -1
  179. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts.map +0 -1
  180. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js.map +0 -1
  181. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts +0 -6
  182. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts.map +0 -1
  183. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js +0 -10
  184. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js.map +0 -1
  185. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts.map +0 -1
  186. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.js.map +0 -1
  187. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts +0 -7
  188. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts.map +0 -1
  189. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.js.map +0 -1
  190. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts +0 -15
  191. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts.map +0 -1
  192. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.js.map +0 -1
  193. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts +0 -6
  194. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts.map +0 -1
  195. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js.map +0 -1
  196. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts.map +0 -1
  197. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js.map +0 -1
  198. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts.map +0 -1
  199. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js.map +0 -1
  200. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts +0 -13
  201. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts.map +0 -1
  202. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js +0 -3
  203. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js.map +0 -1
  204. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.d.ts.map +0 -1
  205. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js +0 -101
  206. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js.map +0 -1
  207. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts +0 -16
  208. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts.map +0 -1
  209. package/build/_modules/open-ai/_services/oai-chunk.service-base.js +0 -200
  210. package/build/_modules/open-ai/_services/oai-chunk.service-base.js.map +0 -1
  211. package/build/_modules/open-ai/_services/oai-embedding.control-service.d.ts +0 -7
  212. package/build/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +0 -1
  213. package/build/_modules/open-ai/_services/oai-embedding.control-service.js.map +0 -1
  214. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +0 -1
  215. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +0 -1
  216. package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +0 -1
  217. package/build/_modules/open-ai/_services/oai-llm.service-base.js.map +0 -1
  218. package/build/_modules/open-ai/_services/oai-vector-data.service.d.ts.map +0 -1
  219. package/build/_modules/open-ai/_services/oai-vector-data.service.js.map +0 -1
  220. package/build/_modules/open-ai/index.d.ts.map +0 -1
  221. package/build/_modules/open-ai/index.js.map +0 -1
  222. package/src/_modules/open-ai/_collections/oai-document.util.ts +0 -10
  223. package/src/_modules/open-ai/_enums/oai-compare-result-type.enum.ts +0 -7
  224. package/src/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.ts +0 -15
  225. package/src/_modules/open-ai/_models/interfaces/oai-document-page.interface.ts +0 -28
  226. package/src/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +0 -8
  227. package/src/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.ts +0 -17
  228. package/src/_modules/open-ai/_models/oai-doc-chunk.data-model.ts +0 -115
  229. package/src/_modules/open-ai/_services/oai-chunk.service-base.ts +0 -280
  230. package/src/_modules/open-ai/index.ts +0 -55
  231. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-global-settings.const.d.ts +0 -0
  232. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-llm-predefined-requests-hu.conts.d.ts +0 -0
  233. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-llm-predefined-requests-hu.conts.js +0 -0
  234. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-llm-predefined-requests.conts.d.ts +0 -0
  235. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-llm-predefined-requests.conts.js +0 -0
  236. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_enums/oai-gpt-message-role.enum.d.ts +0 -0
  237. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_enums/oai-gpt-message-role.enum.js +0 -0
  238. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_models/interfaces/oai-global-settings.interface.js +0 -0
  239. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_models/interfaces/oai-gpt-message.interface.d.ts +0 -0
  240. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_models/interfaces/oai-gpt-message.interface.js +0 -0
  241. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_models/interfaces/oai-llm-predefined-requests.interface.d.ts +0 -0
  242. /package/build/_modules/{open-ai → ai/_modules/open-ai}/_models/interfaces/oai-llm-predefined-requests.interface.js +0 -0
  243. /package/src/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-llm-predefined-requests-hu.conts.ts +0 -0
  244. /package/src/_modules/{open-ai → ai/_modules/open-ai}/_collections/oai-llm-predefined-requests.conts.ts +0 -0
  245. /package/src/_modules/{open-ai → ai/_modules/open-ai}/_enums/oai-gpt-message-role.enum.ts +0 -0
  246. /package/src/_modules/{open-ai → ai/_modules/open-ai}/_models/interfaces/oai-gpt-message.interface.ts +0 -0
  247. /package/src/_modules/{open-ai → ai/_modules/open-ai}/_models/interfaces/oai-llm-predefined-requests.interface.ts +0 -0
@@ -1,9 +1,9 @@
1
1
  import { OpenAI } from 'openai';
2
2
 
3
- import { DyFM_OpenAI_Settings, DyFM_OpenAIModel, DyFM_GPTCall_Settings } from '@futdevpro/fsm-dynamo/open-ai';
3
+ import { DyFM_OAI_Settings, DyFM_OAI_Model, DyFM_OAI_CallSettings } from '@futdevpro/fsm-dynamo/ai/open-ai';
4
4
  import { DyFM_AnyError, DyFM_Error, DyFM_Error_Settings, DyFM_Log, DyFM_notNull, DyFM_Object } from '@futdevpro/fsm-dynamo';
5
5
 
6
- import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
6
+ import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
7
7
  import { DyNTS_OAI_GPT_Message } from '../_models/interfaces/oai-gpt-message.interface';
8
8
  import { ChatCompletion } from 'openai/resources';
9
9
  import { ChatCompletionCreateParamsBase, ChatCompletionMessageParam } from 'openai/resources/chat/completions';
@@ -32,8 +32,8 @@ export class DyNTS_OAI_LLM_ServiceBase {
32
32
  readonly openai: OpenAI;
33
33
 
34
34
  /* readonly defaultSystemPrompt: string;
35
- readonly defaultModel: DyFM_OpenAIModel | string; */
36
- readonly defaultSettings: DyFM_GPTCall_Settings;
35
+ readonly defaultModel: DyFM_OAI_Model | string; */
36
+ readonly defaultSettings: DyFM_OAI_CallSettings;
37
37
 
38
38
  get debugLog(): boolean {
39
39
  return this.defaultSettings.debugLog;
@@ -43,7 +43,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
43
43
  return this.defaultSettings.systemPrompt;
44
44
  }
45
45
 
46
- get defaultModel(): DyFM_OpenAIModel | string {
46
+ get defaultModel(): DyFM_OAI_Model | string {
47
47
  return this.defaultSettings.useModel;
48
48
  }
49
49
 
@@ -51,12 +51,12 @@ export class DyNTS_OAI_LLM_ServiceBase {
51
51
  DyNTS_OAI_LLMDefaultPredefined_Requests;
52
52
 
53
53
  constructor(
54
- set?: DyFM_OpenAI_Settings
54
+ set?: DyFM_OAI_Settings
55
55
  ) {
56
56
  DyNTS_global_settings.openAi_settings ??= DyNTS_OAI_global_settings;
57
57
 
58
58
  this.openai = new OpenAI(
59
- set?.openAIConfig ??
59
+ set?.config ??
60
60
  {
61
61
  organization: DyNTS_global_settings.env_settings.openAi.organization,
62
62
  apiKey: DyNTS_global_settings.env_settings.openAi.apiKey,
@@ -66,7 +66,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
66
66
 
67
67
  this.defaultSettings = set?.defaultSettings ??
68
68
  DyNTS_OAI_global_settings.defaultSettings ??
69
- new DyFM_GPTCall_Settings();
69
+ new DyFM_OAI_CallSettings();
70
70
  }
71
71
 
72
72
  readonly defaultLogReplacer: string = '...long-context...';
@@ -83,7 +83,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
83
83
  set: {
84
84
  question: string,
85
85
  issuer: string,
86
- settings?: DyFM_GPTCall_Settings,
86
+ settings?: DyFM_OAI_CallSettings,
87
87
  debugLog?: boolean,
88
88
  /** this is used to readably replace too long contents to eg '...' in logs */
89
89
  replaceThisInLog?: string
@@ -107,7 +107,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
107
107
  set: {
108
108
  question: string,
109
109
  issuer: string,
110
- settings?: DyFM_GPTCall_Settings,
110
+ settings?: DyFM_OAI_CallSettings,
111
111
  debugLog?: boolean,
112
112
  /** this is used to readably replace too long contents to eg '...' in logs */
113
113
  replaceThisInLog?: string,
@@ -141,7 +141,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
141
141
  question: string,
142
142
  selectFrom: string[],
143
143
  issuer: string,
144
- settings?: DyFM_GPTCall_Settings,
144
+ settings?: DyFM_OAI_CallSettings,
145
145
  debugLog?: boolean,
146
146
  /** this is used to readably replace too long contents to eg '...' in logs */
147
147
  replaceThisInLog?: string,
@@ -179,7 +179,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
179
179
  question: string,
180
180
  selectFrom: T[],
181
181
  issuer: string,
182
- settings?: DyFM_GPTCall_Settings,
182
+ settings?: DyFM_OAI_CallSettings,
183
183
  debugLog?: boolean,
184
184
  /** this is used to readably replace too long contents to eg '...' in logs */
185
185
  replaceThisInLog?: string,
@@ -208,7 +208,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
208
208
  question: string,
209
209
  options: string[],
210
210
  issuer: string,
211
- settings?: DyFM_GPTCall_Settings,
211
+ settings?: DyFM_OAI_CallSettings,
212
212
  debugLog?: boolean,
213
213
  /** this is used to readably replace too long contents to eg '...' in logs */
214
214
  replaceThisInLog?: string,
@@ -249,7 +249,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
249
249
  question: string,
250
250
  options: T[],
251
251
  issuer: string,
252
- settings?: DyFM_GPTCall_Settings,
252
+ settings?: DyFM_OAI_CallSettings,
253
253
  debugLog?: boolean,
254
254
  /** this is used to readably replace too long contents to eg '...' in logs */
255
255
  replaceThisInLog?: string,
@@ -281,7 +281,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
281
281
  set: {
282
282
  question: string,
283
283
  issuer: string,
284
- settings?: DyFM_GPTCall_Settings,
284
+ settings?: DyFM_OAI_CallSettings,
285
285
  debugLog?: boolean,
286
286
  /** this is used to readably replace too long contents to eg '...' in logs */
287
287
  replaceThisInLog?: string,
@@ -310,7 +310,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
310
310
  question: string,
311
311
  keysDescription: string,
312
312
  issuer: string,
313
- settings?: DyFM_GPTCall_Settings,
313
+ settings?: DyFM_OAI_CallSettings,
314
314
  debugLog?: boolean,
315
315
  /** this is used to readably replace too long contents to eg '...' in logs */
316
316
  replaceThisInLog?: string,
@@ -343,7 +343,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
343
343
  question: string,
344
344
  keys: string[],
345
345
  issuer: string,
346
- settings?: DyFM_GPTCall_Settings,
346
+ settings?: DyFM_OAI_CallSettings,
347
347
  debugLog?: boolean,
348
348
  /** this is used to readably replace too long contents to eg '...' in logs */
349
349
  replaceThisInLog?: string,
@@ -375,7 +375,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
375
375
  set: {
376
376
  question: string,
377
377
  issuer: string,
378
- settings?: DyFM_GPTCall_Settings,
378
+ settings?: DyFM_OAI_CallSettings,
379
379
  debugLog?: boolean,
380
380
  /** this is used to readably replace too long contents to eg '...' in logs */
381
381
  replaceThisInLog?: string,
@@ -401,7 +401,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
401
401
  set: {
402
402
  question: string,
403
403
  issuer: string,
404
- settings?: DyFM_GPTCall_Settings,
404
+ settings?: DyFM_OAI_CallSettings,
405
405
  debugLog?: boolean,
406
406
  /** this is used to readably replace too long contents to eg '...' in logs */
407
407
  replaceThisInLog?: string,
@@ -433,7 +433,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
433
433
  // async askJSONListQuestion(
434
434
  // question: string,
435
435
  // issuer: string,
436
- // settings?: DyFM_GPTCall_Settings,
436
+ // settings?: DyFM_OAI_CallSettings,
437
437
  // debugLog?: boolean,
438
438
  // /** this is used to readably replace too long contents to eg '...' in logs */
439
439
  // replaceThisInLog?: string,
@@ -454,7 +454,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
454
454
  set: {
455
455
  message: string,
456
456
  issuer: string,
457
- settings?: DyFM_GPTCall_Settings
457
+ settings?: DyFM_OAI_CallSettings
458
458
  }
459
459
  ): Promise<string> {
460
460
  return this.resolveMessage({
@@ -478,7 +478,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
478
478
  set: {
479
479
  conversation: DyNTS_OAI_GPT_Message[],
480
480
  issuer: string,
481
- settings?: DyFM_GPTCall_Settings,
481
+ settings?: DyFM_OAI_CallSettings,
482
482
  getFullResponse?: boolean
483
483
  }
484
484
  ): Promise<string | ChatCompletion> {
@@ -547,7 +547,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
547
547
  set: {
548
548
  conversation: DyNTS_OAI_GPT_Message[],
549
549
  issuer: string,
550
- settings?: DyFM_GPTCall_Settings
550
+ settings?: DyFM_OAI_CallSettings
551
551
  }
552
552
  ): ChatCompletionCreateParamsBase {
553
553
  try {
@@ -591,7 +591,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
591
591
  }
592
592
  }
593
593
 
594
- protected getDefaultSystemMessage(settings: DyFM_GPTCall_Settings): DyNTS_OAI_GPT_Message {
594
+ protected getDefaultSystemMessage(settings: DyFM_OAI_CallSettings): DyNTS_OAI_GPT_Message {
595
595
  return {
596
596
  role: DyNTS_OAI_GPT_Message_Role.system,
597
597
  content: settings?.systemPrompt || this.defaultSystemPrompt,
@@ -8,10 +8,10 @@ import {
8
8
  DyFM_Metadata,
9
9
  DyFM_Object,
10
10
  } from '@futdevpro/fsm-dynamo';
11
- import { DyFM_OpenAI_Settings, DyFM_OpenAIEmbeddingModel, DyFM_OpenAIModel } from '@futdevpro/fsm-dynamo/open-ai';
11
+ import { DyFM_OAI_Settings, DyFM_OAI_EmbeddingModel, DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
12
12
 
13
- import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
14
- import { DyNTS_DataService } from '../../../_services/base/data.service';
13
+ import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
14
+ import { DyNTS_DataService } from '../../../../../_services/base/data.service';
15
15
  import { DyNTS_OAI_Embedding_ControlService } from './oai-embedding.control-service';
16
16
  import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
17
17
 
@@ -39,7 +39,7 @@ import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.c
39
39
  * constructor(
40
40
  * set: {
41
41
  * data?: UserMatchStatistics,
42
- * openAISettings?: DyFM_OpenAI_Settings,
42
+ * openAISettings?: DyFM_OAI_Settings,
43
43
  * issuer: string,
44
44
  * }
45
45
  * ) {
@@ -79,7 +79,7 @@ export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_
79
79
  /**
80
80
  * OpenAI settings
81
81
  */
82
- public readonly openAISettings: DyFM_OpenAI_Settings,
82
+ public readonly openAISettings: DyFM_OAI_Settings,
83
83
  /**
84
84
  * Initial set for issuer to be able to follow the issuer's activity
85
85
  */
@@ -106,7 +106,7 @@ export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_
106
106
  (dataParams.properties[key] as DyFM_DataProperty_Params<any>).vectorizedFrom !== key
107
107
  ); */
108
108
 
109
- if (!openAISettings.openAIConfig.apiKey) {
109
+ if (!openAISettings.config.apiKey) {
110
110
  throw new DyFM_Error({
111
111
  ...this.getDefaultErrorSettings(
112
112
  'constructor',
@@ -115,8 +115,8 @@ export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_
115
115
  });
116
116
  }
117
117
 
118
- const model: DyFM_OpenAIEmbeddingModel = openAISettings.defaultSettings.useModel as DyFM_OpenAIEmbeddingModel ??
119
- DyFM_OpenAIModel.textEmbedding_3Large;
118
+ const model: DyFM_OAI_EmbeddingModel = openAISettings.defaultSettings.useModel as DyFM_OAI_EmbeddingModel ??
119
+ DyFM_OAI_Model.textEmbedding_3Large;
120
120
 
121
121
  /* if (
122
122
  !DyFM_allOpenAIEmbeddingModels.includes(model)
@@ -294,7 +294,7 @@ export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_
294
294
  */
295
295
  async vectorize(
296
296
  input: string,
297
- useModel: DyFM_OpenAIModel | string = this.openAISettings.defaultSettings.useModel
297
+ useModel: DyFM_OAI_Model | string = this.openAISettings.defaultSettings.useModel
298
298
  ): Promise<number[]> {
299
299
  try {
300
300
  if (!input) {
@@ -469,3 +469,139 @@ export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_
469
469
  }
470
470
  }
471
471
  }
472
+
473
+
474
+
475
+
476
+ //import {
477
+ // DyFM_DataModel_Params,
478
+ // DyFM_DataProperty_Params,
479
+ // DyFM_Metadata,
480
+ //} from '@futdevpro/fsm-dynamo';
481
+ //import { DyFM_OAI_Settings, DyFM_OAI_EmbeddingModel, DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/open-ai';
482
+ //
483
+ //import { DyNTS_DAI_VectorDataService } from '../../_modules/document-ai/_services/dai-vector-data.service-base';
484
+ //import { DyNTS_OAI_Embedding_Service } from './oai-embedding.service';
485
+ //import { DyNTS_global_settings } from '../../../../_collections/global-settings.const';
486
+ //import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
487
+ //
488
+ ///**
489
+ // * OpenAI implementation of the generic Vector Data Service
490
+ // * Extends the generic DAI VectorDataService with OpenAI-specific functionality
491
+ // */
492
+ //export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_DAI_VectorDataService<T> {
493
+ //
494
+ // debugLog: boolean = true;
495
+ // swallowVectorizedProperties: boolean = true;
496
+ //
497
+ // constructor(
498
+ // /** Initial data */
499
+ // data: T,
500
+ // /** DB data params */
501
+ // dataParams: DyFM_DataModel_Params<T>,
502
+ // /** OpenAI settings */
503
+ // public readonly openAISettings: DyFM_OAI_Settings,
504
+ // /** Issuer */
505
+ // issuer: string
506
+ // ) {
507
+ // // Create OpenAI embedding service
508
+ // const embeddingService = new DyNTS_OAI_Embedding_Service(openAISettings);
509
+ //
510
+ // super(data, dataParams, embeddingService, issuer);
511
+ //
512
+ // if (!openAISettings.openAIConfig.apiKey) {
513
+ // throw new Error('openAIConfig.apiKey is required');
514
+ // }
515
+ //
516
+ // const model: DyFM_OAI_EmbeddingModel = openAISettings.defaultSettings.useModel as DyFM_OAI_EmbeddingModel ??
517
+ // DyFM_OAI_Model.textEmbedding_3Large;
518
+ //
519
+ // // Configure vectorized properties with OpenAI-specific settings
520
+ // this.configureVectorizedProperties(model);
521
+ // }
522
+ //
523
+ // /**
524
+ // * Configure vectorized properties with OpenAI-specific settings
525
+ // */
526
+ // private configureVectorizedProperties(model: DyFM_OAI_EmbeddingModel): void {
527
+ // // Update vectorized properties with OpenAI model info
528
+ // this.vectorizedProperties.forEach(property => {
529
+ // if (property.vectorizedFrom) {
530
+ // // Set the embedding model for this property
531
+ // (property as any).embeddingModel = model;
532
+ // }
533
+ // });
534
+ // }
535
+ //
536
+ // /**
537
+ // * Perform vector search with OpenAI-specific implementation
538
+ // */
539
+ // protected override async performVectorSearch(
540
+ // query: string,
541
+ // model: string,
542
+ // issuer: string,
543
+ // options: any
544
+ // ): Promise<T[]> {
545
+ // try {
546
+ // // Create embedding for the query
547
+ // const queryEmbedding = await this.embeddingService.createEmbedding(query, model, issuer);
548
+ //
549
+ // // Get all data
550
+ // const allData = await this.getAllData();
551
+ //
552
+ // // Calculate similarities (simplified implementation)
553
+ // const results = allData.map(item => {
554
+ // const itemEmbedding = (item as any).chunkParentedContentVectorized;
555
+ // if (!itemEmbedding) return { item, similarity: 0 };
556
+ //
557
+ // const similarity = this.calculateCosineSimilarity(queryEmbedding, itemEmbedding);
558
+ // return { item, similarity };
559
+ // })
560
+ // .filter(result => result.similarity >= (options.minSimilarity || 0))
561
+ // .sort((a, b) => b.similarity - a.similarity)
562
+ // .slice(0, options.limit || 10)
563
+ // .map(result => result.item);
564
+ //
565
+ // return results;
566
+ // } catch (error) {
567
+ // throw new Error(`Vector search failed: ${error.message}`);
568
+ // }
569
+ // }
570
+ //
571
+ // /**
572
+ // * Calculate cosine similarity between two vectors
573
+ // */
574
+ // private calculateCosineSimilarity(vecA: number[], vecB: number[]): number {
575
+ // if (vecA.length !== vecB.length) return 0;
576
+ //
577
+ // let dotProduct = 0;
578
+ // let normA = 0;
579
+ // let normB = 0;
580
+ //
581
+ // for (let i = 0; i < vecA.length; i++) {
582
+ // dotProduct += vecA[i] * vecB[i];
583
+ // normA += vecA[i] * vecA[i];
584
+ // normB += vecB[i] * vecB[i];
585
+ // }
586
+ //
587
+ // if (normA === 0 || normB === 0) return 0;
588
+ //
589
+ // return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));
590
+ // }
591
+ //
592
+ // /**
593
+ // * Get default error settings
594
+ // */
595
+ // protected getDefaultErrorSettings(
596
+ // method: string,
597
+ // error: any,
598
+ // issuer?: string
599
+ // ): any {
600
+ // return {
601
+ // method,
602
+ // error,
603
+ // issuer: issuer || this.issuer,
604
+ // userMsg: this.defaultErrorUserMsg,
605
+ // };
606
+ // }
607
+ //}
@@ -0,0 +1,72 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+ /* try {
10
+ require.resolve('open-ai');
11
+ } catch {
12
+ console.log(
13
+ '❌ OpenAI package not found, please install it with: pnpm add open-ai'
14
+ );
15
+ } */
16
+
17
+ //
18
+ // OpenAI module
19
+ //
20
+ // This module is created to simplify the usage of OpenAI API
21
+ // It creates universal solutions for the most common use cases
22
+ //
23
+
24
+
25
+ // Re-export from FSM
26
+ export * from '@futdevpro/fsm-dynamo/ai/open-ai';
27
+
28
+ // Re-export from document-ai
29
+ /* export * from '../../_modules/document-ai'; */
30
+
31
+
32
+ // COLLECTIONS
33
+ /* export * from './_collections/oai-chunking.util';
34
+ export * from './_collections/oai-document.util'; */
35
+ export * from './_collections/oai-global-settings.const';
36
+ export * from './_collections/oai-llm-predefined-requests.conts';
37
+ export * from './_collections/oai-llm-predefined-requests-hu.conts';
38
+
39
+
40
+ // ENUMS
41
+ //export * from './_enums/oai-compare-result-type.enum';
42
+ export * from './_enums/oai-gpt-message-role.enum';
43
+
44
+
45
+ // MODELS
46
+ /* export * from '../document-ai/_models/oai-doc-chunk.data-model'; */
47
+
48
+ // models/INTERFACES
49
+ /* export * from '../document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface';
50
+ export * from '../document-ai/_models/interfaces/dai-doc-page-compare-result.interface'; */
51
+ /* export * from '../document-ai/_models/interfaces/oai-document-page.interface'; */
52
+ export * from './_models/interfaces/oai-global-settings.interface';
53
+ export * from './_models/interfaces/oai-gpt-message.interface';
54
+ export * from './_models/interfaces/oai-llm-predefined-requests.interface';
55
+ /* export * from '../document-ai/_models/interfaces/dai-doc-page-compare-result.interface'; */
56
+
57
+
58
+ // SERVICES - New implementations
59
+ /* export * from './_services/oai-llm.service';
60
+ export * from './_services/oai-llm-chat.service';
61
+ export * from './_services/oai-embedding.service'; */
62
+ /* export * from './_services/oai-doc-chunk.service'; */
63
+
64
+ // Legacy (for backward compatibility)
65
+ export * from './_services/oai-doc-chunk-data.service';
66
+ export * from './_services/oai-doc-page.data-service';
67
+ export * from './_services/oai-document.data-service';
68
+ export * from './_services/oai-embedding.control-service';
69
+ export * from './_services/oai-llm-chat.service-base';
70
+ export * from './_services/oai-llm.service-base';
71
+ export * from './_services/oai-vector-data.service';
72
+ /* export * from './_services/oai-doc-chunk.service-base'; */
@@ -0,0 +1,41 @@
1
+ import { DyNTS_AI_Provider_ServiceBase } from './ai-provider.service-base';
2
+ import { DyFM_DAI_EmbeddingInfo } from '@futdevpro/fsm-dynamo/ai/document-ai';
3
+
4
+ /**
5
+ * Abstract base class for embedding services
6
+ * Defines the interface for AI providers that support embeddings
7
+ */
8
+ export abstract class DyNTS_AI_Embedding_ServiceBase extends DyNTS_AI_Provider_ServiceBase {
9
+ /**
10
+ * Create an embedding for a single text
11
+ * @param text - The text to embed
12
+ * @param model - The embedding model to use
13
+ * @param issuer - The issuer making the request
14
+ * @returns Promise<number[]> - The embedding vector
15
+ */
16
+ abstract createEmbedding(
17
+ text: string,
18
+ model: string,
19
+ issuer: string
20
+ ): Promise<number[]>;
21
+
22
+ /**
23
+ * Create embeddings for multiple texts
24
+ * @param texts - Array of texts to embed
25
+ * @param model - The embedding model to use
26
+ * @param issuer - The issuer making the request
27
+ * @returns Promise<number[][]> - Array of embedding vectors
28
+ */
29
+ abstract createEmbeddings(
30
+ texts: string[],
31
+ model: string,
32
+ issuer: string
33
+ ): Promise<number[][]>;
34
+
35
+ /**
36
+ * Get embedding information for a model
37
+ * @param model - The model name
38
+ * @returns DyFM_DAI_EmbeddingInfo - Information about the model
39
+ */
40
+ abstract getEmbeddingInfo(model: string): DyFM_DAI_EmbeddingInfo;
41
+ }
@@ -0,0 +1,48 @@
1
+ import { DyNTS_AI_LLM_ServiceBase } from './ai-llm.service-base';
2
+ import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
3
+ import {
4
+ DyFM_AI_ConversationQuestion_Input,
5
+ DyFM_AI_ConversationSelect_Input,
6
+ DyFM_AI_ConversationGenericSelect_Input,
7
+ DyFM_AI_ConversationMultiSelect_Input,
8
+ DyFM_AI_ConversationGenericMultiSelect_Input,
9
+ DyFM_AI_ConversationJSONKeysDescription_Input,
10
+ DyFM_AI_ConversationJSONExactKeys_Input,
11
+ DyFM_AI_ConversationGetAnswer_Input
12
+ } from '../_models/ai-input-interfaces';
13
+
14
+ /**
15
+ * Abstract base class for LLM Chat services
16
+ * Extends LLM service with conversation management capabilities
17
+ */
18
+ export abstract class DyNTS_AI_LLMChat_ServiceBase extends DyNTS_AI_LLM_ServiceBase {
19
+ // History management
20
+ /**
21
+ * Add a message to the conversation history
22
+ */
23
+ abstract addMessageToHistory(message: DyFM_AI_Message, issuer: string): void;
24
+
25
+ /**
26
+ * Clear the conversation history for an issuer
27
+ */
28
+ abstract clearHistory(issuer: string): void;
29
+
30
+ /**
31
+ * Get the conversation history for an issuer
32
+ */
33
+ abstract getHistory(issuer: string): DyFM_AI_Message[];
34
+
35
+ // Conversation methods (from OAI_LLMChat_ServiceBase)
36
+ abstract yesNoQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<boolean>;
37
+ abstract simpleQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<string>;
38
+ abstract percentageQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<number>;
39
+ abstract selectQuestionInConversation(set: DyFM_AI_ConversationSelect_Input): Promise<string>;
40
+ abstract requestSelectInConversation<T>(set: DyFM_AI_ConversationGenericSelect_Input<T>): Promise<T | { unparsableResult: string }>;
41
+ abstract multipleSelectQuestionInConversationWithOptions(set: DyFM_AI_ConversationMultiSelect_Input): Promise<string[]>;
42
+ abstract requestMultiselectInConversation<T>(set: DyFM_AI_ConversationGenericMultiSelect_Input<T>): Promise<T[]>;
43
+ abstract JSONQuestionInConversationWithKeysDescription(set: DyFM_AI_ConversationJSONKeysDescription_Input): Promise<object>;
44
+ abstract JSONQuestionInConversationWithExactKeys(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<object>;
45
+ abstract requestJSONInConversationWithExactKeys<T>(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<T>;
46
+ abstract getQuestionAnswerInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<string>;
47
+ abstract getAnswerInConversation(set: DyFM_AI_ConversationGetAnswer_Input): Promise<string>;
48
+ }
@@ -0,0 +1,81 @@
1
+ import { DyNTS_AI_Provider_ServiceBase } from './ai-provider.service-base';
2
+ import { DyFM_AI_CallSettings, DyFM_AI_Message, DyFM_AI_LLM_Response } from '@futdevpro/fsm-dynamo/ai';
3
+ import { DyFM_Error_Settings } from '@futdevpro/fsm-dynamo';
4
+ import {
5
+ DyFM_AI_Question_Input,
6
+ DyFM_AI_ListSelect_Input,
7
+ DyFM_AI_GenericSelect_Input,
8
+ DyFM_AI_MultiSelect_Input,
9
+ DyFM_AI_GenericMultiSelect_Input,
10
+ DyFM_AI_JSONKeysDescription_Input,
11
+ DyFM_AI_JSONExactKeys_Input,
12
+ DyFM_AI_SimpleMessage_Input
13
+ } from '../_models/ai-input-interfaces';
14
+
15
+ /**
16
+ * Abstract base class for LLM services
17
+ * Defines all methods that must be implemented by AI providers
18
+ */
19
+ export abstract class DyNTS_AI_LLM_ServiceBase extends DyNTS_AI_Provider_ServiceBase {
20
+ /** Default settings for LLM calls */
21
+ abstract readonly defaultSettings: DyFM_AI_CallSettings;
22
+
23
+ /** Default model to use for LLM calls */
24
+ abstract readonly defaultModel: string;
25
+
26
+ /** Provider-specific predefined requests */
27
+ abstract readonly predefinedRequests: any;
28
+
29
+ // Core abstract methods
30
+ /**
31
+ * Call LLM with system and user messages
32
+ */
33
+ abstract callLLM(
34
+ systemMessage: string,
35
+ userMessage: string,
36
+ settings?: DyFM_AI_CallSettings,
37
+ issuer?: string
38
+ ): Promise<string>;
39
+
40
+ /**
41
+ * Call LLM with message history
42
+ */
43
+ abstract callLLMWithHistory(
44
+ messages: DyFM_AI_Message[],
45
+ settings?: DyFM_AI_CallSettings,
46
+ issuer?: string
47
+ ): Promise<string>;
48
+
49
+ /**
50
+ * Call LLM and return raw response
51
+ */
52
+ abstract callLLMRaw(
53
+ messages: DyFM_AI_Message[],
54
+ settings?: DyFM_AI_CallSettings,
55
+ issuer?: string
56
+ ): Promise<DyFM_AI_LLM_Response>;
57
+
58
+ // Question methods (from OAI_LLM_ServiceBase)
59
+ abstract askQuestion(set: DyFM_AI_Question_Input): Promise<string>;
60
+ abstract askYesNoQuestion(set: DyFM_AI_Question_Input): Promise<boolean>;
61
+ abstract askPercentageQuestion(set: DyFM_AI_Question_Input): Promise<number>;
62
+ abstract askSelectQuestion(set: DyFM_AI_ListSelect_Input): Promise<string>;
63
+ abstract requestSelect<T>(set: DyFM_AI_GenericSelect_Input<T>): Promise<T | { unparsableResult: string }>;
64
+ abstract askMultipleSelectQuestionWithOptions(set: DyFM_AI_MultiSelect_Input): Promise<string[]>;
65
+ abstract requestMultiselect<T>(set: DyFM_AI_GenericMultiSelect_Input<T>): Promise<T[]>;
66
+ abstract askJSONQuestionWithKeysDescription(set: DyFM_AI_JSONKeysDescription_Input): Promise<object>;
67
+ abstract askJSONQuestionWithExactKeys(set: DyFM_AI_JSONExactKeys_Input): Promise<object>;
68
+ abstract requestJSONWithExactKeys<T>(set: DyFM_AI_JSONExactKeys_Input): Promise<T>;
69
+ abstract sendMessage(set: DyFM_AI_SimpleMessage_Input): Promise<string>;
70
+
71
+ // Helper methods
72
+ protected abstract getDefaultErrorSettings(
73
+ method: string,
74
+ error: any,
75
+ issuer?: string
76
+ ): DyFM_Error_Settings;
77
+
78
+ protected abstract getTextListAsText(list: string[]): string;
79
+
80
+ protected abstract logQuestion(set: any): void;
81
+ }
@@ -0,0 +1,28 @@
1
+ import { DyFM_AI_Provider } from '@futdevpro/fsm-dynamo/ai';
2
+ import { DyFM_AI_ProviderCapabilities } from '@futdevpro/fsm-dynamo/ai';
3
+ import { DyFM_AI_Config } from '@futdevpro/fsm-dynamo/ai';
4
+
5
+ /**
6
+ * Abstract base class for all AI providers
7
+ * Defines the common interface that all AI providers must implement
8
+ */
9
+ export abstract class DyNTS_AI_Provider_ServiceBase {
10
+ /** The AI provider this service represents */
11
+ abstract readonly provider: DyFM_AI_Provider;
12
+
13
+ /** The capabilities supported by this provider */
14
+ abstract readonly capabilities: DyFM_AI_ProviderCapabilities;
15
+
16
+ /**
17
+ * Initialize the provider with configuration
18
+ * @param config - Provider-specific configuration
19
+ */
20
+ abstract initialize(config: DyFM_AI_Config): void;
21
+
22
+ /**
23
+ * Test the connection to the AI provider
24
+ * @param issuer - The issuer making the request
25
+ * @returns Promise<boolean> - True if connection is successful
26
+ */
27
+ abstract testConnection(issuer: string): Promise<boolean>;
28
+ }
@@ -0,0 +1,11 @@
1
+ // Re-export from FSM
2
+ export * from '@futdevpro/fsm-dynamo/ai';
3
+
4
+ // AI Input Interfaces (moved from FSM)
5
+ export * from './_models/ai-input-interfaces';
6
+
7
+ // Abstract Services
8
+ export * from './_services/ai-provider.service-base';
9
+ export * from './_services/ai-llm.service-base';
10
+ export * from './_services/ai-llm-chat.service-base';
11
+ export * from './_services/ai-embedding.service-base';