@futdevpro/nts-dynamo 1.14.28 → 1.14.31
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.
- package/build/_modules/ai/_modules/open-ai/_services/{oai-doc-chunk-data.service.d.ts → data-services/oai-doc-chunk-data.service.d.ts} +4 -4
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/{oai-doc-chunk-data.service.js → data-services/oai-doc-chunk-data.service.js} +4 -4
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/{oai-doc-page.data-service.d.ts → data-services/oai-doc-page.data-service.d.ts} +5 -5
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/{oai-doc-page.data-service.js → data-services/oai-doc-page.data-service.js} +3 -3
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/{oai-document.data-service.d.ts → data-services/oai-document.data-service.d.ts} +5 -5
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/{oai-document.data-service.js → data-services/oai-document.data-service.js} +3 -3
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/{oai-vector-data.service.d.ts → data-services/oai-vector-data.service.d.ts} +2 -2
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/{oai-vector-data.service.js → data-services/oai-vector-data.service.js} +3 -3
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts +9 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js +14 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +49 -3
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js +72 -2
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +61 -6
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +207 -16
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/index.d.ts +4 -4
- package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/index.js +6 -5
- package/build/_modules/ai/_modules/open-ai/index.js.map +1 -1
- package/build/_modules/ai/_services/ai-llm.service-base.d.ts +0 -2
- package/build/_modules/ai/_services/ai-llm.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_services/ai-provider.service-base.d.ts +2 -1
- package/build/_modules/ai/_services/ai-provider.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_services/ai-provider.service-base.js +2 -1
- package/build/_modules/ai/_services/ai-provider.service-base.js.map +1 -1
- package/build/_modules/assistant/_collections/ass.util.d.ts +2 -2
- package/build/_modules/assistant/_collections/ass.util.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts +5 -9
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass-io.control-service.js +9 -10
- package/build/_modules/assistant/_services/ass-io.control-service.js.map +1 -1
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts +26 -10
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass-main.control-service.js +49 -4
- package/build/_modules/assistant/_services/ass-main.control-service.js.map +1 -1
- package/build/_modules/assistant/index.d.ts +1 -1
- package/build/_modules/assistant/index.d.ts.map +1 -1
- package/build/_modules/assistant/index.js +1 -1
- package/build/_modules/assistant/index.js.map +1 -1
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.d.ts +17 -0
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/{bot-message.interface.js → bot-channel-wrapper.interface.js} +1 -1
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-command.interface.d.ts +2 -2
- package/build/_modules/bot/_models/bot-command.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts +1 -1
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts +16 -13
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-user-wrapper.interface.d.ts +17 -0
- package/build/_modules/bot/_models/bot-user-wrapper.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/{bot-channel.interface.js → bot-user-wrapper.interface.js} +1 -1
- package/build/_modules/bot/_models/bot-user-wrapper.interface.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts +0 -7
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js +10 -2
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.d.ts +67 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.js +391 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/index.d.ts +1 -4
- package/build/_modules/bot/_modules/discord-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/index.js +2 -5
- package/build/_modules/bot/_modules/discord-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.d.ts +3 -3
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.js +2 -2
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.js.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.d.ts +59 -0
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/dynamo-bot/_services/{dyb-messaging-provider.service.js → dyb-messaging-provider.control-service.js} +130 -108
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/dynamo-bot/index.d.ts +1 -2
- package/build/_modules/bot/_modules/dynamo-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/index.js +1 -2
- package/build/_modules/bot/_modules/dynamo-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.d.ts +55 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.js +132 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/index.d.ts +1 -2
- package/build/_modules/bot/_modules/slack-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/index.js +1 -3
- package/build/_modules/bot/_modules/slack-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.d.ts +55 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.js +132 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/index.d.ts +1 -2
- package/build/_modules/bot/_modules/teams-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/index.js +1 -3
- package/build/_modules/bot/_modules/teams-bot/index.js.map +1 -1
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts +8 -11
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-commands.control-service.js +60 -15
- package/build/_modules/bot/_services/bot-commands.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-io.control-service.d.ts +16 -17
- package/build/_modules/bot/_services/bot-io.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-io.control-service.js +60 -51
- package/build/_modules/bot/_services/bot-io.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-main.control-service.d.ts +17 -37
- package/build/_modules/bot/_services/bot-main.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-main.control-service.js +107 -263
- package/build/_modules/bot/_services/bot-main.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.d.ts +70 -0
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.js +16 -0
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.js.map +1 -0
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts +6 -9
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-routines.control-service.js +29 -9
- package/build/_modules/bot/_services/bot-routines.control-service.js.map +1 -1
- package/build/_modules/bot/index.d.ts +3 -7
- package/build/_modules/bot/index.d.ts.map +1 -1
- package/build/_modules/bot/index.js +9 -7
- package/build/_modules/bot/index.js.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
- package/build/_modules/messaging/_collections/msg-global-settings.const.d.ts.map +1 -1
- package/build/_modules/messaging/_collections/msg-global-settings.const.js +0 -5
- package/build/_modules/messaging/_collections/msg-global-settings.const.js.map +1 -1
- package/build/_modules/messaging/_collections/msg.util.d.ts +2 -2
- package/build/_modules/messaging/_collections/msg.util.d.ts.map +1 -1
- package/build/_modules/messaging/_collections/msg.util.js.map +1 -1
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts +0 -9
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts.map +1 -1
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts +0 -25
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts.map +1 -1
- package/build/_modules/messaging/_services/msg-integration.control-service.js +180 -125
- package/build/_modules/messaging/_services/msg-integration.control-service.js.map +1 -1
- package/build/_modules/messaging/index.d.ts +0 -1
- package/build/_modules/messaging/index.d.ts.map +1 -1
- package/build/_modules/messaging/index.js +1 -1
- package/build/_modules/messaging/index.js.map +1 -1
- package/package.json +1 -1
- package/src/_modules/ai/_modules/open-ai/_services/{oai-doc-chunk-data.service.ts → data-services/oai-doc-chunk-data.service.ts} +8 -8
- package/src/_modules/ai/_modules/open-ai/_services/{oai-doc-page.data-service.ts → data-services/oai-doc-page.data-service.ts} +8 -8
- package/src/_modules/ai/_modules/open-ai/_services/{oai-document.data-service.ts → data-services/oai-document.data-service.ts} +7 -7
- package/src/_modules/ai/_modules/open-ai/_services/{oai-vector-data.service.ts → data-services/oai-vector-data.service.ts} +4 -4
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts +18 -2
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +84 -3
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +243 -8
- package/src/_modules/ai/_modules/open-ai/index.ts +6 -5
- package/src/_modules/ai/_services/ai-llm.service-base.ts +2 -2
- package/src/_modules/ai/_services/ai-provider.service-base.ts +2 -1
- package/src/_modules/assistant/_collections/ass.util.ts +2 -2
- package/src/_modules/assistant/_services/ass-io.control-service.ts +17 -48
- package/src/_modules/assistant/_services/ass-main.control-service.ts +83 -32
- package/src/_modules/assistant/index.ts +1 -1
- package/src/_modules/bot/_models/bot-channel-wrapper.interface.ts +24 -0
- package/src/_modules/bot/_models/bot-command.interface.ts +2 -2
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +1 -1
- package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +18 -18
- package/src/_modules/bot/_models/bot-user-wrapper.interface.ts +35 -0
- package/src/_modules/bot/_modules/discord-bot/_models/dib-platform.types.ts +8 -7
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.ts +521 -0
- package/src/_modules/bot/_modules/discord-bot/index.ts +2 -5
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.ts +8 -5
- package/src/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.ts +6 -6
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.ts +431 -0
- package/src/_modules/bot/_modules/dynamo-bot/index.ts +1 -2
- package/src/_modules/bot/_modules/slack-bot/_models/slb-platform.types.ts +6 -6
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.ts +186 -0
- package/src/_modules/bot/_modules/slack-bot/index.ts +1 -3
- package/src/_modules/bot/_modules/teams-bot/_models/teb-platform.types.ts +6 -6
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.ts +186 -0
- package/src/_modules/bot/_modules/teams-bot/index.ts +1 -4
- package/src/_modules/bot/_services/bot-commands.control-service.ts +64 -34
- package/src/_modules/bot/_services/bot-io.control-service.ts +86 -95
- package/src/_modules/bot/_services/bot-main.control-service.ts +249 -240
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.ts +152 -0
- package/src/_modules/bot/_services/bot-routines.control-service.ts +39 -44
- package/src/_modules/bot/index.ts +9 -7
- package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +1 -1
- package/src/_modules/messaging/README.md +2 -7
- package/src/_modules/messaging/_collections/msg-global-settings.const.ts +0 -6
- package/src/_modules/messaging/_collections/msg.util.ts +2 -2
- package/src/_modules/messaging/_models/msg-global-settings.interface.ts +0 -12
- package/src/_modules/messaging/_services/msg-integration.control-service.ts +180 -179
- package/src/_modules/messaging/index.ts +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.js.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.js.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.js.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.js.map +0 -1
- package/build/_modules/assistant/_services/ass.service-base.d.ts +0 -33
- package/build/_modules/assistant/_services/ass.service-base.d.ts.map +0 -1
- package/build/_modules/assistant/_services/ass.service-base.js +0 -58
- package/build/_modules/assistant/_services/ass.service-base.js.map +0 -1
- package/build/_modules/bot/_collections/bot-operations.util.d.ts +0 -21
- package/build/_modules/bot/_collections/bot-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_collections/bot-operations.util.js +0 -74
- package/build/_modules/bot/_collections/bot-operations.util.js.map +0 -1
- package/build/_modules/bot/_models/bot-channel.interface.d.ts +0 -8
- package/build/_modules/bot/_models/bot-channel.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-channel.interface.js.map +0 -1
- package/build/_modules/bot/_models/bot-message.interface.d.ts +0 -15
- package/build/_modules/bot/_models/bot-message.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-message.interface.js.map +0 -1
- package/build/_modules/bot/_models/bot-messaging-provider.interface.d.ts +0 -68
- package/build/_modules/bot/_models/bot-messaging-provider.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-messaging-provider.interface.js +0 -3
- package/build/_modules/bot/_models/bot-messaging-provider.interface.js.map +0 -1
- package/build/_modules/bot/_models/bot-user.interface.d.ts +0 -8
- package/build/_modules/bot/_models/bot-user.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-user.interface.js +0 -3
- package/build/_modules/bot/_models/bot-user.interface.js.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts +0 -11
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js +0 -13
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts +0 -5
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js +0 -19
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.d.ts +0 -56
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.js +0 -379
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts +0 -5
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.js +0 -26
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.js.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.d.ts +0 -55
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts +0 -11
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js +0 -13
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.d.ts +0 -41
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.js +0 -119
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts +0 -11
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js +0 -13
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.d.ts +0 -41
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.js +0 -119
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.d.ts +0 -6
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.d.ts.map +0 -1
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js +0 -47
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js.map +0 -1
- package/src/_modules/assistant/_services/ass.service-base.ts +0 -100
- package/src/_modules/bot/_collections/bot-operations.util.ts +0 -149
- package/src/_modules/bot/_models/bot-channel.interface.ts +0 -7
- package/src/_modules/bot/_models/bot-message.interface.ts +0 -14
- package/src/_modules/bot/_models/bot-messaging-provider.interface.ts +0 -88
- package/src/_modules/bot/_models/bot-user.interface.ts +0 -7
- package/src/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.ts +0 -18
- package/src/_modules/bot/_modules/discord-bot/_collections/dib.util.ts +0 -20
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.ts +0 -475
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.ts +0 -26
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.ts +0 -403
- package/src/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.ts +0 -18
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.ts +0 -156
- package/src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts +0 -18
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.ts +0 -156
- package/src/_modules/bot/_services/bot-messaging-provider-factory.service.ts +0 -56
|
@@ -34,8 +34,41 @@ import {
|
|
|
34
34
|
|
|
35
35
|
// Di Dictionary DiModel DiEz DiAz
|
|
36
36
|
|
|
37
|
-
export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
37
|
+
export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase implements DyNTS_AI_LLMChat_ServiceBase {
|
|
38
38
|
|
|
39
|
+
// History management
|
|
40
|
+
private conversationHistories: Map<string, DyFM_AI_Message[]> = new Map();
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Hozzáad egy üzenetet a conversation history-hoz
|
|
44
|
+
*
|
|
45
|
+
* Adds a message to conversation history
|
|
46
|
+
*/
|
|
47
|
+
addMessageToHistory(message: DyFM_AI_Message, issuer: string): void {
|
|
48
|
+
if (!this.conversationHistories.has(issuer)) {
|
|
49
|
+
this.conversationHistories.set(issuer, []);
|
|
50
|
+
}
|
|
51
|
+
this.conversationHistories.get(issuer).push(message);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Törli a conversation history-t
|
|
56
|
+
*
|
|
57
|
+
* Clears conversation history
|
|
58
|
+
*/
|
|
59
|
+
clearHistory(issuer: string): void {
|
|
60
|
+
this.conversationHistories.delete(issuer);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Visszaadja a conversation history-t
|
|
65
|
+
*
|
|
66
|
+
* Gets conversation history
|
|
67
|
+
*/
|
|
68
|
+
getHistory(issuer: string): DyFM_AI_Message[] {
|
|
69
|
+
return this.conversationHistories.get(issuer) || [];
|
|
70
|
+
}
|
|
71
|
+
|
|
39
72
|
/**
|
|
40
73
|
* Converts generic AI messages to OpenAI-specific format
|
|
41
74
|
*
|
|
@@ -159,7 +192,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
159
192
|
*
|
|
160
193
|
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
|
|
161
194
|
*/
|
|
162
|
-
async
|
|
195
|
+
async multipleSelectQuestionInConversationWithOptions(set: DyFM_AI_ConversationMultiSelect_Input): Promise<string[]> {
|
|
163
196
|
const selectQuestionAddition = this.predefinedRequests.multiselect.replace(
|
|
164
197
|
'{{DyNTS_selectOptions}}',
|
|
165
198
|
this.getTextListAsText(set.options)
|
|
@@ -189,7 +222,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
189
222
|
*
|
|
190
223
|
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
|
|
191
224
|
*/
|
|
192
|
-
async
|
|
225
|
+
async requestMultiselectInConversation<T>(
|
|
193
226
|
set: DyFM_AI_ConversationGenericMultiSelect_Input<T>
|
|
194
227
|
): Promise<T[]> {
|
|
195
228
|
const selectQuestionAddition = this.predefinedRequests.multiselect.replace(
|
|
@@ -226,6 +259,19 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
226
259
|
}
|
|
227
260
|
//askJsonQuestionInConversation: typeof this.jsonQuestionInConversation = this.jsonQuestionInConversation;
|
|
228
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Asks the AI to answer a question that must result a JSON object with specific key descriptions
|
|
264
|
+
*
|
|
265
|
+
* If the answer is not a valid JSON object, it will return { unparsableResult: answer }
|
|
266
|
+
*
|
|
267
|
+
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.jsonRequestWithKeysDescription} to ask the question
|
|
268
|
+
*
|
|
269
|
+
* (uses {@link DyFM_safeParseJSON})
|
|
270
|
+
*/
|
|
271
|
+
async JSONQuestionInConversationWithKeysDescription(set: DyFM_AI_ConversationJSONKeysDescription_Input): Promise<object> {
|
|
272
|
+
return this.jsonQuestionWithKeysDescriptionInConversation<any>(set);
|
|
273
|
+
}
|
|
274
|
+
|
|
229
275
|
/**
|
|
230
276
|
* Asks the AI to answer a question that must result a JSON object with specific key descriptions
|
|
231
277
|
*
|
|
@@ -252,6 +298,20 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
252
298
|
}
|
|
253
299
|
//askJsonQuestionWithKeysDescriptionInConversation: typeof this.jsonQuestionWithKeysDescriptionInConversation = this.jsonQuestionWithKeysDescriptionInConversation;
|
|
254
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Asks the AI to answer a question that must result a JSON object with specific keys
|
|
303
|
+
*
|
|
304
|
+
* If the answer is not a valid JSON object, it will return { unparsableResult: answer }
|
|
305
|
+
*
|
|
306
|
+
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.jsonRequestWithExactKeys} to ask the question
|
|
307
|
+
*
|
|
308
|
+
* (uses {@link DyFM_safeParseJSON})
|
|
309
|
+
*/
|
|
310
|
+
async JSONQuestionInConversationWithExactKeys(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<object> {
|
|
311
|
+
const result = await this.jsonQuestionWithExactKeysInConversation<any>(set);
|
|
312
|
+
return typeof result === 'object' ? result : {};
|
|
313
|
+
}
|
|
314
|
+
|
|
255
315
|
/**
|
|
256
316
|
* Asks the AI to answer a question that must result a JSON object with specific keys
|
|
257
317
|
*
|
|
@@ -536,4 +596,25 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
536
596
|
});
|
|
537
597
|
}
|
|
538
598
|
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Kérdez egy kérdést és JSON választ vár exact keys-szel
|
|
602
|
+
*
|
|
603
|
+
* Asks a question and expects JSON response with exact keys
|
|
604
|
+
*/
|
|
605
|
+
async requestJSONInConversationWithExactKeys<T>(
|
|
606
|
+
set: DyFM_AI_ConversationJSONExactKeys_Input
|
|
607
|
+
): Promise<T> {
|
|
608
|
+
const answer = await this.jsonQuestionWithExactKeysInConversation<any>(set);
|
|
609
|
+
|
|
610
|
+
if ('unparsableResult' in answer) {
|
|
611
|
+
throw new DyFM_Error({
|
|
612
|
+
message: 'Invalid JSON response from AI',
|
|
613
|
+
additionalContent: { answer },
|
|
614
|
+
userMessage: 'Failed to parse AI response'
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
return answer as T;
|
|
619
|
+
}
|
|
539
620
|
}
|
|
@@ -2,14 +2,33 @@ 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_Log, DyFM_notNull, DyFM_Object } from '@futdevpro/fsm-dynamo';
|
|
5
|
+
import {
|
|
6
|
+
DyFM_AI_Message,
|
|
7
|
+
DyFM_AI_MessageRole,
|
|
8
|
+
DyFM_AI_Provider,
|
|
9
|
+
DyFM_AI_ProviderCapabilities,
|
|
10
|
+
DyFM_AI_CallSettings,
|
|
11
|
+
DyFM_AI_Config,
|
|
12
|
+
DyFM_AI_LLM_Response
|
|
13
|
+
} from '@futdevpro/fsm-dynamo/ai';
|
|
5
14
|
|
|
6
15
|
import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
|
|
7
|
-
import { DyFM_AI_Message, DyFM_AI_MessageRole } from '@futdevpro/fsm-dynamo/ai';
|
|
8
16
|
import { ChatCompletion } from 'openai/resources';
|
|
9
17
|
import { ChatCompletionCreateParamsBase, ChatCompletionMessageParam } from 'openai/resources/chat/completions';
|
|
10
18
|
import { DyNTS_OAI_LLM_Predefined_Requests } from '../_models/interfaces/oai-llm-predefined-requests.interface';
|
|
11
19
|
import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
|
|
12
20
|
import { DyNTS_OAI_LLMDefaultPredefined_Requests } from '../_collections/oai-llm-predefined-requests.conts';
|
|
21
|
+
import { DyNTS_AI_LLM_ServiceBase } from '../../../_services/ai-llm.service-base';
|
|
22
|
+
import {
|
|
23
|
+
DyFM_AI_Question_Input,
|
|
24
|
+
DyFM_AI_ListSelect_Input,
|
|
25
|
+
DyFM_AI_GenericSelect_Input,
|
|
26
|
+
DyFM_AI_MultiSelect_Input,
|
|
27
|
+
DyFM_AI_GenericMultiSelect_Input,
|
|
28
|
+
DyFM_AI_JSONKeysDescription_Input,
|
|
29
|
+
DyFM_AI_JSONExactKeys_Input,
|
|
30
|
+
DyFM_AI_SimpleMessage_Input
|
|
31
|
+
} from '../../../_models/ai-input-interfaces';
|
|
13
32
|
|
|
14
33
|
|
|
15
34
|
/**
|
|
@@ -22,18 +41,33 @@ import { DyNTS_OAI_LLMDefaultPredefined_Requests } from '../_collections/oai-llm
|
|
|
22
41
|
|
|
23
42
|
// Di Dictionary DiModel DiEz DiAz
|
|
24
43
|
|
|
25
|
-
export class DyNTS_OAI_LLM_ServiceBase {
|
|
44
|
+
export class DyNTS_OAI_LLM_ServiceBase extends DyNTS_AI_LLM_ServiceBase {
|
|
26
45
|
|
|
27
|
-
readonly defaultErrorUserMsg: string =
|
|
46
|
+
/* readonly defaultErrorUserMsg: string =
|
|
28
47
|
`We encountered an unhandled Control Service Error, ` +
|
|
29
|
-
`\nplease contact the responsible development team.`;
|
|
48
|
+
`\nplease contact the responsible development team.`; */
|
|
30
49
|
|
|
31
|
-
|
|
50
|
+
openai: OpenAI;
|
|
32
51
|
|
|
33
|
-
/* readonly defaultSystemPrompt: string;
|
|
34
|
-
readonly defaultModel: DyFM_OAI_Model | string; */
|
|
35
52
|
readonly defaultSettings: DyFM_OAI_CallSettings;
|
|
36
53
|
|
|
54
|
+
// Provider properties from DyNTS_AI_Provider_ServiceBase
|
|
55
|
+
readonly aiProvider: DyFM_AI_Provider = DyFM_AI_Provider.OpenAI;
|
|
56
|
+
|
|
57
|
+
readonly capabilities: DyFM_AI_ProviderCapabilities = {
|
|
58
|
+
chat: true,
|
|
59
|
+
embeddings: true,
|
|
60
|
+
imageGeneration: true,
|
|
61
|
+
vision: true,
|
|
62
|
+
audioGeneration: true,
|
|
63
|
+
audioAnalysis: true,
|
|
64
|
+
functionCalling: true,
|
|
65
|
+
streaming: true,
|
|
66
|
+
batchOperations: true,
|
|
67
|
+
maxContextLength: 128000,
|
|
68
|
+
supportedModelTypes: ['gpt-4o', 'gpt-4o-mini', 'text-embedding-3-large', 'text-embedding-3-small']
|
|
69
|
+
};
|
|
70
|
+
|
|
37
71
|
get debugLog(): boolean {
|
|
38
72
|
return this.defaultSettings.debugLog;
|
|
39
73
|
}
|
|
@@ -52,6 +86,8 @@ export class DyNTS_OAI_LLM_ServiceBase {
|
|
|
52
86
|
constructor(
|
|
53
87
|
set?: DyFM_OAI_Settings
|
|
54
88
|
) {
|
|
89
|
+
super();
|
|
90
|
+
|
|
55
91
|
DyNTS_global_settings.openAi_settings ??= DyNTS_OAI_global_settings;
|
|
56
92
|
|
|
57
93
|
this.openai = new OpenAI(
|
|
@@ -621,7 +657,7 @@ export class DyNTS_OAI_LLM_ServiceBase {
|
|
|
621
657
|
});
|
|
622
658
|
}
|
|
623
659
|
|
|
624
|
-
protected getDefaultErrorSettings(
|
|
660
|
+
/* protected getDefaultErrorSettings(
|
|
625
661
|
fnName: string,
|
|
626
662
|
error: DyFM_AnyError,
|
|
627
663
|
issuer: string
|
|
@@ -637,6 +673,205 @@ export class DyNTS_OAI_LLM_ServiceBase {
|
|
|
637
673
|
issuerService: this.constructor?.name,
|
|
638
674
|
error: error,
|
|
639
675
|
};
|
|
676
|
+
} */
|
|
677
|
+
|
|
678
|
+
//#endregion
|
|
679
|
+
|
|
680
|
+
//#region Provider Methods (from DyNTS_AI_Provider_ServiceBase)
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Inicializálja az OpenAI client-et a megadott config-gal
|
|
684
|
+
*
|
|
685
|
+
* Reinitializes the OpenAI client with the provided config
|
|
686
|
+
*/
|
|
687
|
+
initialize(config: DyFM_AI_Config): void {
|
|
688
|
+
this.openai = new OpenAI(config);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Teszteli a kapcsolatot az OpenAI API-val
|
|
693
|
+
*
|
|
694
|
+
* Tests the connection to OpenAI API
|
|
695
|
+
*/
|
|
696
|
+
async testConnection(issuer: string): Promise<boolean> {
|
|
697
|
+
try {
|
|
698
|
+
await this.openai.models.list();
|
|
699
|
+
return true;
|
|
700
|
+
} catch (error) {
|
|
701
|
+
DyFM_Log.error('DyNTS_OAI_LLM_ServiceBase', 'testConnection', 'Connection test failed', {
|
|
702
|
+
error,
|
|
703
|
+
issuer
|
|
704
|
+
});
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
//#endregion
|
|
710
|
+
|
|
711
|
+
//#region Abstract LLM Methods (from DyNTS_AI_LLM_ServiceBase)
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Meghívja az LLM-et system és user message-szel
|
|
715
|
+
*
|
|
716
|
+
* Calls the LLM with system and user messages
|
|
717
|
+
*/
|
|
718
|
+
async callLLM(
|
|
719
|
+
systemMessage: string,
|
|
720
|
+
userMessage: string,
|
|
721
|
+
settings?: DyFM_AI_CallSettings,
|
|
722
|
+
issuer?: string
|
|
723
|
+
): Promise<string> {
|
|
724
|
+
const result = await this.resolveMessage({
|
|
725
|
+
conversation: [
|
|
726
|
+
{ role: DyFM_AI_MessageRole.system, content: systemMessage },
|
|
727
|
+
{ role: DyFM_AI_MessageRole.user, content: userMessage }
|
|
728
|
+
],
|
|
729
|
+
issuer: issuer ?? 'system',
|
|
730
|
+
settings: this.convertToOAISettings(settings),
|
|
731
|
+
getFullResponse: false
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
if (typeof result === 'string') {
|
|
735
|
+
return result;
|
|
736
|
+
}
|
|
737
|
+
return '';
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Meghívja az LLM-et üzenet history-val
|
|
742
|
+
*
|
|
743
|
+
* Calls the LLM with message history
|
|
744
|
+
*/
|
|
745
|
+
async callLLMWithHistory(
|
|
746
|
+
messages: DyFM_AI_Message[],
|
|
747
|
+
settings?: DyFM_AI_CallSettings,
|
|
748
|
+
issuer?: string
|
|
749
|
+
): Promise<string> {
|
|
750
|
+
const result = await this.resolveMessage({
|
|
751
|
+
conversation: messages,
|
|
752
|
+
issuer: issuer ?? 'system',
|
|
753
|
+
settings: this.convertToOAISettings(settings),
|
|
754
|
+
getFullResponse: false
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
if (typeof result === 'string') {
|
|
758
|
+
return result;
|
|
759
|
+
}
|
|
760
|
+
return '';
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Meghívja az LLM-et és visszaadja a raw response-t
|
|
765
|
+
*
|
|
766
|
+
* Calls the LLM and returns raw response
|
|
767
|
+
*/
|
|
768
|
+
async callLLMRaw(
|
|
769
|
+
messages: DyFM_AI_Message[],
|
|
770
|
+
settings?: DyFM_AI_CallSettings,
|
|
771
|
+
issuer?: string
|
|
772
|
+
): Promise<DyFM_AI_LLM_Response> {
|
|
773
|
+
const result = await this.resolveMessage({
|
|
774
|
+
conversation: messages,
|
|
775
|
+
issuer: issuer ?? 'system',
|
|
776
|
+
settings: this.convertToOAISettings(settings),
|
|
777
|
+
getFullResponse: true
|
|
778
|
+
}) as ChatCompletion;
|
|
779
|
+
|
|
780
|
+
return {
|
|
781
|
+
content: result.choices[0].message.content,
|
|
782
|
+
usage: result.usage ? {
|
|
783
|
+
promptTokens: result.usage.prompt_tokens,
|
|
784
|
+
completionTokens: result.usage.completion_tokens,
|
|
785
|
+
totalTokens: result.usage.total_tokens
|
|
786
|
+
} : undefined,
|
|
787
|
+
model: result.model,
|
|
788
|
+
finishReason: result.choices[0].finish_reason,
|
|
789
|
+
rawResponse: result
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Küld egy egyszerű üzenetet az LLM-nek
|
|
795
|
+
*
|
|
796
|
+
* Sends a simple message to the LLM
|
|
797
|
+
*/
|
|
798
|
+
async sendMessage(set: DyFM_AI_SimpleMessage_Input): Promise<string> {
|
|
799
|
+
return await this.resolveSimpleUserMessage({
|
|
800
|
+
message: set.message,
|
|
801
|
+
issuer: set.issuer,
|
|
802
|
+
settings: set.settings ? this.convertToOAISettings(set.settings) : undefined
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Kérdez egy kérdést és JSON választ vár exact keys-szel
|
|
808
|
+
*
|
|
809
|
+
* Asks a question and expects JSON response with exact keys
|
|
810
|
+
*/
|
|
811
|
+
async requestJSONWithExactKeys<T = any>(
|
|
812
|
+
set: DyFM_AI_JSONExactKeys_Input
|
|
813
|
+
): Promise<T> {
|
|
814
|
+
const answer = await this.askJSONQuestionWithExactKeys({
|
|
815
|
+
question: set.question,
|
|
816
|
+
keys: set.keys,
|
|
817
|
+
issuer: set.issuer,
|
|
818
|
+
settings: set.settings ? this.convertToOAISettings(set.settings) : undefined,
|
|
819
|
+
debugLog: set.debugLog,
|
|
820
|
+
replaceThisInLog: set.replaceThisInLog
|
|
821
|
+
});
|
|
822
|
+
|
|
823
|
+
if ('unparsableResult' in answer) {
|
|
824
|
+
throw new DyFM_Error({
|
|
825
|
+
message: 'Invalid JSON response from AI',
|
|
826
|
+
additionalContent: { answer },
|
|
827
|
+
userMessage: 'Failed to parse AI response'
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
return answer as T;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Kérdez egy kérdést és több választ vár
|
|
836
|
+
*
|
|
837
|
+
* Asks a question and expects multiple responses
|
|
838
|
+
*/
|
|
839
|
+
async requestMultiselect<T = any>(
|
|
840
|
+
set: DyFM_AI_GenericMultiSelect_Input<T>
|
|
841
|
+
): Promise<T[]> {
|
|
842
|
+
const answer = await this.requestMultipleSelect({
|
|
843
|
+
question: set.question,
|
|
844
|
+
options: set.options,
|
|
845
|
+
issuer: set.issuer,
|
|
846
|
+
settings: set.settings ? this.convertToOAISettings(set.settings) : undefined,
|
|
847
|
+
debugLog: set.debugLog,
|
|
848
|
+
replaceThisInLog: set.replaceThisInLog
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
return answer as T[];
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Konvertálja a generic AI settings-et OpenAI specifikus settings-re
|
|
856
|
+
*
|
|
857
|
+
* Converts generic AI settings to OpenAI-specific settings
|
|
858
|
+
*/
|
|
859
|
+
private convertToOAISettings(settings?: DyFM_AI_CallSettings): DyFM_OAI_CallSettings {
|
|
860
|
+
if (!settings) return undefined;
|
|
861
|
+
|
|
862
|
+
const oaiSettings = new DyFM_OAI_CallSettings();
|
|
863
|
+
|
|
864
|
+
if (settings.systemPrompt) oaiSettings.systemPrompt = settings.systemPrompt;
|
|
865
|
+
if (settings.useModel) oaiSettings.useModel = settings.useModel as DyFM_OAI_Model;
|
|
866
|
+
if (settings.project) oaiSettings.project = settings.project;
|
|
867
|
+
if (settings.debugLog !== undefined) oaiSettings.debugLog = settings.debugLog;
|
|
868
|
+
if (settings.temperature !== undefined) oaiSettings.temperature = settings.temperature;
|
|
869
|
+
if (settings.maxTokens !== undefined) oaiSettings.maxTokens = settings.maxTokens;
|
|
870
|
+
if (settings.topP !== undefined) oaiSettings.topP = settings.topP;
|
|
871
|
+
if (settings.frequencyPenalty !== undefined) oaiSettings.frequencyPenalty = settings.frequencyPenalty;
|
|
872
|
+
if (settings.presencePenalty !== undefined) oaiSettings.presencePenalty = settings.presencePenalty;
|
|
873
|
+
|
|
874
|
+
return oaiSettings;
|
|
640
875
|
}
|
|
641
876
|
|
|
642
877
|
//#endregion
|
|
@@ -61,12 +61,13 @@ export * from './_services/oai-llm-chat.service';
|
|
|
61
61
|
export * from './_services/oai-embedding.service'; */
|
|
62
62
|
/* export * from './_services/oai-doc-chunk.service'; */
|
|
63
63
|
|
|
64
|
-
//
|
|
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';
|
|
64
|
+
// SERVICES
|
|
68
65
|
export * from './_services/oai-embedding.control-service';
|
|
69
66
|
export * from './_services/oai-llm-chat.service-base';
|
|
70
67
|
export * from './_services/oai-llm.service-base';
|
|
71
|
-
|
|
68
|
+
// services/DATA-SERVICES
|
|
69
|
+
export * from './_services/data-services/oai-doc-chunk-data.service';
|
|
70
|
+
export * from './_services/data-services/oai-doc-page.data-service';
|
|
71
|
+
export * from './_services/data-services/oai-document.data-service';
|
|
72
|
+
export * from './_services/data-services/oai-vector-data.service';
|
|
72
73
|
/* export * from './_services/oai-doc-chunk.service-base'; */
|
|
@@ -69,11 +69,11 @@ export abstract class DyNTS_AI_LLM_ServiceBase extends DyNTS_AI_Provider_Service
|
|
|
69
69
|
abstract sendMessage(set: DyFM_AI_SimpleMessage_Input): Promise<string>;
|
|
70
70
|
|
|
71
71
|
// Helper methods
|
|
72
|
-
protected abstract getDefaultErrorSettings(
|
|
72
|
+
/* protected abstract getDefaultErrorSettings(
|
|
73
73
|
method: string,
|
|
74
74
|
error: any,
|
|
75
75
|
issuer?: string
|
|
76
|
-
): DyFM_Error_Settings;
|
|
76
|
+
): DyFM_Error_Settings; */
|
|
77
77
|
|
|
78
78
|
protected abstract getTextListAsText(list: string[]): string;
|
|
79
79
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { DyFM_AI_Provider } from '@futdevpro/fsm-dynamo/ai';
|
|
2
2
|
import { DyFM_AI_ProviderCapabilities } from '@futdevpro/fsm-dynamo/ai';
|
|
3
3
|
import { DyFM_AI_Config } from '@futdevpro/fsm-dynamo/ai';
|
|
4
|
+
import { DyNTS_SingletonService } from '../../../_services/base/singleton.service';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Abstract base class for all AI providers
|
|
7
8
|
* Defines the common interface that all AI providers must implement
|
|
8
9
|
*/
|
|
9
|
-
export abstract class DyNTS_AI_Provider_ServiceBase {
|
|
10
|
+
export abstract class DyNTS_AI_Provider_ServiceBase extends DyNTS_SingletonService {
|
|
10
11
|
/** The AI provider this service represents */
|
|
11
12
|
abstract readonly aiProvider: DyFM_AI_Provider;
|
|
12
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DyNTS_Bot_MessageWrapper } from '../../bot/_models/bot-message-wrapper.interface';
|
|
2
2
|
import { DyFM_AI_Message, DyFM_AI_MessageRole } from '@futdevpro/fsm-dynamo/ai';
|
|
3
3
|
import { DyNTS_Ass_global_settings } from './ass-global-settings.const';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ export class DyNTS_Ass_Util {
|
|
|
8
8
|
* Uses EXISTING DyFM_AI_Message type from fsm-dynamo
|
|
9
9
|
* Same logic as DiAs_Util.convertDiscordMessagesToOAIConversation but platform-agnostic
|
|
10
10
|
*/
|
|
11
|
-
static convertBotMessagesToAIConversation<T_BotMessage extends
|
|
11
|
+
static convertBotMessagesToAIConversation<T_BotMessage extends DyNTS_Bot_MessageWrapper<any>>(
|
|
12
12
|
set: {
|
|
13
13
|
messages: T_BotMessage[],
|
|
14
14
|
botClientId: string,
|
|
@@ -1,73 +1,45 @@
|
|
|
1
|
-
import { DyFM_Error
|
|
1
|
+
import { DyFM_Error } from '@futdevpro/fsm-dynamo';
|
|
2
2
|
import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
|
|
3
3
|
import { DyNTS_Bot_IO_ControlService } from '../../bot/_services/bot-io.control-service';
|
|
4
|
-
import { DyNTS_Bot_Message } from '../../bot/_models/bot-message.interface';
|
|
5
4
|
import { DyNTS_Bot_MessageWrapper } from '../../bot/_models/bot-message-wrapper.interface';
|
|
6
|
-
import {
|
|
7
|
-
import { DyNTS_Bot_User } from '../../bot/_models/bot-user.interface';
|
|
8
|
-
import { DyNTS_Bot_MessagingProvider } from '../../bot/_models/bot-messaging-provider.interface';
|
|
9
|
-
import { DyNTS_Ass_Main_ControlService } from './ass-main.control-service';
|
|
5
|
+
/* import { DyNTS_Ass_Main_ControlService } from './ass-main.control-service'; */
|
|
10
6
|
import { DyNTS_Ass_Util } from '../_collections/ass.util';
|
|
11
7
|
import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
12
8
|
import { DyNTS_AI_LLMChat_ServiceBase } from '../../ai/_services/ai-llm-chat.service-base';
|
|
9
|
+
import { DyNTS_Ass_Main_ControlService } from './ass-main.control-service';
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
* Assistant IO Control Service
|
|
16
13
|
* Handles message processing with AI provider
|
|
17
14
|
* EXACT SAME LOGIC as DiAs_IO_ControlService but platform and AI provider agnostic
|
|
18
15
|
*/
|
|
19
|
-
export abstract class DyNTS_Ass_IO_ControlService
|
|
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_MessagingProvider<
|
|
24
|
-
T_PlatformChannel,
|
|
25
|
-
T_PlatformMessage,
|
|
26
|
-
T_PlatformUser
|
|
27
|
-
> = DyNTS_Bot_MessagingProvider<
|
|
28
|
-
T_PlatformChannel,
|
|
29
|
-
T_PlatformMessage,
|
|
30
|
-
T_PlatformUser
|
|
31
|
-
>
|
|
32
|
-
> extends DyNTS_Bot_IO_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_CommsProvider> {
|
|
16
|
+
export abstract class DyNTS_Ass_IO_ControlService extends DyNTS_Bot_IO_ControlService {
|
|
33
17
|
|
|
34
|
-
protected abstract override getMainBotControlService(): DyNTS_Ass_Main_ControlService
|
|
35
|
-
|
|
36
|
-
T_PlatformMessage,
|
|
37
|
-
T_PlatformUser,
|
|
38
|
-
T_CommsProvider
|
|
39
|
-
>;
|
|
40
|
-
|
|
41
|
-
protected abstract override mainBot_CS: DyNTS_Ass_Main_ControlService<
|
|
42
|
-
T_PlatformChannel,
|
|
43
|
-
T_PlatformMessage,
|
|
44
|
-
T_PlatformUser,
|
|
45
|
-
T_CommsProvider
|
|
46
|
-
>;
|
|
18
|
+
protected abstract override getMainBotControlService(): DyNTS_Ass_Main_ControlService;
|
|
19
|
+
declare mainBot_CS: DyNTS_Ass_Main_ControlService;
|
|
47
20
|
|
|
48
21
|
get aiProvider(): DyNTS_AI_LLMChat_ServiceBase {
|
|
49
|
-
return this.mainBot_CS
|
|
22
|
+
return this.mainBot_CS.aiProvider;
|
|
50
23
|
}
|
|
51
24
|
|
|
52
25
|
/**
|
|
53
26
|
* Handle incoming message with AI
|
|
54
27
|
* EXACT SAME LOGIC as dias-io.control-service.ts handleMessage()
|
|
55
28
|
*/
|
|
56
|
-
|
|
57
|
-
message:
|
|
58
|
-
wrapper: DyNTS_Bot_MessageWrapper<T_PlatformMessage>,
|
|
29
|
+
async handleMessage(
|
|
30
|
+
message: DyNTS_Bot_MessageWrapper<any>,
|
|
59
31
|
issuer: string
|
|
60
|
-
): Promise<
|
|
32
|
+
): Promise<DyNTS_Bot_MessageWrapper<any>> {
|
|
61
33
|
try {
|
|
62
34
|
// Gather messages from comms platform using wrapper's provider
|
|
63
|
-
const messages:
|
|
35
|
+
const messages: DyNTS_Bot_MessageWrapper<any>[] = await this.mainBot_CS.gatherMessagesForMessage(message);
|
|
64
36
|
|
|
65
37
|
// Convert to AI conversation format (uses EXISTING DyFM_AI_Message)
|
|
66
38
|
const aiMessages: DyFM_AI_Message[] =
|
|
67
39
|
DyNTS_Ass_Util.convertBotMessagesToAIConversation({
|
|
68
40
|
messages: messages,
|
|
69
|
-
botClientId:
|
|
70
|
-
botDisplayName:
|
|
41
|
+
botClientId: message.provider.botId,
|
|
42
|
+
botDisplayName: message.provider.botDisplayName,
|
|
71
43
|
issuer: issuer,
|
|
72
44
|
});
|
|
73
45
|
|
|
@@ -81,19 +53,16 @@ export abstract class DyNTS_Ass_IO_ControlService<
|
|
|
81
53
|
});
|
|
82
54
|
|
|
83
55
|
// Reply via same provider the message came from
|
|
84
|
-
return await
|
|
56
|
+
return await message.provider.replyToMessage(message, aiResult);
|
|
85
57
|
} catch (error) {
|
|
86
58
|
DyFM_Error.logSimple('❌❌ Error handleMessage:', error);
|
|
87
59
|
|
|
88
60
|
if (!this.dontSendErrorReply && DyNTS_global_settings.bot_settings?.debugLevel >= 1) {
|
|
89
|
-
await
|
|
90
|
-
message
|
|
91
|
-
message.channelId,
|
|
61
|
+
await message.provider.replyToMessage(
|
|
62
|
+
message,
|
|
92
63
|
`[SYSTEM|ERROR|${DyNTS_global_settings.systemShortCodeName}|DyNTS-Ass-IOCS-H0] Error occurred while handling the message:\n` +
|
|
93
64
|
DyFM_Error.getAnyMessage(error)
|
|
94
|
-
)
|
|
95
|
-
DyFM_Error.logSimple('❌❌ Error sending error reply:', error);
|
|
96
|
-
});
|
|
65
|
+
);
|
|
97
66
|
}
|
|
98
67
|
|
|
99
68
|
throw new DyFM_Error({
|