@futdevpro/nts-dynamo 1.14.26 → 1.14.28

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 (214) hide show
  1. package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts +0 -17
  2. package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts.map +1 -1
  3. package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.js +42 -39
  4. package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.js.map +1 -1
  5. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts +0 -5
  6. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts.map +1 -1
  7. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js +6 -2
  8. package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js.map +1 -1
  9. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +26 -129
  10. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -1
  11. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js +25 -10
  12. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -1
  13. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +5 -5
  14. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
  15. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +3 -3
  16. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
  17. package/build/_modules/ai/_modules/open-ai/index.d.ts +0 -2
  18. package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -1
  19. package/build/_modules/ai/_modules/open-ai/index.js +2 -2
  20. package/build/_modules/ai/_modules/open-ai/index.js.map +1 -1
  21. package/build/_modules/assistant/_services/ass-io.control-service.d.ts +2 -2
  22. package/build/_modules/assistant/_services/ass-io.control-service.d.ts.map +1 -1
  23. package/build/_modules/assistant/_services/ass-main.control-service.d.ts +2 -2
  24. package/build/_modules/assistant/_services/ass-main.control-service.d.ts.map +1 -1
  25. package/build/_modules/assistant/_services/ass.service-base.d.ts +5 -5
  26. package/build/_modules/assistant/_services/ass.service-base.d.ts.map +1 -1
  27. package/build/_modules/assistant/_services/ass.service-base.js.map +1 -1
  28. package/build/_modules/bot/_collections/bot-operations.util.d.ts +13 -13
  29. package/build/_modules/bot/_collections/bot-operations.util.d.ts.map +1 -1
  30. package/build/_modules/bot/_collections/bot-operations.util.js.map +1 -1
  31. package/build/_modules/bot/_enums/bot-message-provider.enum.d.ts +1 -1
  32. package/build/_modules/bot/_enums/bot-message-provider.enum.d.ts.map +1 -1
  33. package/build/_modules/bot/_enums/bot-message-provider.enum.js +9 -9
  34. package/build/_modules/bot/_enums/bot-message-provider.enum.js.map +1 -1
  35. package/build/_modules/bot/_models/bot-channel.interface.d.ts +2 -2
  36. package/build/_modules/bot/_models/bot-channel.interface.d.ts.map +1 -1
  37. package/build/_modules/bot/_models/bot-command.interface.d.ts +3 -3
  38. package/build/_modules/bot/_models/bot-command.interface.d.ts.map +1 -1
  39. package/build/_modules/bot/_models/bot-global-settings.interface.d.ts +3 -3
  40. package/build/_modules/bot/_models/bot-global-settings.interface.d.ts.map +1 -1
  41. package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts +6 -6
  42. package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts.map +1 -1
  43. package/build/_modules/bot/_models/bot-message.interface.d.ts +2 -2
  44. package/build/_modules/bot/_models/bot-message.interface.d.ts.map +1 -1
  45. package/build/_modules/bot/_models/{bot-message-provider.interface.d.ts → bot-messaging-provider.interface.d.ts} +21 -21
  46. package/build/_modules/bot/_models/bot-messaging-provider.interface.d.ts.map +1 -0
  47. package/build/_modules/bot/_models/{bot-message-provider.interface.js → bot-messaging-provider.interface.js} +1 -1
  48. package/build/_modules/bot/_models/bot-messaging-provider.interface.js.map +1 -0
  49. package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts +2 -2
  50. package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts.map +1 -1
  51. package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts +2 -2
  52. package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts.map +1 -1
  53. package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js.map +1 -1
  54. package/build/_modules/bot/_modules/discord-bot/_services/{dib-message-provider.service.d.ts → dib-messaging-provider.service.d.ts} +4 -4
  55. package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.d.ts.map +1 -0
  56. package/build/_modules/bot/_modules/discord-bot/_services/{dib-message-provider.service.js → dib-messaging-provider.service.js} +5 -5
  57. package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.js.map +1 -0
  58. package/build/_modules/bot/_modules/discord-bot/index.d.ts +1 -1
  59. package/build/_modules/bot/_modules/discord-bot/index.d.ts.map +1 -1
  60. package/build/_modules/bot/_modules/discord-bot/index.js +1 -1
  61. package/build/_modules/bot/_modules/discord-bot/index.js.map +1 -1
  62. package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.d.ts +3 -3
  63. package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.d.ts.map +1 -1
  64. package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.js.map +1 -1
  65. package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts +2 -2
  66. package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts.map +1 -1
  67. package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.js.map +1 -1
  68. package/build/_modules/bot/_modules/dynamo-bot/_services/{dyb-message-provider.service.d.ts → dyb-messaging-provider.service.d.ts} +5 -5
  69. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.d.ts.map +1 -0
  70. package/build/_modules/bot/_modules/dynamo-bot/_services/{dyb-message-provider.service.js → dyb-messaging-provider.service.js} +5 -5
  71. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.js.map +1 -0
  72. package/build/_modules/bot/_modules/dynamo-bot/index.d.ts +1 -1
  73. package/build/_modules/bot/_modules/dynamo-bot/index.d.ts.map +1 -1
  74. package/build/_modules/bot/_modules/dynamo-bot/index.js +1 -1
  75. package/build/_modules/bot/_modules/dynamo-bot/index.js.map +1 -1
  76. package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts +2 -2
  77. package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts.map +1 -1
  78. package/build/_modules/bot/_modules/slack-bot/_services/{slb-message-provider.service.d.ts → slb-messaging-provider.service.d.ts} +4 -4
  79. package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.d.ts.map +1 -0
  80. package/build/_modules/bot/_modules/slack-bot/_services/{slb-message-provider.service.js → slb-messaging-provider.service.js} +5 -5
  81. package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.js.map +1 -0
  82. package/build/_modules/bot/_modules/slack-bot/index.d.ts +1 -1
  83. package/build/_modules/bot/_modules/slack-bot/index.d.ts.map +1 -1
  84. package/build/_modules/bot/_modules/slack-bot/index.js +1 -1
  85. package/build/_modules/bot/_modules/slack-bot/index.js.map +1 -1
  86. package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts +2 -2
  87. package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts.map +1 -1
  88. package/build/_modules/bot/_modules/teams-bot/_services/{teb-message-provider.service.d.ts → teb-messaging-provider.service.d.ts} +4 -4
  89. package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.d.ts.map +1 -0
  90. package/build/_modules/bot/_modules/teams-bot/_services/{teb-message-provider.service.js → teb-messaging-provider.service.js} +5 -5
  91. package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.js.map +1 -0
  92. package/build/_modules/bot/_modules/teams-bot/index.d.ts +1 -1
  93. package/build/_modules/bot/_modules/teams-bot/index.d.ts.map +1 -1
  94. package/build/_modules/bot/_modules/teams-bot/index.js +1 -1
  95. package/build/_modules/bot/_modules/teams-bot/index.js.map +1 -1
  96. package/build/_modules/bot/_services/bot-commands.control-service.d.ts +6 -6
  97. package/build/_modules/bot/_services/bot-commands.control-service.d.ts.map +1 -1
  98. package/build/_modules/bot/_services/bot-commands.control-service.js.map +1 -1
  99. package/build/_modules/bot/_services/bot-io.control-service.d.ts +12 -12
  100. package/build/_modules/bot/_services/bot-io.control-service.d.ts.map +1 -1
  101. package/build/_modules/bot/_services/bot-io.control-service.js +4 -18
  102. package/build/_modules/bot/_services/bot-io.control-service.js.map +1 -1
  103. package/build/_modules/bot/_services/bot-main.control-service.d.ts +16 -16
  104. package/build/_modules/bot/_services/bot-main.control-service.d.ts.map +1 -1
  105. package/build/_modules/bot/_services/bot-main.control-service.js +9 -3
  106. package/build/_modules/bot/_services/bot-main.control-service.js.map +1 -1
  107. package/build/_modules/bot/_services/bot-messaging-provider-factory.service.d.ts +6 -0
  108. package/build/_modules/bot/_services/bot-messaging-provider-factory.service.d.ts.map +1 -0
  109. package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js +47 -0
  110. package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js.map +1 -0
  111. package/build/_modules/bot/_services/bot-routines.control-service.d.ts +2 -2
  112. package/build/_modules/bot/_services/bot-routines.control-service.d.ts.map +1 -1
  113. package/build/_modules/bot/index.d.ts +2 -2
  114. package/build/_modules/bot/index.d.ts.map +1 -1
  115. package/build/_modules/bot/index.js +2 -2
  116. package/build/_modules/bot/index.js.map +1 -1
  117. package/build/_modules/discord-assistant/_collections/dias.util.d.ts +3 -3
  118. package/build/_modules/discord-assistant/_collections/dias.util.d.ts.map +1 -1
  119. package/build/_modules/discord-assistant/_collections/dias.util.js +4 -4
  120. package/build/_modules/discord-assistant/_collections/dias.util.js.map +1 -1
  121. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +4 -4
  122. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -1
  123. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
  124. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts +2 -2
  125. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts.map +1 -1
  126. package/build/_modules/discord-assistant/_services/dias.service-base.js.map +1 -1
  127. package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts.map +1 -1
  128. package/build/_modules/discord-bot/_services/dibo-main.control-service.js +2 -0
  129. package/build/_modules/discord-bot/_services/dibo-main.control-service.js.map +1 -1
  130. package/package.json +1 -1
  131. package/src/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +42 -42
  132. package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +6 -6
  133. package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +56 -158
  134. package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +8 -9
  135. package/src/_modules/ai/_modules/open-ai/index.ts +2 -2
  136. package/src/_modules/assistant/_services/ass-io.control-service.ts +3 -3
  137. package/src/_modules/assistant/_services/ass-main.control-service.ts +3 -3
  138. package/src/_modules/assistant/_services/ass.service-base.ts +15 -15
  139. package/src/_modules/bot/_collections/bot-operations.util.ts +14 -14
  140. package/src/_modules/bot/_enums/bot-message-provider.enum.ts +1 -1
  141. package/src/_modules/bot/_models/bot-channel.interface.ts +2 -2
  142. package/src/_modules/bot/_models/bot-command.interface.ts +3 -3
  143. package/src/_modules/bot/_models/bot-global-settings.interface.ts +3 -3
  144. package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +8 -7
  145. package/src/_modules/bot/_models/bot-message.interface.ts +2 -2
  146. package/src/_modules/bot/_models/{bot-message-provider.interface.ts → bot-messaging-provider.interface.ts} +23 -23
  147. package/src/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.ts +2 -2
  148. package/src/_modules/bot/_modules/discord-bot/_collections/dib.util.ts +2 -2
  149. package/src/_modules/bot/_modules/discord-bot/_services/{dib-message-provider.service.ts → dib-messaging-provider.service.ts} +6 -6
  150. package/src/_modules/bot/_modules/discord-bot/index.ts +1 -1
  151. package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.ts +3 -3
  152. package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.ts +2 -2
  153. package/src/_modules/bot/_modules/dynamo-bot/_services/{dyb-message-provider.service.ts → dyb-messaging-provider.service.ts} +7 -7
  154. package/src/_modules/bot/_modules/dynamo-bot/index.ts +1 -1
  155. package/src/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.ts +2 -2
  156. package/src/_modules/bot/_modules/slack-bot/_services/{slb-message-provider.service.ts → slb-messaging-provider.service.ts} +6 -6
  157. package/src/_modules/bot/_modules/slack-bot/index.ts +1 -1
  158. package/src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts +2 -2
  159. package/src/_modules/bot/_modules/teams-bot/_services/{teb-message-provider.service.ts → teb-messaging-provider.service.ts} +6 -6
  160. package/src/_modules/bot/_modules/teams-bot/index.ts +1 -1
  161. package/src/_modules/bot/_services/bot-commands.control-service.ts +14 -14
  162. package/src/_modules/bot/_services/bot-io.control-service.ts +21 -38
  163. package/src/_modules/bot/_services/bot-main.control-service.ts +56 -49
  164. package/src/_modules/bot/_services/bot-messaging-provider-factory.service.ts +56 -0
  165. package/src/_modules/bot/_services/bot-routines.control-service.ts +3 -3
  166. package/src/_modules/bot/index.ts +2 -2
  167. package/src/_modules/discord-assistant/_collections/dias.util.ts +6 -7
  168. package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +5 -5
  169. package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +2 -2
  170. package/src/_modules/discord-assistant/_services/dias.service-base.ts +2 -3
  171. package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +2 -0
  172. package/build/_modules/ai/_services/oai-to-ai-adapter.service.d.ts +0 -39
  173. package/build/_modules/ai/_services/oai-to-ai-adapter.service.d.ts.map +0 -1
  174. package/build/_modules/ai/_services/oai-to-ai-adapter.service.js +0 -218
  175. package/build/_modules/ai/_services/oai-to-ai-adapter.service.js.map +0 -1
  176. package/build/_modules/bot/_enums/bot-provider.enum.d.ts +0 -8
  177. package/build/_modules/bot/_enums/bot-provider.enum.d.ts.map +0 -1
  178. package/build/_modules/bot/_enums/bot-provider.enum.js +0 -12
  179. package/build/_modules/bot/_enums/bot-provider.enum.js.map +0 -1
  180. package/build/_modules/bot/_models/bot-message-provider.interface.d.ts.map +0 -1
  181. package/build/_modules/bot/_models/bot-message-provider.interface.js.map +0 -1
  182. package/build/_modules/bot/_models/bot-provider.interface.d.ts +0 -65
  183. package/build/_modules/bot/_models/bot-provider.interface.d.ts.map +0 -1
  184. package/build/_modules/bot/_models/bot-provider.interface.js +0 -3
  185. package/build/_modules/bot/_models/bot-provider.interface.js.map +0 -1
  186. package/build/_modules/bot/_modules/discord-bot/_services/dib-message-provider.service.d.ts.map +0 -1
  187. package/build/_modules/bot/_modules/discord-bot/_services/dib-message-provider.service.js.map +0 -1
  188. package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts +0 -53
  189. package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts.map +0 -1
  190. package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js +0 -369
  191. package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js.map +0 -1
  192. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-message-provider.service.d.ts.map +0 -1
  193. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-message-provider.service.js.map +0 -1
  194. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.d.ts +0 -54
  195. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.d.ts.map +0 -1
  196. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.js +0 -310
  197. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-provider.service.js.map +0 -1
  198. package/build/_modules/bot/_modules/slack-bot/_services/slb-message-provider.service.d.ts.map +0 -1
  199. package/build/_modules/bot/_modules/slack-bot/_services/slb-message-provider.service.js.map +0 -1
  200. package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts +0 -40
  201. package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts.map +0 -1
  202. package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js +0 -116
  203. package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js.map +0 -1
  204. package/build/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.d.ts.map +0 -1
  205. package/build/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.js.map +0 -1
  206. package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts +0 -40
  207. package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts.map +0 -1
  208. package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js +0 -116
  209. package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js.map +0 -1
  210. package/build/_modules/bot/_services/bot-provider-factory.service.d.ts +0 -6
  211. package/build/_modules/bot/_services/bot-provider-factory.service.d.ts.map +0 -1
  212. package/build/_modules/bot/_services/bot-provider-factory.service.js +0 -47
  213. package/build/_modules/bot/_services/bot-provider-factory.service.js.map +0 -1
  214. package/src/_modules/bot/_services/bot-provider-factory.service.ts +0 -56
