UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

1,109 lines 38.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setSessionConfigNode = exports.voiceConfigFields = void 0; /** Custom Modules */ const createNodeDescriptor_1 = require("../../../createNodeDescriptor"); /** Helper Modules */ const design_1 = require("../utils/design"); const setSessionConfig_mapper_1 = require("../../voice/mappers/setSessionConfig.mapper"); const setSessionConfig_mapper_2 = require("../../voice/mappers/setSessionConfig.mapper"); const vgConstants_1 = require("../../voice/utils/vgConstants"); const logFullConfigToDebugMode_1 = require("../../../../helper/logFullConfigToDebugMode"); exports.voiceConfigFields = [ { key: "bargeInMinWordCount", type: "slider", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__BARGE_IN_MIN_WORD_COUNT__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__BARGE_IN_MIN_WORD_COUNT__DESCRIPTION", defaultValue: 1, params: { min: 1, max: 5, step: 1 } }, { key: "bargeInOnSpeech", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__BARGE_IN_ON_SPEECH__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__BARGE_IN_ON_SPEECH__DESCRIPTION", defaultValue: false }, { key: "bargeInOnDtmf", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__BARGE_IN_ON_DTMF__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__BARGE_IN_ON_DTMF__DESCRIPTION", defaultValue: false }, { key: "deepgramEndpointing", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING__DESCRIPTION", defaultValue: true, condition: { key: "sttVendor", value: "deepgram" } }, { key: "deepgramEndpointingValue", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING_TIME__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_ENDPOINTING_TIME__DESCRIPTION", defaultValue: 250, params: { min: 10, max: 1000 }, condition: { and: [ { key: "sttVendor", value: "deepgram" }, { key: "deepgramEndpointing", value: true }, ] } }, { key: "deepgramSmartFormatting", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_SMART_FORMATTING__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DEEPGRAM_SMART_FORMATTING__DESCRIPTION", defaultValue: false, condition: { key: "sttVendor", value: "deepgram" } }, { key: "sttHints", type: "textArray", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_HINTS__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_HINTS__DESCRIPTION", defaultValue: [""], condition: { or: [ { key: "sttVendor", value: "microsoft", }, { key: "sttVendor", value: "google", }, { key: "sttVendor", value: "aws", }, { key: "sttVendor", value: "soniox" }, { key: "sttVendor", value: "deepgram" }, ] } }, { key: "sttDisablePunctuation", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_DISABLE_PUNCTUATION__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_DISABLE_PUNCTUATION__DESCRIPTION", defaultValue: false, condition: { or: [ { key: "sttVendor", value: "google", }, { key: "sttVendor", value: "deepgram", }, ] } }, { key: "sttVadEnabled", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_VAD_ENABLED__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_VAD_ENABLED__DESCRIPTION", defaultValue: false, condition: { or: [ { key: "sttVendor", value: "microsoft", }, { key: "sttVendor", value: "google", }, { key: "sttVendor", value: "aws", }, { key: "sttVendor", value: "nuance" }, ] } }, { key: "sttHintsDynamicHints", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_HINTS_DYNAMIC_HINTS__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_HINTS_DYNAMIC_HINTS__DESCRIPTION", defaultValue: "", condition: { or: [ { key: "sttVendor", value: "microsoft", }, { key: "sttVendor", value: "google", }, { key: "sttVendor", value: "aws", }, { key: "sttVendor", value: "soniox" }, { key: "sttVendor", value: "deepgram" }, ] } }, { key: "sttLabel", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_LABEL__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_LABEL__DESCRIPTION", defaultValue: "", condition: { negate: true, key: "sttVendor", value: "", // We show the field for all vendors as soon as it is defined } }, { key: "sttVadMode", type: "slider", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_VAD_MODE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_VAD_MODE__DESCRIPTION", defaultValue: 1, params: { min: 0, max: 3, step: 1 }, condition: { key: "sttVadEnabled", value: true } }, { key: "sttVadVoiceMs", type: "slider", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_VAD_VOICE_MS__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__STT_VAD_VOICE_MS__DESCRIPTION", defaultValue: 100, params: { min: 100, max: 1000, step: 100 }, condition: { key: "sttVadEnabled", value: true } }, { key: "ttsDisableCache", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__TTS_DISABLE_CACHE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__TTS_DISABLE_CACHE__DESCRIPTION", defaultValue: false }, { key: "sttVendor", type: "sttSelect", label: "_unused_", description: "_unused_", defaultValue: "", params: { languageKey: "config.sttLanguage", modelKey: "config.sttDeepgramModel", } }, { key: "sttLanguage", type: "sttSelect", label: "_unused_", description: "_unused_", defaultValue: "", }, { key: "sttDeepgramModel", type: "sttSelect", label: "_unused_", description: "_unused_", defaultValue: "", condition: { key: "sttVendor", value: "deepgram" } }, { key: "ttsVendor", defaultValue: "", type: "ttsSelect", label: "_unused_", description: "_unused_", params: { languageKey: "config.ttsLanguage", modelKey: "config.ttsModel", voiceKey: "config.ttsVoice" } }, { key: "ttsModel", type: "ttsSelect", defaultValue: "", label: "_unused_" }, { key: "ttsVoice", type: "ttsSelect", defaultValue: "", label: "_unused_" }, { key: "ttsLanguage", type: "ttsSelect", defaultValue: "", label: "_unused_" }, { key: "ttsLabel", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__TTS_LABEL__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__TTS_LABEL__DESCRIPTION", defaultValue: "", condition: { negate: true, key: "ttsVendor", value: "", // We show the field for all vendors as soon as it is defined } }, { key: "userNoInputTimeoutEnable", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_TIMEOUT_ENABLE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_TIMEOUT_ENABLE__DESCRIPTION", defaultValue: true, }, { key: "userNoInputMode", type: "select", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_MODE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_MODE__DESCRIPTION", defaultValue: "event", params: { options: [ { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_MODE__OPTIONS__SPEECH__LABEL", value: "speech" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_MODE__OPTIONS__PLAY__LABEL", value: "play" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_MODE__OPTIONS__EVENT__LABEL", value: "event" } ] }, condition: { key: "userNoInputTimeoutEnable", value: true } }, { key: "userNoInputTimeout", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_TIMEOUT__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_TIMEOUT__DESCRIPTION", defaultValue: 10000, params: { min: 1 }, condition: { key: "userNoInputTimeoutEnable", value: true } }, { key: "userNoInputRetries", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_RETRIES__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_RETRIES__DESCRIPTION", defaultValue: 1, params: { min: 0, max: 999 }, condition: { key: "userNoInputTimeoutEnable", value: true } }, { key: "userNoInputSpeech", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_SPEECH__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_SPEECH__DESCRIPTION", defaultValue: "", condition: { and: [ { key: "userNoInputTimeoutEnable", value: true }, { key: "userNoInputMode", value: "speech" } ] }, params: { required: true }, }, { key: "userNoInputUrl", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_URL__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__USER_NO_INPUT_URL__DESCRIPTION", defaultValue: "", condition: { and: [ { key: "userNoInputTimeoutEnable", value: true }, { key: "userNoInputMode", value: "play" } ] }, params: { required: true } }, { key: "flowNoInputTimeoutEnable", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_TIMEOUT_ENABLE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_TIMEOUT_ENABLE__DESCRIPTION", defaultValue: false, }, { key: "flowNoInputMode", type: "select", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_MODE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_MODE__DESCRIPTION", defaultValue: "play", params: { options: [ { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_MODE__OPTIONS__PLAY__LABEL", value: "play" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_MODE__OPTIONS__SPEECH__LABEL", value: "speech" } ] }, condition: { key: "flowNoInputTimeoutEnable", value: true } }, { key: "flowNoInputTimeout", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_TIMEOUT__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_TIMEOUT__DESCRIPTION", defaultValue: 10000, params: { min: 1 }, condition: { key: "flowNoInputTimeoutEnable", value: true } }, { key: "flowNoInputRetries", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_RETRIES__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_RETRIES__DESCRIPTION", defaultValue: 1, params: { min: 0, max: 999 }, condition: { key: "flowNoInputTimeoutEnable", value: true } }, { key: "flowNoInputSpeech", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_SPEECH__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_SPEECH__DESCRIPTION", defaultValue: "", condition: { and: [ { key: "flowNoInputTimeoutEnable", value: true }, { key: "flowNoInputMode", value: "speech" } ] }, params: { required: true }, }, { key: "flowNoInputUrl", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_URL__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_URL__DESCRIPTION", defaultValue: "", condition: { and: [ { key: "flowNoInputTimeoutEnable", value: true }, { key: "flowNoInputMode", value: "play" } ] }, params: { required: true } }, { key: "flowNoInputFail", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_FAIL_ERROR__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__FLOW_NO_INPUT_FAIL_ERROR__DESCRIPTION", defaultValue: false, condition: { key: "flowNoInputTimeoutEnable", value: true }, }, { key: "dtmfEnable", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_ENABLE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_ENABLE__DESCRIPTION", defaultValue: false }, { key: "dtmfInterDigitTimeout", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_INTER_DIGIT_TIMEOUT__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_INTER_DIGIT_TIMEOUT__DESCRIPTION", defaultValue: 2000, params: { min: 1000, max: 60000 }, condition: { key: "dtmfEnable", value: true } }, { key: "dtmfMaxDigits", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_MAX_DIGITS__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_MAX_DIGITS__DESCRIPTION", defaultValue: 1, params: { min: 1 }, condition: { key: "dtmfEnable", value: true } }, { key: "dtmfMinDigits", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_MIN_DIGITS__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_MIN_DIGITS__DESCRIPTION", defaultValue: 1, params: { min: 1 }, condition: { key: "dtmfEnable", value: true } }, { key: "dtmfSubmitDigit", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_SUBMIT_DIGIT__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__DTMF_SUBMIT_DIGIT__DESCRIPTION", defaultValue: "#", condition: { key: "dtmfEnable", value: true } }, { key: "asrDigit", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ASR_DIGIT__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ASR_DIGIT__DESCRIPTION", defaultValue: "", condition: { key: "asrEnabled", value: true } }, { key: "asrEnabled", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ASR_ENABLED__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ASR_ENABLED__DESCRIPTION", defaultValue: false }, { key: "asrTimeout", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ASR_TIMEOUT__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ASR_TIMEOUT__DESCRIPTION", defaultValue: 2000, params: { min: 2000 }, condition: { key: "asrEnabled", value: true } }, { key: "recognizeLanguagesAzure", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__RECOGNIZE_LANGUAGES_AZURE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__RECOGNIZE_LANGUAGES_AZURE__DESCRIPTION", defaultValue: false, condition: { key: "sttVendor", value: "microsoft", } }, { key: "sttAzure", type: "sttLanguageAzureSelect", label: "_unused_", description: "_unused_", defaultValue: "", params: { name: "config.sttVendor", alternativeLanguage1: "config.sttAzureLang1", alternativeLanguage2: "config.sttAzureLang2", alternativeLanguage3: "config.sttAzureLang3" }, condition: { key: "recognizeLanguagesAzure", value: true } }, { key: "sttAzureLang1", type: "sttLanguageAzureSelect", defaultValue: "", label: "_unused_" }, { key: "sttAzureLang2", type: "sttLanguageAzureSelect", defaultValue: "", label: "_unused_" }, { key: "sttAzureLang3", type: "sttLanguageAzureSelect", defaultValue: "", label: "_unused_" }, { key: "recognizeLanguagesGoogle", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__RECOGNIZE_LANGUAGES_GOOGLE__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__RECOGNIZE_LANGUAGES_GOOGLE__DESCRIPTION", defaultValue: false, condition: { key: "sttVendor", value: "google", }, }, { key: "sttGoogle", type: "sttLanguageGoogleSelect", label: "_unused_", description: "_unused_", defaultValue: "", params: { name: "config.sttVendor", alternativeLanguage1: "config.sttGoogleLang1", alternativeLanguage2: "config.sttGoogleLang2", alternativeLanguage3: "config.sttGoogleLang3" }, condition: { key: "recognizeLanguagesGoogle", value: true } }, { key: "sttGoogleLang1", type: "sttLanguageGoogleSelect", defaultValue: "", label: "_unused_" }, { key: "sttGoogleLang2", type: "sttLanguageGoogleSelect", defaultValue: "", label: "_unused_" }, { key: "sttGoogleLang3", type: "sttLanguageGoogleSelect", defaultValue: "", label: "_unused_" }, { key: "enableAdvancedSTTConfig", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ENABLE_ADVANCED_STT_CONFIG__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ENABLE_ADVANCED_STT_CONFIG__DESCRIPTION", defaultValue: false, condition: { key: 'sttVendor', value: 'microsoft' } }, { key: "azureSttContextId", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_STT_CONTEXT_ID__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_STT_CONTEXT_ID__DESCRIPTION", defaultValue: "", condition: { and: [ { key: "enableAdvancedSTTConfig", value: true }, { key: "sttVendor", value: "microsoft" } ] } }, { key: "azureEnableAudioLogging", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_ENABLE_AUDIO_LOGGING__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_ENABLE_AUDIO_LOGGING__DESCRIPTION", defaultValue: false, condition: { key: "enableAdvancedSTTConfig", value: true } }, { key: "azureProfanityOption", type: "select", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__DESCRIPTION", defaultValue: "raw", condition: { key: "enableAdvancedSTTConfig", value: true }, params: { options: [ { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__RAW__LABEL", value: "raw" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__MASKED__LABEL", value: "masked" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__REMOVED__LABEL", value: "removed" } ] } }, { key: "atmosphereAction", type: "select", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_ACTION__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_ACTION__DESCRIPTION", defaultValue: "", params: { options: [ { label: "", value: "" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_ACTION__OPTIONS__PLAY__LABEL", value: "addTrack" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_ACTION__OPTIONS__SILENCE__LABEL", value: "silenceTrack" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_ACTION__OPTIONS__REMOVE__LABEL", value: "removeTrack" } ] } }, { key: "atmosphereLoop", type: "toggle", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_LOOP__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_LOOP__DESCRIPTION", defaultValue: true, condition: { key: "atmosphereAction", value: "addTrack" } }, { key: "atmosphereVolume", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_VOLUME__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_VOLUME__DESCRIPTION", defaultValue: 0, params: { min: -50, max: 50 }, condition: { key: "atmosphereAction", value: "addTrack" } }, { key: "atmosphereUrl", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_URL__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__ATMOSPHERE_URL__DESCRIPTION", defaultValue: "", condition: { key: "atmosphereAction", value: "addTrack" } }, { key: "silenceOverlayAction", type: "select", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_ACTION__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_ACTION__DESCRIPTION", defaultValue: "", params: { options: [ { label: "", value: "" }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_ACTION__OPTIONS__PLAY__LABEL", value: true }, { label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_ACTION__OPTIONS__REMOVE__LABEL", value: false }, ] } }, { key: "silenceOverlayURL", type: "cognigyText", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_URL__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_URL__DESCRIPTION", defaultValue: "", condition: { key: "silenceOverlayAction", value: true } }, { key: "silenceOverlayDelay", type: "number", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_DELAY__LABEL", description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SILENCE_OVERLAY_DELAY__DESCRIPTION", defaultValue: 0, params: { min: 0, max: 60 }, condition: { key: "silenceOverlayAction", value: true } }, { key: "googleModel", type: "select", label: "UI__NODE_EDITOR__GOOGLE_MODEL__LABEL", description: "UI__NODE_EDITOR__GOOGLE_MODEL__DESCRIPTION", defaultValue: vgConstants_1.GoogleSpeechModel.LatestShort, condition: { key: "sttVendor", value: "google" }, params: { options: [ { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__LATEST_SHORT__LABEL", value: vgConstants_1.GoogleSpeechModel.LatestShort, }, { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__LATEST_LONG__LABEL", value: vgConstants_1.GoogleSpeechModel.LatestLong, }, { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__COMMAND_AND_SEARCH__LABEL", value: vgConstants_1.GoogleSpeechModel.CommandAndSearch, }, { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__PHONE_CALL__LABEL", value: vgConstants_1.GoogleSpeechModel.PhoneCall, }, { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__VIDEO__LABEL", value: vgConstants_1.GoogleSpeechModel.Video, }, { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__MEDICAL_DICTATION__LABEL", value: vgConstants_1.GoogleSpeechModel.MedicalDictation, }, { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__MEDICAL_CONVERSATION__LABEL", value: vgConstants_1.GoogleSpeechModel.MedicalConversation, }, { label: "UI__NODE_EDITOR__GOOGLE_MODEL__OPTIONS__DEFAULT__LABEL", value: vgConstants_1.GoogleSpeechModel.Default, }, ], }, }, { key: "sessionParams", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSION_PARAMS__LABEL", type: "json", defaultValue: "{}", params: { required: true } } ]; exports.setSessionConfigNode = (0, createNodeDescriptor_1.createNodeDescriptor)({ type: "setSessionConfig", defaultLabel: "Set Session Config", summary: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SUMMARY", appearance: { color: design_1.nodeColor, }, fields: exports.voiceConfigFields, sections: [ { key: "params_stt", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_STT__LABEL", defaultCollapsed: true, fields: [ "sttVendor", "sttLabel", "deepgramEndpointing", "deepgramEndpointingValue", "deepgramSmartFormatting", "sttHints", "sttHintsDynamicHints", "googleModel", "sttDisablePunctuation", "sttVadEnabled", "sttVadMode", "sttVadVoiceMs", "enableAdvancedSTTConfig", "azureSttContextId", "azureEnableAudioLogging", "azureProfanityOption", "recognizeLanguagesAzure", "sttAzure", "recognizeLanguagesGoogle", "sttGoogle", ], }, { key: "params_tts", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_TTS__LABEL", defaultCollapsed: true, fields: [ "ttsVendor", "ttsLabel", "ttsDisableCache", ], }, { key: "params_bargein", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_BARGEIN__LABEL", defaultCollapsed: true, fields: ["bargeInOnSpeech", "bargeInOnDtmf", "bargeInMinWordCount"], }, { key: "params_user_timeouts", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_USER_TIMEOUTS__LABEL", defaultCollapsed: true, fields: [ "userNoInputTimeoutEnable", "userNoInputMode", "userNoInputSpeech", "userNoInputUrl", "userNoInputTimeout", "userNoInputRetries", ], }, { key: "params_flow_timeouts", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_FLOW_TIMEOUTS__LABEL", defaultCollapsed: true, fields: [ "flowNoInputTimeoutEnable", "flowNoInputMode", "flowNoInputSpeech", "flowNoInputUrl", "flowNoInputTimeout", "flowNoInputRetries", "flowNoInputFail" ], }, { key: "params_dtmf", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_DTMF__LABEL", defaultCollapsed: true, fields: [ "dtmfEnable", "dtmfInterDigitTimeout", "dtmfMaxDigits", "dtmfMinDigits", "dtmfSubmitDigit", ], }, { key: "params_continuous_asr", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_CONTINUOUS_ASR__LABEL", defaultCollapsed: true, fields: ["asrEnabled", "asrDigit", "asrTimeout"], }, { key: "params_atmosphere_sound", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_ATMOSPHERE__LABEL", defaultCollapsed: true, fields: ["atmosphereAction", "atmosphereUrl", "atmosphereLoop", "atmosphereVolume"], }, { key: "params_silence_overlay", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_SILENCE_OVERLAY__LABEL", defaultCollapsed: true, fields: ["silenceOverlayAction", "silenceOverlayURL", "silenceOverlayDelay"], }, { key: "advanced", label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__SESSIONS_PARAMS_ADVANCED__LABEL", defaultCollapsed: true, fields: ["sessionParams"], }, ], tags: ["voice"], form: [ { type: "section", key: "params_tts" }, { type: "section", key: "params_stt" }, { type: "section", key: "params_bargein" }, { type: "section", key: "params_user_timeouts" }, { type: "section", key: "params_flow_timeouts" }, { type: "section", key: "params_dtmf" }, { type: "section", key: "params_continuous_asr" }, { type: "section", key: "params_azure_config" }, process.env.DISABLE_VG_ATMOSPHERE_NOISE !== "true" && { type: "section", key: "params_atmosphere_sound" }, process.env.DISABLE_VG_SILENCE_OVERLAY !== "true" && { type: "section", key: "params_silence_overlay" }, { type: "section", key: "advanced" }, ] .filter(element => !!element), function: async ({ cognigy, config }) => { const { api } = cognigy; const { sessionParams } = config; // code for applying as default false for flowNoInputTimeout to apply to old nodes. if (config.flowNoInputTimeoutEnable === undefined) { config.flowNoInputTimeoutEnable = false; } try { const voiceSettings = (0, setSessionConfig_mapper_2.voiceConfigParamsToVoiceSettings)(config, api); const payload = setSessionConfig_mapper_1.setSessionConfig.handleVGInput(voiceSettings, sessionParams, api); await api.say(null, { _cognigy: payload, }); (0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, voiceSettings); } catch (error) { throw new Error(`[VG2] Error on set session config node. Error message: ${error.message}`); } }, }); //# sourceMappingURL=setSessionConfig.js.map