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