@@ -2,16 +2,26 @@ import { OpenAI } from 'openai';
2
2
 
3
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_getLocalStackLocation, DyFM_Log, DyFM_notNull, DyFM_Object, DyFM_Array } from '@futdevpro/fsm-dynamo';
5
+ import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
5
6
 
6
7
  import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
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';
10
- import { DyNTS_OAI_GPT_Message_Role } from '../_enums/oai-gpt-message-role.enum';
10
+ import { DyFM_AI_MessageRole } from '@futdevpro/fsm-dynamo/ai';
11
11
  import { DyNTS_OAI_LLM_Predefined_Requests } from '../_models/interfaces/oai-llm-predefined-requests.interface';
12
12
  import { DyNTS_OAI_LLM_ServiceBase } from './oai-llm.service-base';
13
13
  import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
14
14
  import { DyNTS_AI_LLMChat_ServiceBase } from '../../../_services/ai-llm-chat.service-base';
15
+ import {
16
+ DyFM_AI_ConversationQuestion_Input,
17
+ DyFM_AI_ConversationSelect_Input,
18
+ DyFM_AI_ConversationGenericSelect_Input,
19
+ DyFM_AI_ConversationMultiSelect_Input,
20
+ DyFM_AI_ConversationGenericMultiSelect_Input,
21
+ DyFM_AI_ConversationJSONKeysDescription_Input,
22
+ DyFM_AI_ConversationJSONExactKeys_Input,
23
+ DyFM_AI_ConversationGetAnswer_Input
24
+ } from '../../../_models/ai-input-interfaces';
15
25
 
