@cognigy/rest-api-client 0.18.0 → 0.19.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 +6 -0
- package/build/apigroups/AdministrationAPIGroup_2_0.js +3 -1
- package/build/apigroups/MetricsAPIGroup_2_0.js +5 -0
- package/build/apigroups/ResourcesAPIGroup_2_0.js +9 -6
- package/build/shared/charts/descriptors/agentAssist/helpers/determineMetadata.js +15 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/knowledgeSearch/answerExtraction.helper.js +1 -1
- package/build/shared/charts/descriptors/agentAssist/helpers/knowledgeSearch/followUpDetection.helper.js +2 -2
- package/build/shared/charts/descriptors/agentAssist/identityAssist.js +1 -1
- package/build/shared/charts/descriptors/agentAssist/knowledgeAssist.js +1 -1
- package/build/shared/charts/descriptors/agentAssist/nextActionAssist.js +4 -5
- package/build/shared/charts/descriptors/agentAssist/sentimentAssist.js +1 -1
- package/build/shared/charts/descriptors/agentAssist/setAdaptiveCardTile.js +2 -0
- package/build/shared/charts/descriptors/agentAssist/setAgentAssistGrid.js +2 -1
- package/build/shared/charts/descriptors/agentAssist/setHtmlTile.js +5 -3
- package/build/shared/charts/descriptors/agentAssist/setIframeTile.js +5 -3
- package/build/shared/charts/descriptors/agentAssist/setSecureFormsTile.js +2 -2
- package/build/shared/charts/descriptors/agentAssist/transcriptAssist.js +2 -1
- package/build/shared/charts/descriptors/analytics/activateProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/blindMode.js +2 -0
- package/build/shared/charts/descriptors/analytics/completeGoal.js +1 -0
- package/build/shared/charts/descriptors/analytics/deactivateProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/deleteProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/index.js +3 -1
- package/build/shared/charts/descriptors/analytics/mergeProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/overwriteAnalytics.js +9 -0
- package/build/shared/charts/descriptors/analytics/setRating.js +4 -2
- package/build/shared/charts/descriptors/analytics/trackMilestone.js +95 -0
- package/build/shared/charts/descriptors/analytics/updateProfile.js +1 -0
- package/build/shared/charts/descriptors/apps/initAppSession.js +1 -0
- package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +35 -10
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +25 -2
- package/build/shared/charts/descriptors/apps/utils/getXAppsOverlaySettings.js +54 -0
- package/build/shared/charts/descriptors/connectionNodes/documentParserProviders/azureAIDocumentIntelligenceConnection.js +12 -0
- package/build/shared/charts/descriptors/connectionNodes/documentParserProviders/index.js +13 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/awsBedrockProviderConnection.js +12 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnection.js +4 -3
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnectionV2.js +3 -3
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderOauth2Connection.js +14 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +16 -8
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAIProviderConnection.js +3 -3
- package/build/shared/charts/descriptors/data/addToContext.js +7 -0
- package/build/shared/charts/descriptors/data/copyDataToContext.js +3 -0
- package/build/shared/charts/descriptors/data/copySlotsToContext.js +3 -0
- package/build/shared/charts/descriptors/data/debugMessage.js +73 -0
- package/build/shared/charts/descriptors/data/index.js +3 -1
- package/build/shared/charts/descriptors/data/removeFromContext.js +9 -1
- package/build/shared/charts/descriptors/data/resetContext.js +1 -0
- package/build/shared/charts/descriptors/index.js +7 -1
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +35 -10
- package/build/shared/charts/descriptors/logic/resetState.js +1 -0
- package/build/shared/charts/descriptors/logic/setState.js +2 -1
- package/build/shared/charts/descriptors/logic/setTranslation.js +3 -1
- package/build/shared/charts/descriptors/logic/switchLocale.js +1 -0
- package/build/shared/charts/descriptors/logic/think.js +3 -1
- package/build/shared/charts/descriptors/logic/thinkV2.js +2 -0
- package/build/shared/charts/descriptors/message/question/question.js +50 -5
- package/build/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +4 -2
- package/build/shared/charts/descriptors/nlu/cleanText.js +1 -0
- package/build/shared/charts/descriptors/nlu/fuzzySearch.js +23 -1
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/prompt.js +19 -9
- package/build/shared/charts/descriptors/service/GPTPrompt.js +59 -24
- package/build/shared/charts/descriptors/service/LLMEntityExtract.js +11 -2
- package/build/shared/charts/descriptors/service/handoverV2.js +84 -1
- package/build/shared/charts/descriptors/service/httpRequest.js +35 -2
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +96 -17
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/continuousAsr.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -0
- package/build/shared/charts/descriptors/voice/nodes/noUserInput.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +2 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +2 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +2 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +3 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +1 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/record.js +1 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +1 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +1 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +298 -8
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +10 -6
- package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +2 -2
- package/build/shared/charts/helpers/generativeAI/rephraseSentenceWithAi.js +4 -2
- package/build/shared/constants.js +10 -1
- package/build/shared/handoverClients/interfaces/THandoverEventType.js +1 -0
- package/build/shared/helper/logFullConfigToDebugMode.js +30 -0
- package/build/shared/helper/nlu/textCleaner.js +3 -1
- package/build/shared/interfaces/IOrganisation.js +1 -0
- package/build/shared/interfaces/IProfile.js +1 -0
- package/build/shared/interfaces/IProfileSchema.js +3 -0
- package/build/shared/interfaces/analytics/IAnalyticsSourceData.js +20 -20
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IJourneyStep_2_0.js → analytics/IMilestoneAnalytics.js} +1 -1
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IJourneyProgress_2_0.js → appsession/ISetAppStateOptions.js} +1 -1
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IJourneyIndexItem_2_0.js → appsession/ISetAppStateOverlaySettings.js} +1 -1
- package/build/shared/interfaces/appsession/ISetAppStateOverlaySettingsMetaData.js +3 -0
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IIndexJourneysRest_2_0.js → debugEvents/TDebugEventMessagePayload.js} +1 -1
- package/build/shared/interfaces/debugEvents/TDebugEventType.js +2 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +33 -69
- package/build/shared/interfaces/handover.js +42 -1
- package/build/shared/interfaces/license.js +3 -2
- package/build/shared/interfaces/license.js.map +1 -1
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/build/shared/interfaces/messageAPI/handover.js +20 -1
- package/build/shared/interfaces/resources/IConnection.js +1 -0
- package/build/shared/interfaces/resources/IEndpoint.js +1 -2
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +25 -4
- package/build/shared/interfaces/resources/IMilestone.js +1 -1
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +12 -0
- package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +1 -1
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +12 -7
- package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +4 -0
- package/build/shared/interfaces/resources/settings/IKnowledgeAISettings.js +18 -0
- package/build/shared/interfaces/resources/settings/index.js +4 -1
- package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IReadCollectionsToBeDeletedRest_2_0.js +0 -1
- package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IReadOrganisationKnowledgeChunksCountRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/operations/nlu/v2.0/IGenerateNluScoresRest_2_0.js +57 -0
- package/build/shared/interfaces/restAPI/{resources/journey/v2.0/IJourney_2_0.js → operations/nlu/v2.0/index.js} +1 -1
- package/build/shared/interfaces/restAPI/resources/largeLanguageModel/v2.0/IAvailableModelsForLLMProvider_2_0 .js +18 -0
- package/build/shared/interfaces/restAPI/resources/largeLanguageModel/v2.0/IGetAvailableModelsForLLMRest_2_0 .js +3 -0
- package/build/shared/interfaces/security/IRole.js +2 -0
- package/build/shared/interfaces/security/ISystemCapabilities.js +3 -0
- package/build/shared/interfaces/security/index.js +1 -1
- package/build/shared/interfaces/trainer/ITrainerRecord.js +2 -2
- package/build/shared/interfaces/user.js +1 -1
- package/package.json +2 -2
- package/types/index.d.ts +1254 -670
- package/build/shared/interfaces/journeys/IJourney.js +0 -83
- package/build/shared/interfaces/journeys/IJourneyProgress.js +0 -40
- package/build/shared/interfaces/journeys/IJourneyTrackEvent.js +0 -35
- package/build/shared/interfaces/journeys/index.js +0 -14
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IJourneyTrackEvents_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IReadJourneyProgressRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IReadJourneyRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/ITrackJourneyEventRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IUpdateSelectedJourneyRest_2_0.js +0 -3
- /package/build/shared/interfaces/restAPI/{resources/journey/v2.0 → operations}/index.js +0 -0
|
@@ -28,9 +28,9 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
28
28
|
params: {
|
|
29
29
|
multiline: true,
|
|
30
30
|
rows: 5,
|
|
31
|
-
required:
|
|
31
|
+
required: false
|
|
32
32
|
},
|
|
33
|
-
defaultValue:
|
|
33
|
+
defaultValue: undefined
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
key: "chatTranscriptSteps",
|
|
@@ -250,7 +250,18 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
250
250
|
type: "textArray",
|
|
251
251
|
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STREAM_STOP_TOKENS__LABEL",
|
|
252
252
|
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STREAM_STOP_TOKENS__DESCRIPTION",
|
|
253
|
-
defaultValue: [".", "!", "?"],
|
|
253
|
+
defaultValue: [".", "!", "?", "\\n"],
|
|
254
|
+
condition: {
|
|
255
|
+
key: "storeLocation",
|
|
256
|
+
value: "stream",
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
key: "streamStopTokenOverrides",
|
|
261
|
+
type: "textArray",
|
|
262
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STREAM_STOP_TOKEN_OVERRIDES__LABEL",
|
|
263
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STREAM_STOP_TOKEN_OVERRIDES__DESCRIPTION",
|
|
264
|
+
defaultValue: ["\d+\."],
|
|
254
265
|
condition: {
|
|
255
266
|
key: "storeLocation",
|
|
256
267
|
value: "stream",
|
|
@@ -473,6 +484,7 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
473
484
|
"contextKey",
|
|
474
485
|
"immediateOutput",
|
|
475
486
|
"streamStopTokens",
|
|
487
|
+
"streamStopTokenOverrides",
|
|
476
488
|
"streamStoreCopyInInput",
|
|
477
489
|
"detailedResults"
|
|
478
490
|
]
|
|
@@ -488,22 +500,22 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
488
500
|
]
|
|
489
501
|
},
|
|
490
502
|
{
|
|
491
|
-
key: "
|
|
492
|
-
label: "
|
|
503
|
+
key: "customOptions",
|
|
504
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__SECTIONS__CUSTOM_OPTIONS__LABEL",
|
|
493
505
|
defaultCollapsed: true,
|
|
494
506
|
fields: [
|
|
495
|
-
"
|
|
496
|
-
"
|
|
497
|
-
"debugLogRequestAndCompletion"
|
|
507
|
+
"customModelOptions",
|
|
508
|
+
"customRequestOptions"
|
|
498
509
|
]
|
|
499
510
|
},
|
|
500
511
|
{
|
|
501
|
-
key: "
|
|
502
|
-
label: "
|
|
512
|
+
key: "debugging",
|
|
513
|
+
label: "UI__NODE_EDITOR__SECTIONS__DEBUG_SETTINGS__LABEL",
|
|
503
514
|
defaultCollapsed: true,
|
|
504
515
|
fields: [
|
|
505
|
-
"
|
|
506
|
-
"
|
|
516
|
+
"debugDescription",
|
|
517
|
+
"debugLogTokenCount",
|
|
518
|
+
"debugLogRequestAndCompletion"
|
|
507
519
|
]
|
|
508
520
|
}
|
|
509
521
|
],
|
|
@@ -515,15 +527,15 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
515
527
|
{ type: "section", key: "advanced" },
|
|
516
528
|
{ type: "section", key: "storage" },
|
|
517
529
|
{ type: "section", key: "errorHandling" },
|
|
530
|
+
{ type: "section", key: "customOptions" },
|
|
518
531
|
{ type: "section", key: "debugging" },
|
|
519
|
-
{ type: "section", key: "customOptions" }
|
|
520
532
|
],
|
|
521
533
|
appearance: {},
|
|
522
534
|
tags: ["service", "llm", "gpt", "generative ai", "openai", "azure", "prompt"],
|
|
523
535
|
function: async ({ cognigy, config, nodeId }) => {
|
|
524
|
-
var _a;
|
|
536
|
+
var _a, _b, _c;
|
|
525
537
|
const { api, input } = cognigy;
|
|
526
|
-
const { temperature, maxTokens, topP, presencePenalty, frequencyPenalty, useStop, stop, storeLocation, contextKey, inputKey, timeout, streamStopTokens, debugLogTokenCount, debugLogRequestAndCompletion, llmProviderReferenceId, useChatMode, chatTranscriptSteps, responseFormat, streamStoreCopyInInput, detailedResults, seed, immediateOutput, customModelOptions, customRequestOptions, errorHandling = "continue", // default behavior for LLM Prompt node was, continue its execution even though an error occurred (deviating it from the SEO node) & do not output an error message on UI explicitly. However, error is always stored in the input or context object. We can use an extra "say" node to output it.
|
|
538
|
+
const { temperature, maxTokens, topP, presencePenalty, frequencyPenalty, useStop, stop, storeLocation, contextKey, inputKey, timeout, streamStopTokens, streamStopTokenOverrides, debugLogTokenCount, debugLogRequestAndCompletion, llmProviderReferenceId, useChatMode, chatTranscriptSteps, responseFormat, streamStoreCopyInInput, detailedResults, seed, immediateOutput, customModelOptions, customRequestOptions, errorHandling = "continue", // default behavior for LLM Prompt node was, continue its execution even though an error occurred (deviating it from the SEO node) & do not output an error message on UI explicitly. However, error is always stored in the input or context object. We can use an extra "say" node to output it.
|
|
527
539
|
errorHandlingGotoTarget, errorMessage, } = config;
|
|
528
540
|
let prompt = config.prompt;
|
|
529
541
|
const { traceId } = input;
|
|
@@ -549,13 +561,17 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
549
561
|
}
|
|
550
562
|
// handle errors from external services, depending on the settings
|
|
551
563
|
const handleServiceError = async (error) => {
|
|
552
|
-
var _a;
|
|
564
|
+
var _a, _b, _c;
|
|
553
565
|
const compactError = {
|
|
554
566
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
555
567
|
code: error === null || error === void 0 ? void 0 : error.code,
|
|
556
568
|
message: (error === null || error === void 0 ? void 0 : error.message) || error
|
|
557
569
|
};
|
|
558
|
-
|
|
570
|
+
// return the requestId if it exist in the error obj.
|
|
571
|
+
if ((_a = error === null || error === void 0 ? void 0 : error.meta) === null || _a === void 0 ? void 0 : _a.requestId) {
|
|
572
|
+
compactError["requestId"] = (_b = error === null || error === void 0 ? void 0 : error.meta) === null || _b === void 0 ? void 0 : _b.requestId;
|
|
573
|
+
}
|
|
574
|
+
if ((_c = error === null || error === void 0 ? void 0 : error.originalErrorDetails) === null || _c === void 0 ? void 0 : _c.code) {
|
|
559
575
|
compactError.code = error.originalErrorDetails.code;
|
|
560
576
|
}
|
|
561
577
|
const errorResponse = {
|
|
@@ -619,6 +635,7 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
619
635
|
}
|
|
620
636
|
},
|
|
621
637
|
streamStopTokens,
|
|
638
|
+
streamStopTokenOverrides,
|
|
622
639
|
detailedResults,
|
|
623
640
|
seed: Number(seed) ? Number(seed) : undefined,
|
|
624
641
|
customModelOptions,
|
|
@@ -641,15 +658,24 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
641
658
|
debugPrompt = JSON.stringify(data["chat"]);
|
|
642
659
|
}
|
|
643
660
|
const response = await api.runGenerativeAIPrompt(data, "gptPromptNode");
|
|
644
|
-
|
|
645
|
-
input.channel === "adminconsole" && (0, prompt_1.writeLLMDebugLogs)("LLM Prompt", debugPrompt, response, debugLogTokenCount, debugLogRequestAndCompletion, cognigy);
|
|
661
|
+
const isFollowSessionActive = api.getMetadata().isFollowSessionActive;
|
|
646
662
|
if (detailedResults) {
|
|
647
|
-
|
|
648
|
-
|
|
663
|
+
if ((response === null || response === void 0 ? void 0 : response.usage) && response.usage.promptTokens && response.usage.completionTokens) {
|
|
664
|
+
// the api has usage results, but in Azure format - reformat to OpenAI format
|
|
665
|
+
const u = response.usage;
|
|
666
|
+
response.usage = {
|
|
667
|
+
prompt_tokens: u.promptTokens,
|
|
668
|
+
completion_tokens: u.completionTokens,
|
|
669
|
+
total_tokens: u.promptTokens + u.completionTokens,
|
|
670
|
+
calculation_method: "api"
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
else if (!response.usage) {
|
|
674
|
+
// if the api didn't return native usage results, compute them
|
|
649
675
|
const promptContent = (response.messages) ? JSON.stringify(response.messages) : prompt;
|
|
650
676
|
delete response.messages;
|
|
651
677
|
const prompt_tokens = await api.countGPTTokens(promptContent);
|
|
652
|
-
const completion_tokens = await api.countGPTTokens(response.result);
|
|
678
|
+
const completion_tokens = await api.countGPTTokens((typeof response.result === "object") ? JSON.stringify(response.result) : response.result);
|
|
653
679
|
response.usage = {
|
|
654
680
|
prompt_tokens,
|
|
655
681
|
completion_tokens,
|
|
@@ -658,6 +684,8 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
658
684
|
};
|
|
659
685
|
}
|
|
660
686
|
}
|
|
687
|
+
// if we're in adminconsole or following a session, process debugging options
|
|
688
|
+
(input.endpointType === "adminconsole" || isFollowSessionActive) && (0, prompt_1.writeLLMDebugLogs)("LLM Prompt", debugPrompt, response, debugLogTokenCount, debugLogRequestAndCompletion, cognigy);
|
|
661
689
|
if (storeLocation === "context") {
|
|
662
690
|
api.addToContext(contextKey, response, "simple");
|
|
663
691
|
// output result immediately if toggle is set
|
|
@@ -678,12 +706,19 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
678
706
|
}
|
|
679
707
|
}
|
|
680
708
|
catch (error) {
|
|
681
|
-
const
|
|
709
|
+
const errorDetailsBase = {
|
|
682
710
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
683
711
|
code: (error === null || error === void 0 ? void 0 : error.code) || (error === null || error === void 0 ? void 0 : error.httpStatusCode),
|
|
684
712
|
message: (error === null || error === void 0 ? void 0 : error.message) || ((_a = error.originalErrorDetails) === null || _a === void 0 ? void 0 : _a.message),
|
|
685
|
-
originalErrorDetails: error === null || error === void 0 ? void 0 : error.originalErrorDetails
|
|
686
713
|
};
|
|
714
|
+
const errorDetails = Object.assign(Object.assign({}, errorDetailsBase), { originalErrorDetails: error === null || error === void 0 ? void 0 : error.originalErrorDetails });
|
|
715
|
+
// return the requestId if it exist in the error obj.
|
|
716
|
+
if ((_b = error.meta) === null || _b === void 0 ? void 0 : _b.requestId) {
|
|
717
|
+
errorDetails["meta"] = {
|
|
718
|
+
requestId: (_c = error.meta) === null || _c === void 0 ? void 0 : _c.requestId
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
api.logDebugError(errorDetailsBase, "UI__DEBUG_MODE__LLM_PROMPT__ERROR");
|
|
687
722
|
await handleServiceError(errorDetails);
|
|
688
723
|
return;
|
|
689
724
|
}
|
|
@@ -228,8 +228,7 @@ exports.LLM_ENTITY_EXTRACT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
228
228
|
}
|
|
229
229
|
options["chat"] = (0, prompt_1.createLastConversationChatObject)(cognigy.lastConversationEntries, (0, generativeAIPrompts_1.getLLMEntityExtractSystemMessage)(entityName, entityDescription, examples), 3, true);
|
|
230
230
|
const response = await api.runGenerativeAIPrompt(options, "gptPromptNode");
|
|
231
|
-
|
|
232
|
-
input.channel === "adminconsole" && (0, prompt_1.writeLLMDebugLogs)("LLM Entity Extract", prompt, response, debugLogTokenCount, debugLogRequestAndCompletion, cognigy);
|
|
231
|
+
(0, prompt_1.writeLLMDebugLogs)("LLM Entity Extract", prompt, response, debugLogTokenCount, debugLogRequestAndCompletion, cognigy);
|
|
233
232
|
// find the entity in the response
|
|
234
233
|
let result = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a[entityName];
|
|
235
234
|
if (!result) {
|
|
@@ -248,10 +247,19 @@ exports.LLM_ENTITY_EXTRACT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
248
247
|
}
|
|
249
248
|
if (storeLocation === "context") {
|
|
250
249
|
api.addToContext(contextKey, result, "simple");
|
|
250
|
+
if (result) {
|
|
251
|
+
api.logDebugMessage(`context.${contextKey} = '${result}'`);
|
|
252
|
+
}
|
|
251
253
|
}
|
|
252
254
|
else if (storeLocation === "input") {
|
|
253
255
|
// @ts-ignore
|
|
254
256
|
api.addToInput(inputKey, result);
|
|
257
|
+
if (result) {
|
|
258
|
+
api.logDebugMessage(`input.${inputKey} = '${result}'`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (!result) {
|
|
262
|
+
api.logDebugMessage(`UI__DEBUG_MODE__LLM_ENTITY_EXTRACT__MESSAGE`);
|
|
255
263
|
}
|
|
256
264
|
}
|
|
257
265
|
catch (error) {
|
|
@@ -260,6 +268,7 @@ exports.LLM_ENTITY_EXTRACT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
260
268
|
code: error.code,
|
|
261
269
|
message: error.message || ((_b = error.originalErrorDetails) === null || _b === void 0 ? void 0 : _b.message),
|
|
262
270
|
};
|
|
271
|
+
api.logDebugError(errorDetails);
|
|
263
272
|
if (storeLocation === "context") {
|
|
264
273
|
api.addToContext(contextKey, { error: errorDetails }, "simple");
|
|
265
274
|
}
|
|
@@ -235,6 +235,77 @@ exports.HANDOVER_V2 = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
235
235
|
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__SEND_ON_ACTIVE_EVENT__LABEL",
|
|
236
236
|
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__SEND_ON_ACTIVE_EVENT__DESCRIPTION",
|
|
237
237
|
},
|
|
238
|
+
{
|
|
239
|
+
key: "getQueuePosition",
|
|
240
|
+
type: "toggle",
|
|
241
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_GET_QUEUE_POSITION__LABEL",
|
|
242
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_GET_QUEUE_POSITION__DESCRIPTION",
|
|
243
|
+
defaultValue: false,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
key: "updateIntervalQueuePosition",
|
|
247
|
+
type: "number",
|
|
248
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_UPDATE_INTERVAL__LABEL",
|
|
249
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_UPDATE_INTERVAL__DESCRIPTION",
|
|
250
|
+
condition: {
|
|
251
|
+
key: "getQueuePosition",
|
|
252
|
+
value: true
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
key: "getEstimatedWaitTime",
|
|
257
|
+
type: "toggle",
|
|
258
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_GET_ESTIMATED_WAIT_TIME__LABEL",
|
|
259
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_GET_ESTIMATED_WAIT_TIME__DESCRIPTION",
|
|
260
|
+
defaultValue: false,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
key: "updateIntervalEstimatedWaitTime",
|
|
264
|
+
type: "number",
|
|
265
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_UPDATE_INTERVAL__LABEL",
|
|
266
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_UPDATE_INTERVAL__DESCRIPTION",
|
|
267
|
+
condition: {
|
|
268
|
+
key: "getEstimatedWaitTime",
|
|
269
|
+
value: true
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
key: "alternativeUpdate",
|
|
274
|
+
type: "toggle",
|
|
275
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_ALTERNATIVE_UPDATE__LABEL",
|
|
276
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_ALTERNATIVE_UPDATE__DESCRIPTION",
|
|
277
|
+
defaultValue: false,
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
key: "maximumQueuePosition",
|
|
281
|
+
type: "number",
|
|
282
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_MAXIMUM_QUEUE_POSITION__LABEL",
|
|
283
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_MAXIMUM_QUEUE_POSITION__DESCRIPTION",
|
|
284
|
+
condition: {
|
|
285
|
+
key: "alternativeUpdate",
|
|
286
|
+
value: true,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
key: "maximumEstimatedWaitTime",
|
|
291
|
+
type: "number",
|
|
292
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_MAXIMUM_ESTIMATED_WAIT_TIME__LABEL",
|
|
293
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_MAXIMUM_ESTIMATED_WAIT_TIME__DESCRIPTION",
|
|
294
|
+
condition: {
|
|
295
|
+
key: "alternativeUpdate",
|
|
296
|
+
value: true,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
key: "alternativeText",
|
|
301
|
+
type: "cognigyText",
|
|
302
|
+
label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_ALTERNATIVE_TEXT__LABEL",
|
|
303
|
+
description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__LIVE_AGENT_ALTERNATIVE_TEXT__DESCRIPTION",
|
|
304
|
+
condition: {
|
|
305
|
+
key: "alternativeUpdate",
|
|
306
|
+
value: true,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
238
309
|
],
|
|
239
310
|
sections: [
|
|
240
311
|
{
|
|
@@ -266,7 +337,19 @@ exports.HANDOVER_V2 = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
266
337
|
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.LIVE_AGENT_PRIORITY,
|
|
267
338
|
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.AGENT_ASSIST_INIT_MESSAGE,
|
|
268
339
|
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.ALLOW_AGENT_INJECT,
|
|
269
|
-
|
|
340
|
+
...(process.env.FEATURE_USE_QUEUE_UPDATE_EVENTS === "true"
|
|
341
|
+
? [
|
|
342
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.GET_QUEUE_POSITION,
|
|
343
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.UPDATE_INTERVAL_QUEUE_POSITION,
|
|
344
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.GET_ESTIMATED_WAIT_TIME,
|
|
345
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.UPDATE_INTERVAL_ESTIMATED_WAIT_TIME,
|
|
346
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.ALTERNATIVE_UPDATE,
|
|
347
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.MAXIMUM_QUEUE_POSITION,
|
|
348
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.MAXIMUM_ESTIMATED_WAIT_TIME,
|
|
349
|
+
constants_1.COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.ALTERNATIVE_TEXT,
|
|
350
|
+
]
|
|
351
|
+
: [])
|
|
352
|
+
],
|
|
270
353
|
},
|
|
271
354
|
{
|
|
272
355
|
key: "chatwootSettings",
|
|
@@ -234,6 +234,10 @@ exports.HTTP_REQUEST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
234
234
|
value: "apiKeyXKey"
|
|
235
235
|
}
|
|
236
236
|
]
|
|
237
|
+
},
|
|
238
|
+
resetOption: {
|
|
239
|
+
lookupValue: "none",
|
|
240
|
+
fieldsToReset: ["basicConnection", "apiKeyAuthKeyConnection", "apiKeyXKeyConnection", "oAuth2Connection"]
|
|
237
241
|
}
|
|
238
242
|
},
|
|
239
243
|
{
|
|
@@ -376,6 +380,34 @@ exports.HTTP_REQUEST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
376
380
|
]
|
|
377
381
|
}
|
|
378
382
|
},
|
|
383
|
+
{
|
|
384
|
+
key: "debugLogging",
|
|
385
|
+
type: "select",
|
|
386
|
+
label: "UI__NODE_EDITOR__SERVICE__HTTP_REQUEST__FIELDS__DEBUG_LOGGING__LABEL",
|
|
387
|
+
description: "UI__NODE_EDITOR__SERVICE__HTTP_REQUEST__FIELDS__DEBUG_LOGGING__DESCRIPTION",
|
|
388
|
+
defaultValue: "none",
|
|
389
|
+
params: {
|
|
390
|
+
required: true,
|
|
391
|
+
options: [
|
|
392
|
+
{
|
|
393
|
+
label: "UI__NODE_EDITOR__SERVICE__HTTP_REQUEST__FIELDS__DEBUG_LOGGING__OPTIONS__NONE__LABEL",
|
|
394
|
+
value: "none"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
label: "UI__NODE_EDITOR__SERVICE__HTTP_REQUEST__FIELDS__DEBUG_LOGGING__OPTIONS__REQUEST__LABEL",
|
|
398
|
+
value: "request"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
label: "UI__NODE_EDITOR__SERVICE__HTTP_REQUEST__FIELDS__DEBUG_LOGGING__OPTIONS__RESPONSE__LABEL",
|
|
402
|
+
value: "response"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
label: "UI__NODE_EDITOR__SERVICE__HTTP_REQUEST__FIELDS__DEBUG_LOGGING__OPTIONS__FULL__LABEL",
|
|
406
|
+
value: "full"
|
|
407
|
+
}
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
},
|
|
379
411
|
{
|
|
380
412
|
key: "abortOnError",
|
|
381
413
|
type: "toggle",
|
|
@@ -394,7 +426,7 @@ exports.HTTP_REQUEST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
394
426
|
key: "errorLogging",
|
|
395
427
|
value: "full"
|
|
396
428
|
}
|
|
397
|
-
}
|
|
429
|
+
}
|
|
398
430
|
],
|
|
399
431
|
sections: [
|
|
400
432
|
{
|
|
@@ -470,7 +502,8 @@ exports.HTTP_REQUEST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
470
502
|
fields: [
|
|
471
503
|
"errorLogging",
|
|
472
504
|
"logWarning",
|
|
473
|
-
"abortOnError"
|
|
505
|
+
"abortOnError",
|
|
506
|
+
"debugLogging"
|
|
474
507
|
]
|
|
475
508
|
}
|
|
476
509
|
],
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setSessionConfig = exports.vg2PayloadToActivityParams = exports.voiceConfigParamsToVoiceSettings = void 0;
|
|
4
|
+
/* Node modules */
|
|
5
|
+
const path_1 = require("path");
|
|
4
6
|
const strip_nulls_1 = require("../../voicegateway2/utils/strip-nulls");
|
|
5
7
|
const helper_1 = require("../utils/helper");
|
|
6
8
|
function voiceConfigParamsToVoiceSettings(config, api) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
8
10
|
let voiceSettings = {};
|
|
9
11
|
if (config.sttVendor === 'none') {
|
|
10
12
|
delete config.sttVendor;
|
|
@@ -102,13 +104,26 @@ function voiceConfigParamsToVoiceSettings(config, api) {
|
|
|
102
104
|
userNoInputRetries: config.userNoInputRetries,
|
|
103
105
|
userNoInputSpeech: config.userNoInputSpeech,
|
|
104
106
|
userNoInputUrl: config.userNoInputUrl,
|
|
107
|
+
userNoInputTimeoutEnable: config.userNoInputTimeoutEnable
|
|
105
108
|
};
|
|
109
|
+
voiceSettings.flowNoInput = {
|
|
110
|
+
flowNoInputMode: config.flowNoInputMode,
|
|
111
|
+
flowNoInputTimeout: config.flowNoInputTimeout,
|
|
112
|
+
flowNoInputRetries: config.flowNoInputRetries,
|
|
113
|
+
flowNoInputSpeech: config.flowNoInputSpeech,
|
|
114
|
+
flowNoInputUrl: config.flowNoInputUrl,
|
|
115
|
+
flowNoInputTimeoutEnable: config.flowNoInputTimeoutEnable
|
|
116
|
+
};
|
|
117
|
+
// Check if userNoInputTimeout has a value and userNoInputTimeoutEnable is null or undefined to cover generic nodes
|
|
118
|
+
if (((_j = voiceSettings === null || voiceSettings === void 0 ? void 0 : voiceSettings.userNoInput) === null || _j === void 0 ? void 0 : _j.userNoInputTimeout) && (voiceSettings.userNoInput.userNoInputTimeoutEnable === null || voiceSettings.userNoInput.userNoInputTimeoutEnable === undefined)) {
|
|
119
|
+
voiceSettings.userNoInput.userNoInputTimeoutEnable = true;
|
|
120
|
+
}
|
|
106
121
|
voiceSettings.dtmf = {
|
|
107
122
|
dtmfEnable: config.dtmfEnable,
|
|
108
123
|
dtmfInterDigitTimeout: config.dtmfInterDigitTimeout,
|
|
109
124
|
dtmfMaxDigits: config.dtmfMaxDigits,
|
|
110
125
|
dtmfMinDigits: config.dtmfMinDigits,
|
|
111
|
-
dtmfSubmitDigit: (
|
|
126
|
+
dtmfSubmitDigit: (_k = config.dtmfSubmitDigit) === null || _k === void 0 ? void 0 : _k.trim(),
|
|
112
127
|
};
|
|
113
128
|
if (config === null || config === void 0 ? void 0 : config.dtmfEnable) {
|
|
114
129
|
if (voiceSettings.dtmf.dtmfSubmitDigit &&
|
|
@@ -152,6 +167,32 @@ function voiceConfigParamsToVoiceSettings(config, api) {
|
|
|
152
167
|
azureEnableAudioLogging: config.azureEnableAudioLogging || undefined
|
|
153
168
|
};
|
|
154
169
|
}
|
|
170
|
+
// atmosphere sounds
|
|
171
|
+
if (config.atmosphereAction) {
|
|
172
|
+
if ((_l = config.atmosphereUrl) === null || _l === void 0 ? void 0 : _l.length) {
|
|
173
|
+
if (!(0, helper_1.isValidUrl)(config.atmosphereUrl)) {
|
|
174
|
+
throw new Error(`Audio file URL is invalid ${config.atmosphereUrl}`);
|
|
175
|
+
}
|
|
176
|
+
const extension = (0, path_1.extname)(config.atmosphereUrl);
|
|
177
|
+
if ([".mp3"].indexOf(extension) === -1) {
|
|
178
|
+
throw new Error(`Audio file must be from type .mp3 Extension was: ${extension}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
voiceSettings.atmosphereNoise = {
|
|
182
|
+
action: config.atmosphereAction,
|
|
183
|
+
url: config.atmosphereUrl || undefined,
|
|
184
|
+
volume: config.atmosphereVolume || undefined,
|
|
185
|
+
loop: config.atmosphereLoop || undefined
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
// silence overlay
|
|
189
|
+
if (typeof config.silenceOverlayAction === "boolean") {
|
|
190
|
+
voiceSettings.silenceOverlay = {
|
|
191
|
+
enable: config.silenceOverlayAction,
|
|
192
|
+
url: config.silenceOverlayURL || undefined,
|
|
193
|
+
startDelaySecs: config.silenceOverlayDelay || undefined
|
|
194
|
+
};
|
|
195
|
+
}
|
|
155
196
|
return (0, strip_nulls_1.stripNulls)(voiceSettings);
|
|
156
197
|
}
|
|
157
198
|
exports.voiceConfigParamsToVoiceSettings = voiceConfigParamsToVoiceSettings;
|
|
@@ -181,8 +222,9 @@ exports.setSessionConfig = {
|
|
|
181
222
|
},
|
|
182
223
|
handleVGInput(voiceSettings, sessionParams, api) {
|
|
183
224
|
var _a, _b;
|
|
184
|
-
const { bargeIn, continuousAsr, stt, tts, userNoInput, dtmf, vad, azureConfig, } = voiceSettings;
|
|
225
|
+
const { bargeIn, continuousAsr, stt, tts, userNoInput, dtmf, vad, azureConfig, atmosphereNoise, silenceOverlay, flowNoInput } = voiceSettings;
|
|
185
226
|
const user = {};
|
|
227
|
+
const flow = {};
|
|
186
228
|
const synthesizer = {};
|
|
187
229
|
const recognizer = {};
|
|
188
230
|
//verify if there are STT Configs to set
|
|
@@ -235,22 +277,52 @@ exports.setSessionConfig = {
|
|
|
235
277
|
}
|
|
236
278
|
//verify if there are No User Input Configs to set
|
|
237
279
|
if (userNoInput) {
|
|
238
|
-
const { userNoInputRetries, userNoInputMode, userNoInputSpeech, userNoInputTimeout, userNoInputUrl } = userNoInput || {};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
280
|
+
const { userNoInputRetries, userNoInputMode, userNoInputSpeech, userNoInputTimeout, userNoInputUrl, userNoInputTimeoutEnable } = userNoInput || {};
|
|
281
|
+
if (userNoInputTimeoutEnable === true) {
|
|
282
|
+
user.noInputMode = userNoInputMode;
|
|
283
|
+
if (userNoInputMode === "speech" && userNoInputSpeech)
|
|
284
|
+
user.noInputSpeech = userNoInputSpeech;
|
|
285
|
+
if (userNoInputMode === "play" && userNoInputUrl)
|
|
286
|
+
user.noInputUrl = userNoInputUrl;
|
|
287
|
+
/* User No Input Retries. min: 0, max: 999*/
|
|
288
|
+
if (userNoInputRetries < 0 || userNoInputRetries > 999) {
|
|
289
|
+
user.noInputRetries = 1;
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
user.noInputRetries = userNoInputRetries !== null && userNoInputRetries !== void 0 ? userNoInputRetries : 1;
|
|
293
|
+
}
|
|
294
|
+
user.noInputTimeout = userNoInputTimeout
|
|
295
|
+
? userNoInputTimeout / 1000
|
|
296
|
+
: 10;
|
|
247
297
|
}
|
|
248
|
-
else {
|
|
249
|
-
user.
|
|
298
|
+
else if (userNoInputTimeoutEnable === false) {
|
|
299
|
+
user.noInputTimeout = 0;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
//verify if there are No Flow Input Configs to set
|
|
303
|
+
if (flowNoInput) {
|
|
304
|
+
const { flowNoInputMode, flowNoInputRetries, flowNoInputSpeech, flowNoInputTimeout, flowNoInputTimeoutEnable, flowNoInputUrl } = flowNoInput || {};
|
|
305
|
+
flow.flowNoInputEnable = flowNoInputTimeoutEnable;
|
|
306
|
+
if (flowNoInputTimeoutEnable === true) {
|
|
307
|
+
flow.flowNoInputMode = flowNoInputMode;
|
|
308
|
+
if (flowNoInputMode === "speech" && flowNoInputSpeech)
|
|
309
|
+
flow.flowNoInputSpeech = flowNoInputSpeech;
|
|
310
|
+
if (flowNoInputMode === "play" && flowNoInputUrl)
|
|
311
|
+
flow.flowNoInputUrl = flowNoInputUrl;
|
|
312
|
+
/* User No Input Retries. min: 0, max: 999*/
|
|
313
|
+
if (flowNoInputRetries < 0 || flowNoInputRetries > 999) {
|
|
314
|
+
flow.flowNoInputRetries = 1;
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
flow.flowNoInputRetries = flowNoInputRetries !== null && flowNoInputRetries !== void 0 ? flowNoInputRetries : 1;
|
|
318
|
+
}
|
|
319
|
+
flow.flowNoInputTimeout = flowNoInputTimeout
|
|
320
|
+
? flowNoInputTimeout / 1000
|
|
321
|
+
: 10;
|
|
322
|
+
}
|
|
323
|
+
else if (flowNoInputTimeoutEnable === false) {
|
|
324
|
+
flow.flowNoInputTimeout = undefined;
|
|
250
325
|
}
|
|
251
|
-
user.noInputTimeout = userNoInputTimeout
|
|
252
|
-
? userNoInputTimeout / 1000
|
|
253
|
-
: 10;
|
|
254
326
|
}
|
|
255
327
|
// verify if there are Continuous ASR Configs to set
|
|
256
328
|
if (continuousAsr === null || continuousAsr === void 0 ? void 0 : continuousAsr.asrEnabled) {
|
|
@@ -310,6 +382,9 @@ exports.setSessionConfig = {
|
|
|
310
382
|
if (voiceConfig.recognizer && !voiceConfig.recognizer.azureSttEndpointId) {
|
|
311
383
|
voiceConfig.recognizer.azureSttEndpointId = "";
|
|
312
384
|
}
|
|
385
|
+
if (silenceOverlay) {
|
|
386
|
+
voiceConfig.fillerNoise = (0, strip_nulls_1.stripNulls)(silenceOverlay);
|
|
387
|
+
}
|
|
313
388
|
(0, strip_nulls_1.stripNulls)(voiceConfig);
|
|
314
389
|
/* As the last step we check the session params JSON for valid properties */
|
|
315
390
|
if (sessionParams) {
|
|
@@ -318,6 +393,7 @@ exports.setSessionConfig = {
|
|
|
318
393
|
// Check if there are configs for No User Input and DTMF
|
|
319
394
|
const cognigyConfig = {
|
|
320
395
|
user: user || undefined,
|
|
396
|
+
flow: flow || undefined,
|
|
321
397
|
dtmf: enableDTMF,
|
|
322
398
|
};
|
|
323
399
|
if (tts && typeof tts.ttsDisableCache === "boolean") {
|
|
@@ -332,6 +408,9 @@ exports.setSessionConfig = {
|
|
|
332
408
|
? voiceConfig
|
|
333
409
|
: undefined,
|
|
334
410
|
};
|
|
411
|
+
if (atmosphereNoise) {
|
|
412
|
+
prePayload.voiceGateway2Atmosphere = (0, strip_nulls_1.stripNulls)(atmosphereNoise);
|
|
413
|
+
}
|
|
335
414
|
if (prePayload.cognigyConfig === undefined) {
|
|
336
415
|
delete prePayload.cognigyConfig;
|
|
337
416
|
}
|
|
@@ -7,6 +7,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const setSessionConfig_mapper_1 = require("../mappers/setSessionConfig.mapper");
|
|
8
8
|
const design_1 = require("../utils/design");
|
|
9
9
|
const setSessionConfig_mapper_2 = require("../mappers/setSessionConfig.mapper");
|
|
10
|
+
const logFullConfigToDebugMode_1 = require("../../../../helper/logFullConfigToDebugMode");
|
|
10
11
|
exports.BARGE_IN = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
11
12
|
type: "bargeIn",
|
|
12
13
|
defaultLabel: "Barge In - Config",
|
|
@@ -98,6 +99,7 @@ exports.BARGE_IN = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
98
99
|
api.say(null, {
|
|
99
100
|
_cognigy: payload,
|
|
100
101
|
});
|
|
102
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
101
103
|
}
|
|
102
104
|
catch (error) {
|
|
103
105
|
throw new Error(`Error on Barge In node. Error message: ${error.message}`);
|
|
@@ -7,6 +7,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const setSessionConfig_mapper_1 = require("../mappers/setSessionConfig.mapper");
|
|
8
8
|
const design_1 = require("../utils/design");
|
|
9
9
|
const setSessionConfig_mapper_2 = require("../mappers/setSessionConfig.mapper");
|
|
10
|
+
const logFullConfigToDebugMode_1 = require("../../../../helper/logFullConfigToDebugMode");
|
|
10
11
|
exports.CONTINUOUS_ASR = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
11
12
|
type: "continuousASR",
|
|
12
13
|
defaultLabel: "Continuous ASR - Config",
|
|
@@ -63,6 +64,7 @@ exports.CONTINUOUS_ASR = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
63
64
|
api.say(null, {
|
|
64
65
|
_cognigy: payload,
|
|
65
66
|
});
|
|
67
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
66
68
|
}
|
|
67
69
|
catch (error) {
|
|
68
70
|
throw new Error(`Error on Continuous ASR node. Error message: ${error.message}`);
|
|
@@ -7,6 +7,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const setSessionConfig_mapper_1 = require("../mappers/setSessionConfig.mapper");
|
|
8
8
|
const design_1 = require("../utils/design");
|
|
9
9
|
const setSessionConfig_mapper_2 = require("../mappers/setSessionConfig.mapper");
|
|
10
|
+
const logFullConfigToDebugMode_1 = require("../../../../helper/logFullConfigToDebugMode");
|
|
10
11
|
exports.DTMF = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
11
12
|
type: "dtmf",
|
|
12
13
|
defaultLabel: "DTMF Collect - Config",
|
|
@@ -71,6 +72,7 @@ exports.DTMF = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
71
72
|
api.say(null, {
|
|
72
73
|
_cognigy: payload,
|
|
73
74
|
});
|
|
75
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
74
76
|
}
|
|
75
77
|
catch (error) {
|
|
76
78
|
throw new Error(`Error on DTMF node. Error message: ${error.message}`);
|
|
@@ -43,6 +43,7 @@ exports.MUTE_SPEECH_INPUT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
43
43
|
api.say(null, {
|
|
44
44
|
_cognigy: payload
|
|
45
45
|
});
|
|
46
|
+
api.logDebugMessage(`UI__DEBUG_MODE__MUTE_SPEECH__MESSAGE ${config.muteSpeechInput}`);
|
|
46
47
|
}
|
|
47
48
|
catch (error) {
|
|
48
49
|
throw new Error(`Error in muteSpeechInput node. Error message: ${error.message}`);
|
|
@@ -7,6 +7,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const setSessionConfig_mapper_1 = require("../mappers/setSessionConfig.mapper");
|
|
8
8
|
const design_1 = require("../utils/design");
|
|
9
9
|
const setSessionConfig_mapper_2 = require("../mappers/setSessionConfig.mapper");
|
|
10
|
+
const logFullConfigToDebugMode_1 = require("../../../../helper/logFullConfigToDebugMode");
|
|
10
11
|
exports.USER_INPUT_TIMEOUT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
11
12
|
type: "noUserInput",
|
|
12
13
|
defaultLabel: "User Input Timeout - Config",
|
|
@@ -97,6 +98,7 @@ exports.USER_INPUT_TIMEOUT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
97
98
|
api.say(null, {
|
|
98
99
|
_cognigy: payload,
|
|
99
100
|
});
|
|
101
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
100
102
|
}
|
|
101
103
|
catch (error) {
|
|
102
104
|
throw new Error(`Error on User Input Timeout node. Error message: ${error.message}`);
|
|
@@ -7,6 +7,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
7
7
|
const setSessionConfig_mapper_1 = require("../mappers/setSessionConfig.mapper");
|
|
8
8
|
const design_1 = require("../utils/design");
|
|
9
9
|
const vgConstants_1 = require("../utils/vgConstants");
|
|
10
|
+
const logFullConfigToDebugMode_1 = require("../../../../helper/logFullConfigToDebugMode");
|
|
10
11
|
exports.voiceConfigFields = [
|
|
11
12
|
{
|
|
12
13
|
key: "sttHints",
|
|
@@ -332,6 +333,7 @@ exports.SESSION_SPEECH_PARAMETERS = (0, createNodeDescriptor_1.createNodeDescrip
|
|
|
332
333
|
api.say(null, {
|
|
333
334
|
_cognigy: payload,
|
|
334
335
|
});
|
|
336
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
335
337
|
}
|
|
336
338
|
catch (error) {
|
|
337
339
|
throw new Error(`Error on Session Speech Parameters node. Error message: ${error.message}`);
|