@cognigy/rest-api-client 0.13.2 → 0.14.0
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/CHANGELOG.md +5 -1
- package/build/apigroups/ResourcesAPIGroup_2_0.js +15 -3
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +83 -13
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnection.js +14 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +19 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAIProviderConnection.js +11 -0
- package/build/shared/charts/descriptors/index.js +8 -5
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +22 -6
- package/build/shared/charts/descriptors/message/question/question.js +193 -25
- package/build/shared/charts/descriptors/message/say.js +33 -2
- package/build/shared/charts/descriptors/service/completeText.js +316 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +47 -1
- package/build/shared/charts/descriptors/service/index.js +3 -1
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +40 -7
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +93 -32
- package/build/shared/charts/descriptors/voice/nodes/play.js +8 -6
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +90 -8
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +2 -2
- package/build/shared/charts/descriptors/voice/utils/helper.js +11 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/agentAssist.js +2 -2
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +4 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +3 -3
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +125 -26
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +91 -7
- package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +18 -11
- package/build/shared/charts/descriptors/voicegateway2/utils/strip-nulls.js +4 -1
- package/build/shared/charts/helpers/generativeAI/getRephraseWithAIFields.js +100 -0
- package/build/shared/charts/helpers/generativeAI/rephraseSentenceWithAi.js +44 -0
- package/build/shared/constants.js +2 -1
- package/build/shared/interfaces/ai.js +16 -0
- package/build/shared/interfaces/analytics/IAnalyticsDataGoals.js +3 -0
- package/build/shared/interfaces/endpointInterface.js +1 -0
- package/build/shared/interfaces/filemanager/IRuntimeFile.js +30 -0
- package/build/shared/interfaces/filemanager/index.js +1 -0
- package/build/shared/interfaces/handover.js +39 -3
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/build/shared/interfaces/messageAPI/handover.js +6 -0
- package/build/shared/interfaces/resources/IConnectionSchema.js +2 -1
- package/build/shared/interfaces/resources/IExtension.js +2 -1
- package/build/shared/interfaces/resources/IFlow.js +2 -1
- package/build/shared/interfaces/resources/ILexicon.js +15 -2
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +1 -1
- package/build/shared/interfaces/resources/intent/IIntent.js +5 -2
- package/build/shared/interfaces/resources/intent/IIntentRelation.js +3 -1
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +9 -4
- package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +136 -0
- package/build/shared/interfaces/resources/settings/index.js +7 -1
- package/build/shared/interfaces/restAPI/resources/flow/v2.0/sentence/IGenerateSentencesRest_2_0.js +3 -0
- package/package.json +1 -1
- package/types/index.d.ts +569 -184
|
@@ -7,13 +7,15 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const play_mapper_1 = require("../mappers/play.mapper");
|
|
8
8
|
const design_1 = require("../utils/design");
|
|
9
9
|
const setSessionConfig_1 = require("../../voicegateway2/nodes/setSessionConfig");
|
|
10
|
-
const fields = setSessionConfig_1.voiceConfigFields.map(field => {
|
|
10
|
+
const fields = (setSessionConfig_1.voiceConfigFields.map(field => {
|
|
11
11
|
if (field.key !== "sttDisablePunctuation" &&
|
|
12
12
|
field.key !== "sttVadEnabled" &&
|
|
13
13
|
field.key !== "sttVadMode" &&
|
|
14
|
-
field.key !== "sttVadVoiceMs")
|
|
14
|
+
field.key !== "sttVadVoiceMs") {
|
|
15
15
|
return field;
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
})).filter(f => !!f);
|
|
17
19
|
exports.PLAY = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
18
20
|
type: "play",
|
|
19
21
|
defaultLabel: "Play URL",
|
|
@@ -49,7 +51,7 @@ exports.PLAY = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
49
51
|
key: "params_stt",
|
|
50
52
|
label: "Recognizer (STT)",
|
|
51
53
|
defaultCollapsed: true,
|
|
52
|
-
fields: ["sttVendor", "sttHints"],
|
|
54
|
+
fields: ["sttVendor", "sttHints", "enableAdvancedSTTConfig", "azureSttContextId", "azureEnableAudioLogging"],
|
|
53
55
|
condition: {
|
|
54
56
|
key: "setActivityParams",
|
|
55
57
|
value: true
|
|
@@ -74,14 +76,14 @@ exports.PLAY = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
74
76
|
key: "setActivityParams",
|
|
75
77
|
value: true
|
|
76
78
|
}
|
|
77
|
-
}
|
|
79
|
+
},
|
|
78
80
|
],
|
|
79
81
|
form: [
|
|
80
82
|
{ type: "field", key: "url" },
|
|
81
83
|
{ type: "field", key: "setActivityParams" },
|
|
82
84
|
{ type: "section", key: "params_stt" },
|
|
83
85
|
{ type: "section", key: "params_bargein" },
|
|
84
|
-
{ type: "section", key: "params_dtmf" }
|
|
86
|
+
{ type: "section", key: "params_dtmf" },
|
|
85
87
|
],
|
|
86
88
|
summary: "Streams a media file into the call",
|
|
87
89
|
function: async ({ cognigy, config }) => {
|
|
@@ -37,6 +37,81 @@ exports.voiceConfigFields = [
|
|
|
37
37
|
description: "Prevents the STT response from the bot to include punctuation marks",
|
|
38
38
|
defaultValue: false
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
key: "enableAdvancedSTTConfig",
|
|
42
|
+
type: "toggle",
|
|
43
|
+
label: "Enable Advanced STT Config",
|
|
44
|
+
description: "Advanced STT Configuration",
|
|
45
|
+
defaultValue: false
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: "azureSttContextId",
|
|
49
|
+
type: "cognigyText",
|
|
50
|
+
label: "Azure STT Context ID",
|
|
51
|
+
description: "Azure's Custom Speech model deployment ID",
|
|
52
|
+
defaultValue: "",
|
|
53
|
+
condition: {
|
|
54
|
+
and: [
|
|
55
|
+
{
|
|
56
|
+
key: "enableAdvancedSTTConfig",
|
|
57
|
+
value: true
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: "sttVendor",
|
|
61
|
+
value: "microsoft"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "azureEnableAudioLogging",
|
|
68
|
+
type: "toggle",
|
|
69
|
+
label: "Enable Audio Logging",
|
|
70
|
+
description: "Enables recording and logging of audio from the user on Azure.",
|
|
71
|
+
defaultValue: false,
|
|
72
|
+
condition: {
|
|
73
|
+
and: [
|
|
74
|
+
{
|
|
75
|
+
key: "enableAdvancedSTTConfig",
|
|
76
|
+
value: true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: "sttVendor",
|
|
80
|
+
value: "microsoft"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "enableAdvancedTTSConfig",
|
|
87
|
+
type: "toggle",
|
|
88
|
+
label: "Enable Advanced TTS Config",
|
|
89
|
+
description: "Enable Advanced TTS Configuration",
|
|
90
|
+
defaultValue: false,
|
|
91
|
+
condition: {
|
|
92
|
+
key: "ttsVendor",
|
|
93
|
+
value: "microsoft"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
key: "azureTtsDeploymentId",
|
|
98
|
+
type: "cognigyText",
|
|
99
|
+
label: "Azure Custom Voice Endpoint",
|
|
100
|
+
description: "Azure's Custom Speech model deployment ID",
|
|
101
|
+
defaultValue: "",
|
|
102
|
+
condition: {
|
|
103
|
+
and: [
|
|
104
|
+
{
|
|
105
|
+
key: "enableAdvancedTTSConfig",
|
|
106
|
+
value: true
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: "ttsVendor",
|
|
110
|
+
value: "microsoft"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
40
115
|
{
|
|
41
116
|
key: "ttsVendor",
|
|
42
117
|
defaultValue: "",
|
|
@@ -66,27 +141,34 @@ exports.SESSION_SPEECH_PARAMETERS = (0, createNodeDescriptor_1.createNodeDescrip
|
|
|
66
141
|
defaultLabel: "Session Speech Parameters - Config",
|
|
67
142
|
summary: "Change configuration settings for the call session",
|
|
68
143
|
appearance: {
|
|
69
|
-
color: design_1.nodeColor
|
|
144
|
+
color: design_1.nodeColor,
|
|
70
145
|
},
|
|
71
|
-
tags: [
|
|
146
|
+
tags: ["voice"],
|
|
72
147
|
fields: exports.voiceConfigFields,
|
|
73
148
|
sections: [
|
|
74
149
|
{
|
|
75
150
|
key: "params_stt",
|
|
76
151
|
label: "Recognizer (STT)",
|
|
77
152
|
defaultCollapsed: true,
|
|
78
|
-
fields: [
|
|
153
|
+
fields: [
|
|
154
|
+
"sttVendor",
|
|
155
|
+
"sttHints",
|
|
156
|
+
"sttDisablePunctuation",
|
|
157
|
+
"enableAdvancedSTTConfig",
|
|
158
|
+
"azureSttContextId",
|
|
159
|
+
"azureEnableAudioLogging",
|
|
160
|
+
],
|
|
79
161
|
},
|
|
80
162
|
{
|
|
81
163
|
key: "params_tts",
|
|
82
164
|
label: "Synthesizer (TTS)",
|
|
83
165
|
defaultCollapsed: true,
|
|
84
|
-
fields: ["ttsVendor"]
|
|
85
|
-
}
|
|
166
|
+
fields: ["ttsVendor", "enableAdvancedTTSConfig", "azureTtsDeploymentId"],
|
|
167
|
+
},
|
|
86
168
|
],
|
|
87
169
|
form: [
|
|
88
170
|
{ type: "section", key: "params_tts" },
|
|
89
|
-
{ type: "section", key: "params_stt" }
|
|
171
|
+
{ type: "section", key: "params_stt" },
|
|
90
172
|
],
|
|
91
173
|
function: async ({ cognigy, config }) => {
|
|
92
174
|
const { api, input } = cognigy;
|
|
@@ -94,12 +176,12 @@ exports.SESSION_SPEECH_PARAMETERS = (0, createNodeDescriptor_1.createNodeDescrip
|
|
|
94
176
|
try {
|
|
95
177
|
const payload = setSessionConfig_mapper_1.setSessionConfig.handleInput(endpointType, (0, setSessionConfig_mapper_1.voiceConfigParamsToVoiceSettings)(config, api));
|
|
96
178
|
api.say(null, {
|
|
97
|
-
_cognigy: payload
|
|
179
|
+
_cognigy: payload,
|
|
98
180
|
});
|
|
99
181
|
}
|
|
100
182
|
catch (error) {
|
|
101
183
|
throw new Error(`Error on Session Speech Parameters node. Error message: ${error.message}`);
|
|
102
184
|
}
|
|
103
|
-
}
|
|
185
|
+
},
|
|
104
186
|
});
|
|
105
187
|
//# sourceMappingURL=sessionSpeechParameters.js.map
|
|
@@ -93,8 +93,8 @@ exports.TRANSFER_VOICE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
const transferParams = {
|
|
96
|
-
transferReason
|
|
97
|
-
transferTarget:
|
|
96
|
+
transferReason,
|
|
97
|
+
transferTarget: referTo,
|
|
98
98
|
useTransferSipHeaders: useTransferSipHeaders,
|
|
99
99
|
transferSipHeaders: transferSipHeaders,
|
|
100
100
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidDTMF = void 0;
|
|
3
|
+
exports.isValidPhoneNumber = exports.isValidUrl = exports.isValidDTMF = void 0;
|
|
4
4
|
function isValidDTMF(dtmf) {
|
|
5
5
|
if (dtmf.length !== 1)
|
|
6
6
|
return false;
|
|
@@ -8,4 +8,14 @@ function isValidDTMF(dtmf) {
|
|
|
8
8
|
return regex.test(dtmf);
|
|
9
9
|
}
|
|
10
10
|
exports.isValidDTMF = isValidDTMF;
|
|
11
|
+
const isValidUrl = (url) => {
|
|
12
|
+
const regex = new RegExp("^(http|https)://");
|
|
13
|
+
return regex.test(url);
|
|
14
|
+
};
|
|
15
|
+
exports.isValidUrl = isValidUrl;
|
|
16
|
+
const isValidPhoneNumber = (number) => {
|
|
17
|
+
const regex = /^\+{0,2}([\-\. ])?(\(?\d{0,3}\))?([\-\. ])?\(?\d{0,3}\)?([\-\. ])?\d{3}([\-\. ])?\d{4}/;
|
|
18
|
+
return regex.test(number);
|
|
19
|
+
};
|
|
20
|
+
exports.isValidPhoneNumber = isValidPhoneNumber;
|
|
11
21
|
//# sourceMappingURL=helper.js.map
|
|
@@ -40,14 +40,14 @@ exports.agentAssistNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
40
40
|
{ value: "callee", label: "Callee (Agent) only" },
|
|
41
41
|
]
|
|
42
42
|
}
|
|
43
|
-
}
|
|
43
|
+
},
|
|
44
44
|
],
|
|
45
45
|
appearance: {
|
|
46
46
|
color: design_1.nodeColor
|
|
47
47
|
},
|
|
48
48
|
form: [
|
|
49
49
|
{ type: "field", key: "activity" },
|
|
50
|
-
{ type: "field", key: "targetParticipant" }
|
|
50
|
+
{ type: "field", key: "targetParticipant" },
|
|
51
51
|
],
|
|
52
52
|
function: async ({ cognigy, config }) => {
|
|
53
53
|
const { api } = cognigy;
|
|
@@ -67,7 +67,10 @@ exports.playNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
67
67
|
"sttDisablePunctuation",
|
|
68
68
|
"sttVadEnabled",
|
|
69
69
|
"sttVadMode",
|
|
70
|
-
"sttVadVoiceMs"
|
|
70
|
+
"sttVadVoiceMs",
|
|
71
|
+
"enableAdvancedSTTConfig",
|
|
72
|
+
"azureSttContextId",
|
|
73
|
+
"azureEnableAudioLogging"
|
|
71
74
|
],
|
|
72
75
|
condition: {
|
|
73
76
|
key: "setActivityParams",
|
|
@@ -7,7 +7,6 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const transfer_mapper_1 = require("../../voice/mappers/transfer.mapper");
|
|
8
8
|
const constants_1 = require("../utils/constants");
|
|
9
9
|
const design_1 = require("../utils/design");
|
|
10
|
-
const helper_1 = require("../utils/helper");
|
|
11
10
|
exports.referNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
12
11
|
type: "refer",
|
|
13
12
|
defaultLabel: "Refer",
|
|
@@ -81,9 +80,10 @@ exports.referNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
81
80
|
const { referTo, useTransferSipHeaders, transferSipHeaders } = config;
|
|
82
81
|
const transferParams = {
|
|
83
82
|
transferReason: '',
|
|
84
|
-
transferTarget:
|
|
83
|
+
transferTarget: referTo,
|
|
85
84
|
useTransferSipHeaders,
|
|
86
|
-
transferSipHeaders
|
|
85
|
+
transferSipHeaders,
|
|
86
|
+
transferType: "refer",
|
|
87
87
|
};
|
|
88
88
|
try {
|
|
89
89
|
const payload = transfer_mapper_1.transfer.handleInput(constants_1.ENDPOINTS.VOICE_GATEWAY, transferParams, false);
|
|
@@ -126,13 +126,13 @@ exports.voiceConfigFields = [
|
|
|
126
126
|
key: "ttsVoice",
|
|
127
127
|
type: "ttsSelect",
|
|
128
128
|
defaultValue: "",
|
|
129
|
-
label: "_unused_"
|
|
129
|
+
label: "_unused_"
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
key: "ttsLanguage",
|
|
133
133
|
type: "ttsSelect",
|
|
134
134
|
defaultValue: "",
|
|
135
|
-
label: "_unused_"
|
|
135
|
+
label: "_unused_"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
key: "userNoInputMode",
|
|
@@ -143,13 +143,16 @@ exports.voiceConfigFields = [
|
|
|
143
143
|
params: {
|
|
144
144
|
options: [
|
|
145
145
|
{
|
|
146
|
-
label: "Speak",
|
|
146
|
+
label: "Speak",
|
|
147
|
+
value: "speech"
|
|
147
148
|
},
|
|
148
149
|
{
|
|
149
|
-
label: "Play File",
|
|
150
|
+
label: "Play File",
|
|
151
|
+
value: "play"
|
|
150
152
|
},
|
|
151
153
|
{
|
|
152
|
-
label: "Send Event",
|
|
154
|
+
label: "Send Event",
|
|
155
|
+
value: "event"
|
|
153
156
|
}
|
|
154
157
|
]
|
|
155
158
|
}
|
|
@@ -161,8 +164,8 @@ exports.voiceConfigFields = [
|
|
|
161
164
|
description: "Define the timeout for user input in ms",
|
|
162
165
|
defaultValue: 10000,
|
|
163
166
|
params: {
|
|
164
|
-
min: 1000
|
|
165
|
-
}
|
|
167
|
+
min: 1000
|
|
168
|
+
}
|
|
166
169
|
},
|
|
167
170
|
{
|
|
168
171
|
key: "userNoInputRetries",
|
|
@@ -171,8 +174,8 @@ exports.voiceConfigFields = [
|
|
|
171
174
|
description: "Define how often the bot should retry to get an input from a user before completing the call",
|
|
172
175
|
defaultValue: 1,
|
|
173
176
|
params: {
|
|
174
|
-
min: 0
|
|
175
|
-
}
|
|
177
|
+
min: 0
|
|
178
|
+
}
|
|
176
179
|
},
|
|
177
180
|
{
|
|
178
181
|
key: "userNoInputSpeech",
|
|
@@ -217,12 +220,12 @@ exports.voiceConfigFields = [
|
|
|
217
220
|
defaultValue: 2000,
|
|
218
221
|
params: {
|
|
219
222
|
min: 1000,
|
|
220
|
-
max: 60000
|
|
223
|
+
max: 60000
|
|
221
224
|
},
|
|
222
225
|
condition: {
|
|
223
226
|
key: "dtmfEnable",
|
|
224
227
|
value: true
|
|
225
|
-
}
|
|
228
|
+
}
|
|
226
229
|
},
|
|
227
230
|
{
|
|
228
231
|
key: "dtmfMaxDigits",
|
|
@@ -231,7 +234,7 @@ exports.voiceConfigFields = [
|
|
|
231
234
|
description: "Defines the maximum number of digits which can be entered by the user, the digits are being submitted automatically once this limit is reached",
|
|
232
235
|
defaultValue: 1,
|
|
233
236
|
params: {
|
|
234
|
-
min: 1
|
|
237
|
+
min: 1
|
|
235
238
|
},
|
|
236
239
|
condition: {
|
|
237
240
|
key: "dtmfEnable",
|
|
@@ -245,7 +248,7 @@ exports.voiceConfigFields = [
|
|
|
245
248
|
description: "Defines the mininum number of digits before they are forwarded to the bot. This can be overridden by a submit digit",
|
|
246
249
|
defaultValue: 1,
|
|
247
250
|
params: {
|
|
248
|
-
min: 1
|
|
251
|
+
min: 1
|
|
249
252
|
},
|
|
250
253
|
condition: {
|
|
251
254
|
key: "dtmfEnable",
|
|
@@ -288,20 +291,99 @@ exports.voiceConfigFields = [
|
|
|
288
291
|
description: "Defines the number of milliseconds of silence before the accumulated recognitions are send to the flow",
|
|
289
292
|
defaultValue: 0,
|
|
290
293
|
params: {
|
|
291
|
-
min: 0
|
|
294
|
+
min: 0
|
|
292
295
|
},
|
|
293
296
|
condition: {
|
|
294
297
|
key: "asrEnabled",
|
|
295
298
|
value: true
|
|
296
299
|
}
|
|
297
300
|
},
|
|
301
|
+
{
|
|
302
|
+
key: "enableAdvancedSTTConfig",
|
|
303
|
+
type: "toggle",
|
|
304
|
+
label: "Enable Advanced STT Config",
|
|
305
|
+
description: "Advanced STT Configuration",
|
|
306
|
+
defaultValue: false,
|
|
307
|
+
condition: {
|
|
308
|
+
key: 'sttVendor',
|
|
309
|
+
value: 'microsoft'
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
key: "azureSttContextId",
|
|
314
|
+
type: "cognigyText",
|
|
315
|
+
label: "Azure STT Context ID",
|
|
316
|
+
description: "Azure's Custom Speech model deployment ID",
|
|
317
|
+
defaultValue: "",
|
|
318
|
+
condition: {
|
|
319
|
+
and: [
|
|
320
|
+
{
|
|
321
|
+
key: "enableAdvancedSTTConfig",
|
|
322
|
+
value: true
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
key: "sttVendor",
|
|
326
|
+
value: "microsoft"
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
key: "azureEnableAudioLogging",
|
|
333
|
+
type: "toggle",
|
|
334
|
+
label: "Enable Audio Logging",
|
|
335
|
+
description: "Enables recording and logging of audio from the user on Azure.",
|
|
336
|
+
defaultValue: false,
|
|
337
|
+
condition: {
|
|
338
|
+
and: [
|
|
339
|
+
{
|
|
340
|
+
key: "enableAdvancedSTTConfig",
|
|
341
|
+
value: true
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
key: "sttVendor",
|
|
345
|
+
value: "microsoft"
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
key: "enableAdvancedTTSConfig",
|
|
352
|
+
type: "toggle",
|
|
353
|
+
label: "Enable Advanced TTS Config",
|
|
354
|
+
description: "Enable Advanced TTS Configuration",
|
|
355
|
+
defaultValue: false,
|
|
356
|
+
condition: {
|
|
357
|
+
key: "ttsVendor",
|
|
358
|
+
value: "microsoft",
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
key: "azureTtsDeploymentId",
|
|
363
|
+
type: "cognigyText",
|
|
364
|
+
label: "Azure Custom Voice Endpoint",
|
|
365
|
+
description: "Azure's Custom Speech model deployment ID",
|
|
366
|
+
defaultValue: "",
|
|
367
|
+
condition: {
|
|
368
|
+
and: [
|
|
369
|
+
{
|
|
370
|
+
key: "enableAdvancedTTSConfig",
|
|
371
|
+
value: true
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
key: "ttsVendor",
|
|
375
|
+
value: "microsoft"
|
|
376
|
+
}
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
}
|
|
298
380
|
];
|
|
299
381
|
exports.setSessionConfigNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
300
382
|
type: "setSessionConfig",
|
|
301
383
|
defaultLabel: "Set Session Config",
|
|
302
384
|
summary: "Change configuration settings for the call session",
|
|
303
385
|
appearance: {
|
|
304
|
-
color: design_1.nodeColor
|
|
386
|
+
color: design_1.nodeColor,
|
|
305
387
|
},
|
|
306
388
|
fields: exports.voiceConfigFields,
|
|
307
389
|
sections: [
|
|
@@ -309,19 +391,29 @@ exports.setSessionConfigNode = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
309
391
|
key: "params_stt",
|
|
310
392
|
label: "Recognizer (STT)",
|
|
311
393
|
defaultCollapsed: true,
|
|
312
|
-
fields: [
|
|
394
|
+
fields: [
|
|
395
|
+
"sttVendor",
|
|
396
|
+
"sttHints",
|
|
397
|
+
"sttDisablePunctuation",
|
|
398
|
+
"sttVadEnabled",
|
|
399
|
+
"sttVadMode",
|
|
400
|
+
"sttVadVoiceMs",
|
|
401
|
+
"enableAdvancedSTTConfig",
|
|
402
|
+
"azureSttContextId",
|
|
403
|
+
"azureEnableAudioLogging"
|
|
404
|
+
],
|
|
313
405
|
},
|
|
314
406
|
{
|
|
315
407
|
key: "params_tts",
|
|
316
408
|
label: "Synthesizer (TTS)",
|
|
317
409
|
defaultCollapsed: true,
|
|
318
|
-
fields: ["ttsVendor"]
|
|
410
|
+
fields: ["ttsVendor", "enableAdvancedTTSConfig", "azureTtsDeploymentId"],
|
|
319
411
|
},
|
|
320
412
|
{
|
|
321
413
|
key: "params_bargein",
|
|
322
414
|
label: "Barge In",
|
|
323
415
|
defaultCollapsed: true,
|
|
324
|
-
fields: ["bargeInOnSpeech", "bargeInOnDtmf", "bargeInMinWordCount"]
|
|
416
|
+
fields: ["bargeInOnSpeech", "bargeInOnDtmf", "bargeInMinWordCount"],
|
|
325
417
|
},
|
|
326
418
|
{
|
|
327
419
|
key: "params_user_timeouts",
|
|
@@ -332,21 +424,27 @@ exports.setSessionConfigNode = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
332
424
|
"userNoInputSpeech",
|
|
333
425
|
"userNoInputUrl",
|
|
334
426
|
"userNoInputTimeout",
|
|
335
|
-
"userNoInputRetries"
|
|
336
|
-
]
|
|
427
|
+
"userNoInputRetries",
|
|
428
|
+
],
|
|
337
429
|
},
|
|
338
430
|
{
|
|
339
431
|
key: "params_dtmf",
|
|
340
432
|
label: "DTMF",
|
|
341
433
|
defaultCollapsed: true,
|
|
342
|
-
fields: [
|
|
434
|
+
fields: [
|
|
435
|
+
"dtmfEnable",
|
|
436
|
+
"dtmfInterDigitTimeout",
|
|
437
|
+
"dtmfMaxDigits",
|
|
438
|
+
"dtmfMinDigits",
|
|
439
|
+
"dtmfSubmitDigit",
|
|
440
|
+
],
|
|
343
441
|
},
|
|
344
442
|
{
|
|
345
443
|
key: "params_continuous_asr",
|
|
346
444
|
label: "Continuous ASR",
|
|
347
445
|
defaultCollapsed: true,
|
|
348
446
|
fields: ["asrEnabled", "asrDigit", "asrTimeout"],
|
|
349
|
-
}
|
|
447
|
+
},
|
|
350
448
|
],
|
|
351
449
|
form: [
|
|
352
450
|
{ type: "section", key: "params_tts" },
|
|
@@ -355,18 +453,19 @@ exports.setSessionConfigNode = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
355
453
|
{ type: "section", key: "params_user_timeouts" },
|
|
356
454
|
{ type: "section", key: "params_dtmf" },
|
|
357
455
|
{ type: "section", key: "params_continuous_asr" },
|
|
456
|
+
{ type: "section", key: "params_azure_config" },
|
|
358
457
|
],
|
|
359
458
|
function: async ({ cognigy, config }) => {
|
|
459
|
+
const { api } = cognigy;
|
|
360
460
|
try {
|
|
361
|
-
const payload = setSessionConfig_mapper_1.setSessionConfig.handleVGInput((0, setSessionConfig_mapper_2.voiceConfigParamsToVoiceSettings)(config,
|
|
362
|
-
|
|
461
|
+
const payload = setSessionConfig_mapper_1.setSessionConfig.handleVGInput((0, setSessionConfig_mapper_2.voiceConfigParamsToVoiceSettings)(config, api));
|
|
462
|
+
api.say(null, {
|
|
363
463
|
_cognigy: payload,
|
|
364
464
|
});
|
|
365
465
|
}
|
|
366
466
|
catch (error) {
|
|
367
467
|
throw new Error(`[VG2] Error on set session config node. Error message: ${error.message}`);
|
|
368
468
|
}
|
|
369
|
-
|
|
370
|
-
}
|
|
469
|
+
},
|
|
371
470
|
});
|
|
372
471
|
//# sourceMappingURL=setSessionConfig.js.map
|