16
26
 
17
27
  /**
@@ -24,25 +34,27 @@ import { DyNTS_AI_LLMChat_ServiceBase } from '../../../_services/ai-llm-chat.ser
24
34
 
25
35
  // Di Dictionary DiModel DiEz DiAz
26
36
 
27
- export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /* implements DyNTS_AI_LLMChat_ServiceBase */ {
37
+ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
28
38
 
39
+ /**
40
+ * Converts generic AI messages to OpenAI-specific format
41
+ *
42
+ * Az generic AI üzeneteket OpenAI-specifikus formátumra alakítja át
43
+ */
44
+ private convertToOAIMessages(messages: DyFM_AI_Message[]): DyFM_AI_Message[] {
45
+ return messages.map(msg => ({
46
+ role: msg.role as unknown as DyFM_AI_MessageRole,
47
+ content: msg.content
48
+ }));
49
+ }
50
+
29
51
  /**
30
52
  * Asks the AI to answer a yes/no question
31
53
  *
32
54
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.yesNo.request} to ask the question,
33
55
  * and the {@link DyNTS_OAI_LLM_Predefined_Requests.yesNo.upperCaseYes} to check the answer
34
56
  */
35
- async yesNoQuestionInConversation(
36
- set: {
37
- conversation: DyNTS_OAI_GPT_Message[],
38
- question: string,
39
- issuer: string,
40
- settings?: DyFM_OAI_CallSettings,
41
- debugLog?: boolean,
42
- /** this is used to readably replace too long contents to eg '...' in logs */
43
- replaceThisInLog?: string,
44
- }
45
- ): Promise<boolean> {
57
+ async yesNoQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<boolean> {
46
58
  set.question += this.predefinedRequests.yesNo.request;
47
59
 
48
60
  this.logQuestion(set);
@@ -58,17 +70,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
58
70
  *
59
71
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.simpleQuestion} to ask the question
60
72
  */
61
- async simpleQuestionInConversation(
62
- set: {
63
- conversation: DyNTS_OAI_GPT_Message[],
64
- question: string,
65
- issuer: string,
66
- settings?: DyFM_OAI_CallSettings,
67
- debugLog?: boolean,
68
- /** this is used to readably replace too long contents to eg '...' in logs */
69
- replaceThisInLog?: string,
70
- }
71
- ): Promise<string> {
73
+ async simpleQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<string> {
72
74
  this.logQuestion(set);
73
75
 
74
76
  return await this.getQuestionAnswerInConversation(set);
@@ -80,17 +82,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
80
82
  *
81
83
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.percentageOnly} to ask the question
82
84
  */
83
- async percentageQuestionInConversation(
84
- set: {
85
- conversation: DyNTS_OAI_GPT_Message[],
86
- question: string,
87
- issuer: string,
88
- settings?: DyFM_OAI_CallSettings,
89
- debugLog?: boolean,
90
- /** this is used to readably replace too long contents to eg '...' in logs */
91
- replaceThisInLog?: string,
92
- }
93
- ): Promise<number> {
85
+ async percentageQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<number> {
94
86
  set.question += this.predefinedRequests.percentageOnly;
95
87
 
96
88
  this.logQuestion(set);
@@ -116,18 +108,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
116
108
  *
117
109
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.selectRequest} to ask the question
118
110
  */
119
- async selectQuestionInConversation(
120
- set: {
121
- conversation: DyNTS_OAI_GPT_Message[],
122
- question: string,
123
- selectFrom: string[],
124
- issuer: string,
125
- settings?: DyFM_OAI_CallSettings,
126
- debugLog?: boolean,
127
- /** this is used to readably replace too long contents to eg '...' in logs */
128
- replaceThisInLog?: string,
129
- }
130
- ): Promise<string> {
111
+ async selectQuestionInConversation(set: DyFM_AI_ConversationSelect_Input): Promise<string> {
131
112
  // replace the {{DyNTS_selectOptions}} with the list of options
132
113
  const selectQuestionAddition = this.predefinedRequests.selectRequest.replace(
133
114
  '{{DyNTS_selectOptions}}',
@@ -157,16 +138,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
157
138
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.selectRequest} to ask the question
158
139
  */
159
140
  async requestSelectInConversation<T>(
160
- set: {
161
- conversation: DyNTS_OAI_GPT_Message[],
162
- question: string,
163
- selectFrom: T[],
164
- issuer: string,
165
- settings?: DyFM_OAI_CallSettings,
166
- debugLog?: boolean,
167
- /** this is used to readably replace too long contents to eg '...' in logs */
168
- replaceThisInLog?: string,
169
- }
141
+ set: DyFM_AI_ConversationGenericSelect_Input<T>
170
142
  ): Promise<T | { unparsableResult: string }> {
171
143
  const selectQuestionAddition = this.predefinedRequests.selectRequest.replace(
172
144
  '{{DyNTS_selectOptions}}',
@@ -187,18 +159,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
187
159
  *
188
160
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
189
161
  */
190
- async multipleSelectQuestionWithOptionsInConversation(
191
- set: {
192
- conversation: DyNTS_OAI_GPT_Message[],
193
- question: string,
194
- options: string[],
195
- issuer: string,
196
- settings?: DyFM_OAI_CallSettings,
197
- debugLog?: boolean,
198
- /** this is used to readably replace too long contents to eg '...' in logs */
199
- replaceThisInLog?: string,
200
- }
201
- ): Promise<string[]> {
162
+ async multipleSelectQuestionWithOptionsInConversation(set: DyFM_AI_ConversationMultiSelect_Input): Promise<string[]> {
202
163
  const selectQuestionAddition = this.predefinedRequests.multiselect.replace(
203
164
  '{{DyNTS_selectOptions}}',
204
165
  this.getTextListAsText(set.options)
@@ -229,16 +190,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
229
190
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
230
191
  */
231
192
  async requestMultipleSelectInConversation<T>(
232
- set: {
233
- conversation: DyNTS_OAI_GPT_Message[],
234
- question: string,
235
- options: T[],
236
- issuer: string,
237
- settings?: DyFM_OAI_CallSettings,
238
- debugLog?: boolean,
239
- /** this is used to readably replace too long contents to eg '...' in logs */
240
- replaceThisInLog?: string,
241
- }
193
+ set: DyFM_AI_ConversationGenericMultiSelect_Input<T>
242
194
  ): Promise<T[]> {
243
195
  const selectQuestionAddition = this.predefinedRequests.multiselect.replace(
244
196
  '{{DyNTS_selectOptions}}',
@@ -263,17 +215,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
263
215
  *
264
216
  * (uses {@link DyFM_safeParseJSON})
265
217
  */
266
- async jsonQuestionInConversation<T = any>(
267
- set: {
268
- conversation: DyNTS_OAI_GPT_Message[],
269
- question: string,
270
- issuer: string,
271
- settings?: DyFM_OAI_CallSettings,
272
- debugLog?: boolean,
273
- /** this is used to readably replace too long contents to eg '...' in logs */
274
- replaceThisInLog?: string,
275
- }
276
- ): Promise<T | { unparsableResult: string }> {
218
+ async jsonQuestionInConversation<T = any>(set: DyFM_AI_ConversationQuestion_Input): Promise<T | { unparsableResult: string }> {
277
219
  set.question += this.predefinedRequests.jsonRequest;
278
220
 
279
221
  this.logQuestion(set);
@@ -294,16 +236,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
294
236
  * (uses {@link DyFM_safeParseJSON})
295
237
  */
296
238
  async jsonQuestionWithKeysDescriptionInConversation<T = any>(
297
- set: {
298
- conversation: DyNTS_OAI_GPT_Message[],
299
- question: string,
300
- keysDescription: string,
301
- issuer: string,
302
- settings?: DyFM_OAI_CallSettings,
303
- debugLog?: boolean,
304
- /** this is used to readably replace too long contents to eg '...' in logs */
305
- replaceThisInLog?: string,
306
- }
239
+ set: DyFM_AI_ConversationJSONKeysDescription_Input
307
240
  ): Promise<T | { unparsableResult: string }> {
308
241
  const jsonRequestWithKeysDescription = this.predefinedRequests.jsonRequestWithKeysDescription.replace(
309
242
  '{{DyNTS_jsonKeysDescription}}',
@@ -329,16 +262,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
329
262
  * (uses {@link DyFM_safeParseJSON})
330
263
  */
331
264
  async jsonQuestionWithExactKeysInConversation<T = any>(
332
- set: {
333
- conversation: DyNTS_OAI_GPT_Message[],
334
- question: string,
335
- keys: string[],
336
- issuer: string,
337
- settings?: DyFM_OAI_CallSettings,
338
- debugLog?: boolean,
339
- /** this is used to readably replace too long contents to eg '...' in logs */
340
- replaceThisInLog?: string,
341
- }
265
+ set: DyFM_AI_ConversationJSONExactKeys_Input
342
266
  ): Promise<T | { unparsableResult: string }> {
343
267
  const jsonRequestWithExactKeys = this.predefinedRequests.jsonRequestWithExactKeys.replace(
344
268
  '{{DyNTS_jsonKeys}}',
@@ -363,17 +287,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
363
287
  *
364
288
  * (uses {@link DyFM_Object.safeParseList})
365
289
  */
366
- async listQuestionInConversation(
367
- set: {
368
- conversation: DyNTS_OAI_GPT_Message[],
369
- question: string,
370
- issuer: string,
371
- settings?: DyFM_OAI_CallSettings,
372
- debugLog?: boolean,
373
- /** this is used to readably replace too long contents to eg '...' in logs */
374
- replaceThisInLog?: string,
375
- }
376
- ): Promise<string[]> {
290
+ async listQuestionInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<string[]> {
377
291
  set.question += this.predefinedRequests.listRequest;
378
292
 
379
293
  this.logQuestion(set);
@@ -390,7 +304,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
390
304
  * Uses the {@link resolveSimpleUserMessage}
391
305
  */
392
306
  /* async getQuestionAnswerInConversation(
393
- conversation: DyNTS_OAI_GPT_Message[],
307
+ conversation: DyFM_AI_Message[],
394
308
  question: string,
395
309
  issuer: string,
396
310
  debugLog?: boolean,
@@ -410,17 +324,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
410
324
  return answer;
411
325
  } */
412
326
 
413
- async getQuestionAnswerInConversation(
414
- set: {
415
- conversation: DyNTS_OAI_GPT_Message[],
416
- question?: string,
417
- issuer: string,
418
- settings?: DyFM_OAI_CallSettings,
419
- debugLog?: boolean,
420
- /** this is used to readably replace too long contents to eg '...' in logs */
421
- replaceThisInLog?: string,
422
- }
423
- ): Promise<string> {
327
+ async getQuestionAnswerInConversation(set: DyFM_AI_ConversationQuestion_Input): Promise<string> {
424
328
  return await this.getAnswerInConversation({
425
329
  ...set,
426
330
  newMessage: set.question,
@@ -438,27 +342,21 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
438
342
  *
439
343
  * Uses the {@link resolveConversation}
440
344
  */
441
- async getAnswerInConversation(
442
- set: {
443
- conversation: DyNTS_OAI_GPT_Message[],
444
- newMessage?: string,
445
- issuer: string,
446
- settings?: DyFM_OAI_CallSettings,
447
- debugLog?: boolean,
448
- /** this is used to readably replace too long contents to eg '...' in logs */
449
- replaceThisInLog?: string,
450
- }
451
- ): Promise<string> {
452
- if (set.newMessage) {
453
- set.conversation = DyFM_Object.clone(set.conversation);
345
+ async getAnswerInConversation(set: DyFM_AI_ConversationGetAnswer_Input): Promise<string> {
346
+ // Convert generic AI messages to OpenAI-specific format
347
+ const oaiConversation = this.convertToOAIMessages(set.conversation);
454
348
 
455
- set.conversation.push({
456
- role: DyNTS_OAI_GPT_Message_Role.user,
349
+ if (set.newMessage) {
350
+ oaiConversation.push({
351
+ role: DyFM_AI_MessageRole.user,
457
352
  content: set.newMessage,
458
353
  });
459
354
  }
460
355
 
461
- const answer: string = await this.resolveConversationMessage(set);
356
+ const answer: string = await this.resolveConversationMessage({
357
+ ...set,
358
+ conversation: oaiConversation,
359
+ });
462
360
 
463
361
  if (set.debugLog || this.debugLog) {
464
362
  console.log(' - answer: ', answer);
@@ -469,7 +367,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
469
367
 
470
368
  async resolveConversationMessage(
471
369
  set: {
472
- conversation: DyNTS_OAI_GPT_Message[],
370
+ conversation: DyFM_AI_Message[],
473
371
  issuer: string,
474
372
  settings?: DyFM_OAI_CallSettings,
475
373
  getFullResponse?: boolean,
@@ -488,7 +386,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
488
386
  */
489
387
  async resolveConversation(
490
388
  set: {
491
- conversation: DyNTS_OAI_GPT_Message[],
389
+ conversation: DyFM_AI_Message[],
492
390
  issuer: string,
493
391
  settings?: DyFM_OAI_CallSettings,
494
392
  getFullResponse?: boolean,
@@ -498,7 +396,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
498
396
  }
499
397
  ): Promise<string | ChatCompletion> {
500
398
  try {
501
- if (set.conversation.find(message => message.role === DyNTS_OAI_GPT_Message_Role.system)) {
399
+ if (set.conversation.find(message => message.role === DyFM_AI_MessageRole.system)) {
502
400
  /* throw new DyFM_Error({
503
401
  ...this.getDefaultErrorSettings(
504
402
  'resolveConversation',
@@ -548,19 +446,19 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
548
446
 
549
447
  protected shortenConversation(
550
448
  set: {
551
- conversation: DyNTS_OAI_GPT_Message[],
449
+ conversation: DyFM_AI_Message[],
552
450
  issuer: string,
553
451
  debugLog?: boolean,
554
452
  }
555
- ): DyNTS_OAI_GPT_Message[] {
453
+ ): DyFM_AI_Message[] {
556
454
  try {
557
455
  const clonedConversation = DyFM_Object.clone(set.conversation);
558
456
  const systemMessages = clonedConversation.filter(
559
- message => message.role === DyNTS_OAI_GPT_Message_Role.system
457
+ message => message.role === DyFM_AI_MessageRole.system
560
458
  );
561
459
  const systemMessagesStringLength = JSON.stringify(systemMessages).length;
562
460
  const msgs: string[] = clonedConversation.filter(
563
- message => message.role !== DyNTS_OAI_GPT_Message_Role.system
461
+ message => message.role !== DyFM_AI_MessageRole.system
564
462
  ).map(message => message.content);
565
463
  let stringifiedMessages = JSON.stringify(msgs);
566
464
 
@@ -622,7 +520,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase /*
622
520
 
623
521
  protected logConversation(
624
522
  set: {
625
- conversation: DyNTS_OAI_GPT_Message[],
523
+ conversation: DyFM_AI_Message[],
626
524
  debugLog?: boolean,
627
525
  /** this is used to readably replace too long contents to eg '...' in logs */
628
526
  replaceThisInLog?: string,
@@ -4,10 +4,9 @@ import { DyFM_OAI_Settings, DyFM_OAI_Model, DyFM_OAI_CallSettings } from '@futde
4
4
  import { DyFM_AnyError, DyFM_Error, DyFM_Error_Settings, DyFM_Log, DyFM_notNull, DyFM_Object } from '@futdevpro/fsm-dynamo';
5
5
 
6
6
  import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
7
- import { DyNTS_OAI_GPT_Message } from '../_models/interfaces/oai-gpt-message.interface';
7
+ import { DyFM_AI_Message, DyFM_AI_MessageRole } from '@futdevpro/fsm-dynamo/ai';
8
8
  import { ChatCompletion } from 'openai/resources';
9
9
  import { ChatCompletionCreateParamsBase, ChatCompletionMessageParam } from 'openai/resources/chat/completions';
10
- import { DyNTS_OAI_GPT_Message_Role } from '../_enums/oai-gpt-message-role.enum';
11
10
  import { DyNTS_OAI_LLM_Predefined_Requests } from '../_models/interfaces/oai-llm-predefined-requests.interface';
12
11
  import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
13
12
  import { DyNTS_OAI_LLMDefaultPredefined_Requests } from '../_collections/oai-llm-predefined-requests.conts';
@@ -458,7 +457,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
458
457
  }
459
458
  ): Promise<string> {
460
459
  return this.resolveMessage({
461
- conversation: [{ role: DyNTS_OAI_GPT_Message_Role.user, content: set.message }],
460
+ conversation: [{ role: DyFM_AI_MessageRole.user, content: set.message }],
462
461
  issuer: set.issuer,
463
462
  settings: set.settings,
464
463
  getFullResponse: false,
@@ -476,7 +475,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
476
475
  */
477
476
  async resolveMessage(
478
477
  set: {
479
- conversation: DyNTS_OAI_GPT_Message[],
478
+ conversation: DyFM_AI_Message[],
480
479
  issuer: string,
481
480
  settings?: DyFM_OAI_CallSettings,
482
481
  getFullResponse?: boolean
@@ -545,7 +544,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
545
544
  */
546
545
  protected getMessageCreateInput(
547
546
  set: {
548
- conversation: DyNTS_OAI_GPT_Message[],
547
+ conversation: DyFM_AI_Message[],
549
548
  issuer: string,
550
549
  settings?: DyFM_OAI_CallSettings
551
550
  }
@@ -591,15 +590,15 @@ export class DyNTS_OAI_LLM_ServiceBase {
591
590
  }
592
591
  }
593
592
 
594
- protected getDefaultSystemMessage(settings: DyFM_OAI_CallSettings): DyNTS_OAI_GPT_Message {
593
+ protected getDefaultSystemMessage(settings: DyFM_OAI_CallSettings): DyFM_AI_Message {
595
594
  return {
596
- role: DyNTS_OAI_GPT_Message_Role.system,
595
+ role: DyFM_AI_MessageRole.system,
597
596
  content: settings?.systemPrompt || this.defaultSystemPrompt,
598
597
  };
599
598
  }
600
599
 
601
- protected validateConversation(conversation: DyNTS_OAI_GPT_Message[]): void {
602
- conversation.forEach((message: DyNTS_OAI_GPT_Message, index: number) => {
600
+ protected validateConversation(conversation: DyFM_AI_Message[]): void {
601
+ conversation.forEach((message: DyFM_AI_Message, index: number) => {
603
602
  if (!message.role) {
604
603
  throw new DyFM_Error({
605
604
  message: `Message has no role at index ${index}`,
@@ -39,7 +39,7 @@ export * from './_collections/oai-llm-predefined-requests-hu.conts';
39
39
 
40
40
  // ENUMS
41
41
  //export * from './_enums/oai-compare-result-type.enum';
42
- export * from './_enums/oai-gpt-message-role.enum';
42
+ /* export * from './_enums/oai-gpt-message-role.enum'; */
43
43
 
44
44
 
45
45
  // MODELS
@@ -50,7 +50,7 @@ export * from './_enums/oai-gpt-message-role.enum';
50
50
  export * from '../document-ai/_models/interfaces/dai-doc-page-compare-result.interface'; */
51
51
  /* export * from '../document-ai/_models/interfaces/oai-document-page.interface'; */
52
52
  export * from './_models/interfaces/oai-global-settings.interface';
53
- export * from './_models/interfaces/oai-gpt-message.interface';
53
+ /* export * from './_models/interfaces/oai-gpt-message.interface'; */
54
54
  export * from './_models/interfaces/oai-llm-predefined-requests.interface';
55
55
  /* export * from '../document-ai/_models/interfaces/dai-doc-page-compare-result.interface'; */
56
56
 
@@ -5,7 +5,7 @@ import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
5
5
  import { DyNTS_Bot_MessageWrapper } from '../../bot/_models/bot-message-wrapper.interface';
6
6
  import { DyNTS_Bot_Channel } from '../../bot/_models/bot-channel.interface';
7
7
  import { DyNTS_Bot_User } from '../../bot/_models/bot-user.interface';
8
- import { DyNTS_Bot_MessageProvider } from '../../bot/_models/bot-message-provider.interface';
8
+ import { DyNTS_Bot_MessagingProvider } from '../../bot/_models/bot-messaging-provider.interface';
9
9
  import { DyNTS_Ass_Main_ControlService } from './ass-main.control-service';
10
10
  import { DyNTS_Ass_Util } from '../_collections/ass.util';
11
11
  import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
@@ -20,11 +20,11 @@ export abstract class DyNTS_Ass_IO_ControlService<
20
20
  T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
21
21
  T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
22
22
  T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
23
- T_CommsProvider extends DyNTS_Bot_MessageProvider<
23
+ T_CommsProvider extends DyNTS_Bot_MessagingProvider<
24
24
  T_PlatformChannel,
25
25
  T_PlatformMessage,
26
26
  T_PlatformUser
27
- > = DyNTS_Bot_MessageProvider<
27
+ > = DyNTS_Bot_MessagingProvider<
28
28
  T_PlatformChannel,
29
29
  T_PlatformMessage,
30
30
  T_PlatformUser
@@ -3,7 +3,7 @@ import { DyNTS_Ass_IO_ControlService } from './ass-io.control-service';
3
3
  import { DyNTS_Bot_Channel } from '../../bot/_models/bot-channel.interface';
4
4
  import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
5
5
  import { DyNTS_Bot_User } from '../../bot/_models/bot-user.interface';
6
- import { DyNTS_Bot_MessageProvider } from '../../bot/_models/bot-message-provider.interface';
6
+ import { DyNTS_Bot_MessagingProvider } from '../../bot/_models/bot-messaging-provider.interface';
7
7
 
8
8
  /**
9
9
  * Assistant Main Control Service
@@ -13,11 +13,11 @@ export abstract class DyNTS_Ass_Main_ControlService<
13
13
  T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
14
14
  T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
15
15
  T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
16
- T_CommsProvider extends DyNTS_Bot_MessageProvider<
16
+ T_CommsProvider extends DyNTS_Bot_MessagingProvider<
17
17
  T_PlatformChannel,
18
18
  T_PlatformMessage,
19
19
  T_PlatformUser
20
- > = DyNTS_Bot_MessageProvider<
20
+ > = DyNTS_Bot_MessagingProvider<
21
21
  T_PlatformChannel,
22
22
  T_PlatformMessage,
23
23
  T_PlatformUser
@@ -3,7 +3,7 @@ import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
3
3
  import { DyNTS_Bot_MessageWrapper } from '../../bot/_models/bot-message-wrapper.interface';
4
4
  import { DyNTS_Bot_Channel } from '../../bot/_models/bot-channel.interface';
5
5
  import { DyNTS_Bot_User } from '../../bot/_models/bot-user.interface';
6
- import { DyNTS_Bot_MessageProvider } from '../../bot/_models/bot-message-provider.interface';
6
+ import { DyNTS_Bot_MessagingProvider } from '../../bot/_models/bot-messaging-provider.interface';
7
7
  import { DyNTS_AI_LLMChat_ServiceBase } from '../../ai/_services/ai-llm-chat.service-base';
8
8
  import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
9
9
  import { DyNTS_Ass_global_settings } from '../_collections/ass-global-settings.const';
@@ -17,11 +17,11 @@ import { DyNTS_Ass_IO_ControlService } from './ass-io.control-service';
17
17
  * USES EXISTING AI ABSTRACTIONS - no duplication
18
18
  */
19
19
  export abstract class DyNTS_Ass_ServiceBase<
20
- T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
21
- T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
22
- T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
23
- T_CommsProvider extends DyNTS_Bot_MessageProvider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser> = DyNTS_Bot_MessageProvider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser>
24
- > extends DyNTS_Bot_Main_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_CommsProvider> {
20
+ T_MessagePlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
21
+ T_MessagePlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
22
+ T_MessagePlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
23
+ T_MessageProvider extends DyNTS_Bot_MessagingProvider<T_MessagePlatformChannel, T_MessagePlatformMessage, T_MessagePlatformUser> = DyNTS_Bot_MessagingProvider<T_MessagePlatformChannel, T_MessagePlatformMessage, T_MessagePlatformUser>
24
+ > extends DyNTS_Bot_Main_ControlService<T_MessagePlatformChannel, T_MessagePlatformMessage, T_MessagePlatformUser, T_MessageProvider> {
25
25
 
26
26
  // AI Provider - uses EXISTING abstraction
27
27
  protected _aiProvider: DyNTS_AI_LLMChat_ServiceBase;
@@ -34,10 +34,10 @@ export abstract class DyNTS_Ass_ServiceBase<
34
34
 
35
35
  // Override botIO to use assistant IO
36
36
  protected abstract override getBotIOControlService(): DyNTS_Ass_IO_ControlService<
37
- T_PlatformChannel,
38
- T_PlatformMessage,
39
- T_PlatformUser,
40
- T_CommsProvider
37
+ T_MessagePlatformChannel,
38
+ T_MessagePlatformMessage,
39
+ T_MessagePlatformUser,
40
+ T_MessageProvider
41
41
  >;
42
42
 
43
43
  // Assistant-specific settings
@@ -64,10 +64,10 @@ export abstract class DyNTS_Ass_ServiceBase<
64
64
  * Now uses wrapper's provider to ensure messages from correct platform
65
65
  */
66
66
  async gatherMessagesForMessage(
67
- message: T_PlatformMessage,
68
- wrapper: DyNTS_Bot_MessageWrapper<T_PlatformMessage>,
67
+ message: T_MessagePlatformMessage,
68
+ wrapper: DyNTS_Bot_MessageWrapper<T_MessagePlatformMessage>,
69
69
  limit: number = 100
70
- ): Promise<T_PlatformMessage[]> {
70
+ ): Promise<T_MessagePlatformMessage[]> {
71
71
  const channelId = message.channelId;
72
72
  // Use wrapper's provider to fetch messages from the correct platform
73
73
  const messages = await wrapper.provider.fetchMessages(channelId, limit);
@@ -84,8 +84,8 @@ export abstract class DyNTS_Ass_ServiceBase<
84
84
  * Convert gathered messages to AI conversation using EXISTING DyFM_AI_Message
85
85
  */
86
86
  async gatherMessagesAsAIConversation(
87
- message: T_PlatformMessage,
88
- wrapper: DyNTS_Bot_MessageWrapper<T_PlatformMessage>,
87
+ message: T_MessagePlatformMessage,
88
+ wrapper: DyNTS_Bot_MessageWrapper<T_MessagePlatformMessage>,
89
89
  issuer: string,
90
90
  ): Promise<DyFM_AI_Message[]> {
91
91
  const messages = await this.gatherMessagesForMessage(message, wrapper);