@cognigy/rest-api-client 0.18.0 → 0.20.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/RestAPIClient.js +7 -0
- package/build/apigroups/AdministrationAPIGroup_2_0.js +8 -1
- package/build/apigroups/JWTAuthAPIGroup_2_0.js +12 -0
- package/build/apigroups/MetricsAPIGroup_2_0.js +5 -0
- package/build/apigroups/ResourcesAPIGroup_2_0.js +28 -14
- package/build/apigroups/index.js +3 -1
- 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/index.js +3 -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/sendData.js +74 -0
- 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/addMemory.js +51 -0
- package/build/shared/charts/descriptors/analytics/blindMode.js +2 -0
- package/build/shared/charts/descriptors/analytics/completeGoal.js +4 -2
- 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/helper.js +20 -0
- package/build/shared/charts/descriptors/analytics/index.js +5 -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/trackGoal.js +102 -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 +4 -1
- 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 +19 -1
- package/build/shared/charts/descriptors/knowledgeSearch/knowledgeSearchV2.js +1 -1
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +55 -20
- package/build/shared/charts/descriptors/logic/disableSlotFillers.js +1 -1
- package/build/shared/charts/descriptors/logic/enableSlotFillers.js +1 -1
- 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 +113 -4
- 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 +2 -1
- package/build/shared/charts/descriptors/nlu/executeCognigyNLU.js +1 -1
- package/build/shared/charts/descriptors/nlu/fuzzySearch.js +24 -2
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/generativeSlotFiller.js +1 -1
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/generativeSlotFillerFallback.js +1 -1
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/generativeSlotFillerSuccess.js +1 -1
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/prompt.js +18 -9
- package/build/shared/charts/descriptors/nlu/matchPattern.js +1 -1
- package/build/shared/charts/descriptors/nlu/regexSlotFiller.js +1 -1
- package/build/shared/charts/descriptors/service/GPTConversation.js +1 -1
- package/build/shared/charts/descriptors/service/GPTPrompt.js +70 -41
- package/build/shared/charts/descriptors/service/LLMEntityExtract.js +12 -3
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentHandover.js +92 -0
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +1146 -0
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobDefault.js +31 -0
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobTool.js +139 -0
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentToolAnswer.js +120 -0
- package/build/shared/charts/descriptors/service/aiAgent/helper.js +222 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +140 -2
- package/build/shared/charts/descriptors/service/httpRequest.js +35 -2
- package/build/shared/charts/descriptors/service/index.js +11 -1
- package/build/shared/charts/descriptors/transcripts/addTranscriptStep.js +413 -0
- package/build/shared/charts/descriptors/transcripts/getTranscript.js +104 -0
- package/build/shared/charts/descriptors/transcripts/index.js +8 -0
- package/build/shared/charts/descriptors/voice/mappers/base.mapper.js +20 -0
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +227 -72
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +6 -9
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/continuousAsr.js +5 -4
- 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/voicegateway/nodes/callRecording.js +8 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +4 -2
- package/build/shared/charts/descriptors/voicegateway/nodes/hangup.js +4 -2
- package/build/shared/charts/descriptors/voicegateway/nodes/helper/utils.js +14 -0
- package/build/shared/charts/descriptors/voicegateway/nodes/playURL.js +4 -5
- package/build/shared/charts/descriptors/voicegateway/nodes/sendMessage.js +8 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/sendMetaData.js +7 -3
- package/build/shared/charts/descriptors/voicegateway/nodes/setSessionParams.js +8 -1
- 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 +311 -10
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +25 -9
- 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 +16 -1
- package/build/shared/handoverClients/interfaces/THandoverEventType.js +2 -0
- package/build/shared/helper/logFullConfigToDebugMode.js +30 -0
- package/build/shared/helper/nlu/textCleaner.js +4 -2
- package/build/shared/interfaces/IEndpointSettings.js +3 -0
- package/build/shared/interfaces/IOrganisation.js +1 -0
- package/build/shared/interfaces/IProfile.js +2 -0
- package/build/shared/interfaces/IProfileSchema.js +4 -0
- package/build/shared/interfaces/analytics/IAnalyticsSourceData.js +22 -20
- package/build/shared/interfaces/{restAPI/resources/milestone/v2.0/IMilestone_2_0.js → analytics/IGoalAnalytics.js} +1 -1
- package/build/shared/interfaces/appsession/ISetAppStateOptions.js +3 -0
- package/build/shared/interfaces/appsession/ISetAppStateOverlaySettings.js +3 -0
- package/build/shared/interfaces/appsession/ISetAppStateOverlaySettingsMetaData.js +3 -0
- package/build/shared/interfaces/debugEvents/TDebugEventMessagePayload.js +3 -0
- package/build/shared/interfaces/debugEvents/TDebugEventType.js +2 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +51 -70
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IJourney_2_0.js → generativeAI/tools.js} +1 -1
- package/build/shared/interfaces/handover.js +45 -2
- package/build/shared/interfaces/license.js +3 -2
- package/build/shared/interfaces/messageAPI/endpoints.js +8 -1
- package/build/shared/interfaces/messageAPI/handover.js +22 -1
- package/build/shared/interfaces/resources/IAiAgent.js +52 -0
- package/build/shared/interfaces/resources/IAuditEvent.js +2 -1
- package/build/shared/interfaces/resources/IConnection.js +1 -0
- package/build/shared/interfaces/resources/IEndpoint.js +2 -2
- package/build/shared/interfaces/resources/{IMilestone.js → IGoal.js} +15 -15
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +52 -4
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +15 -0
- package/build/shared/interfaces/resources/TResourceType.js +16 -8
- 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 +9 -1
- 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/administration/user/v2.0/IGetPinnedResources_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/{resources/journey/v2.0/IReadJourneyRest_2_0.js → administration/user/v2.0/IPinResourceRest_2_0.js} +1 -1
- package/build/shared/interfaces/restAPI/operations/nlu/v2.0/IGenerateNluScoresRest_2_0.js +57 -0
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IAiAgentHiringTemplate_2_0.js +32 -0
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IAiAgent_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/{journey/v2.0/IIndexJourneysRest_2_0.js → aiAgent/v2.0/ICreateAiAgentRest_2_0.js} +1 -1
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IDeleteAiAgentRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IGetAiAgentHiringTemplates_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/{journey/v2.0/IJourneyStep_2_0.js → aiAgent/v2.0/IHireAiAgent_2_0.js} +1 -1
- package/build/shared/interfaces/restAPI/resources/{journey/v2.0/IJourneyIndexItem_2_0.js → aiAgent/v2.0/IIndexAiAgentRest_2_0.js} +1 -1
- package/build/shared/interfaces/restAPI/resources/{journey/v2.0/IJourneyProgress_2_0.js → aiAgent/v2.0/IReadAiAgentRest_2_0.js} +1 -1
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IUpdateAiAgentRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IValidateAiAgentNameRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/ICloneGoalRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/ICreateGoalRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IDeleteGoalRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IGoalIndexItem_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IGoalStepMetric_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IGoalStep_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IGoal_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IIndexGoalsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IReadGoalRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/IUpdateGoalRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/goal/v2.0/index.js +3 -0
- 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/IPermission.js +6 -2
- package/build/shared/interfaces/security/IPinnedResource.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/transcripts/transcripts.js +33 -0
- package/build/shared/interfaces/user.js +1 -1
- package/package.json +2 -2
- package/types/index.d.ts +2332 -1041
- 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/license.js.map +0 -1
- 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/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/knowledgeSearchIndex/v2.0/ICreateKnowledgeSearchIndexRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/knowledgeSearchIndex/v2.0/IDeleteKnowledgeSearchIndexRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/ICloneMilestoneRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/ICreateMilestoneRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IDeleteMilestoneRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IIndexMilestonesRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IMilestoneIndexItem_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IMilestoneStepMetric_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IMilestoneStep_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IReadMilestoneRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IUpdateMilestoneRest_2_0.js +0 -3
- package/build/test.js +0 -27
- /package/build/shared/interfaces/restAPI/{resources/journey/v2.0 → operations}/index.js +0 -0
- /package/build/shared/interfaces/restAPI/{resources/knowledgeSearchIndex → operations/nlu}/v2.0/index.js +0 -0
- /package/build/shared/interfaces/restAPI/resources/{milestone → aiAgent}/v2.0/index.js +0 -0
|
@@ -20,9 +20,12 @@ exports.COPY_DATA_TO_CONTEXT = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
20
20
|
tags: ["data"],
|
|
21
21
|
function: async ({ cognigy }) => {
|
|
22
22
|
const { input, api } = cognigy;
|
|
23
|
+
let debug = "";
|
|
23
24
|
for (const key in input.data) {
|
|
24
25
|
api.addToContext(key, input.data[key], "simple");
|
|
26
|
+
debug += `Copied ${key} to context<br>`;
|
|
25
27
|
}
|
|
28
|
+
debug && api.logDebugMessage(`${debug}`);
|
|
26
29
|
}
|
|
27
30
|
});
|
|
28
31
|
//# sourceMappingURL=copyDataToContext.js.map
|
|
@@ -79,21 +79,24 @@ exports.COPY_SLOTS_TO_CONTEXT = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
79
79
|
{ type: "field", key: "tag" },
|
|
80
80
|
{ type: "section", key: "advanced" }
|
|
81
81
|
],
|
|
82
|
-
tags: ["data", "nlu"],
|
|
82
|
+
tags: ["ai", "data", "nlu"],
|
|
83
83
|
function: async ({ cognigy, config }) => {
|
|
84
84
|
const { key, tag, useNeg, mode } = config;
|
|
85
85
|
const { input, api } = cognigy;
|
|
86
86
|
if (!input.slots || !input.slots[tag]) {
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
+
let debug = "";
|
|
89
90
|
for (const keyphrase of input.slots[tag]) {
|
|
90
91
|
if (keyphrase.neg && useNeg) {
|
|
91
92
|
api.removeFromContext(key, keyphrase.lower, mode);
|
|
92
93
|
}
|
|
93
94
|
else {
|
|
94
95
|
api.addToContext(key, keyphrase.lower, mode);
|
|
96
|
+
debug += `UI__DEBUG_MODE__COPY_SLOTS_TO_CONTEXT__MESSAGE_1 ${keyphrase.lower} UI__DEBUG_MODE__COPY_SLOTS_TO_CONTEXT__MESSAGE_2 context.${key}<br>`;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
99
|
+
debug && api.logDebugMessage(`${debug}`);
|
|
97
100
|
}
|
|
98
101
|
});
|
|
99
102
|
//# sourceMappingURL=copySlotsToContext.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEBUG_MESSAGE = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
/**
|
|
7
|
+
* Node name: 'Debug Message'
|
|
8
|
+
*
|
|
9
|
+
* Purpose:
|
|
10
|
+
* Send a Debug Message to the Interaction Panel
|
|
11
|
+
*/
|
|
12
|
+
exports.DEBUG_MESSAGE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
|
+
type: "debugMessage",
|
|
14
|
+
defaultLabel: "Debug Message",
|
|
15
|
+
summary: "UI__NODE_EDITOR__DEBUG_MESSAGE__SUMMARY",
|
|
16
|
+
appearance: {
|
|
17
|
+
showIcon: false
|
|
18
|
+
},
|
|
19
|
+
fields: [
|
|
20
|
+
{
|
|
21
|
+
key: "level",
|
|
22
|
+
type: "select",
|
|
23
|
+
label: "UI__NODE_EDITOR__DEBUG_MESSAG__FIELDS__LEVEL__LABEL",
|
|
24
|
+
defaultValue: "info",
|
|
25
|
+
description: "UI__NODE_EDITOR__DEBUG_MESSAG__FIELDS__LEVEL__DESCRIPTION",
|
|
26
|
+
params: {
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
label: "UI__NODE_EDITOR__DEBUG_MESSAG__FIELDS__LEVEL__OPTIONS__INFO",
|
|
30
|
+
value: "info",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "UI__NODE_EDITOR__DEBUG_MESSAG__FIELDS__LEVEL__OPTIONS__ERROR",
|
|
34
|
+
value: "error",
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "header",
|
|
41
|
+
type: "cognigyText",
|
|
42
|
+
label: "UI__NODE_EDITOR__DEBUG_MESSAG__FIELDS__HEADER__LABEL",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "message",
|
|
46
|
+
type: "cognigyText",
|
|
47
|
+
label: "UI__NODE_EDITOR__DEBUG_MESSAG__FIELDS__MESSAGE__LABEL",
|
|
48
|
+
params: {
|
|
49
|
+
required: true,
|
|
50
|
+
multiline: true,
|
|
51
|
+
rows: 4,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
preview: {
|
|
56
|
+
key: "message",
|
|
57
|
+
type: "text",
|
|
58
|
+
},
|
|
59
|
+
tags: ["basic", "debug"],
|
|
60
|
+
function: async ({ cognigy, config }) => {
|
|
61
|
+
const { api } = cognigy;
|
|
62
|
+
const { level, message, header } = config;
|
|
63
|
+
if (level && message) {
|
|
64
|
+
if (level === "info") {
|
|
65
|
+
api.logDebugMessage(message, header);
|
|
66
|
+
}
|
|
67
|
+
if (level === "error") {
|
|
68
|
+
api.logDebugError(message, header);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=debugMessage.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LOG = exports.CODE = exports.RESET_CONTEXT = exports.REMOVE_FROM_CONTEXT = exports.COPY_SLOTS_TO_CONTEXT = exports.COPY_DATA_TO_CONTEXT = exports.ADD_TO_CONTEXT = void 0;
|
|
3
|
+
exports.DEBUG_MESSAGE = exports.LOG = exports.CODE = exports.RESET_CONTEXT = exports.REMOVE_FROM_CONTEXT = exports.COPY_SLOTS_TO_CONTEXT = exports.COPY_DATA_TO_CONTEXT = exports.ADD_TO_CONTEXT = void 0;
|
|
4
4
|
var addToContext_1 = require("./addToContext");
|
|
5
5
|
Object.defineProperty(exports, "ADD_TO_CONTEXT", { enumerable: true, get: function () { return addToContext_1.ADD_TO_CONTEXT; } });
|
|
6
6
|
var copyDataToContext_1 = require("./copyDataToContext");
|
|
@@ -15,4 +15,6 @@ var code_1 = require("./code");
|
|
|
15
15
|
Object.defineProperty(exports, "CODE", { enumerable: true, get: function () { return code_1.CODE; } });
|
|
16
16
|
var log_1 = require("./log");
|
|
17
17
|
Object.defineProperty(exports, "LOG", { enumerable: true, get: function () { return log_1.LOG; } });
|
|
18
|
+
var debugMessage_1 = require("./debugMessage");
|
|
19
|
+
Object.defineProperty(exports, "DEBUG_MESSAGE", { enumerable: true, get: function () { return debugMessage_1.DEBUG_MESSAGE; } });
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -65,8 +65,16 @@ exports.REMOVE_FROM_CONTEXT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
65
65
|
tags: ["data"],
|
|
66
66
|
function: async ({ cognigy, config }) => {
|
|
67
67
|
const { key, value, mode = "simple" } = config;
|
|
68
|
-
const { api } = cognigy;
|
|
68
|
+
const { api, input } = cognigy;
|
|
69
69
|
api.removeFromContext(key, value, mode);
|
|
70
|
+
if (input.endpointType === "adminconsole" || api.getMetadata().isFollowSessionActive) {
|
|
71
|
+
if (mode === "simple") {
|
|
72
|
+
api.logDebugMessage(`UI__DEBUG_MODE__REMOVE_FROM_CONTEXT__MESSAGE context.${key}`);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
api.logDebugMessage(`UI__DEBUG_MODE__REMOVE_FROM_CONTEXT__MESSAGE '${value}' UI__DEBUG_MODE__REMOVE_FROM_CONTEXT__MESSAGE_2 'context.${key}'`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
70
78
|
}
|
|
71
79
|
});
|
|
72
80
|
//# sourceMappingURL=removeFromContext.js.map
|
|
@@ -21,6 +21,7 @@ exports.RESET_CONTEXT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
21
21
|
function: async ({ cognigy }) => {
|
|
22
22
|
const { api } = cognigy;
|
|
23
23
|
api.resetContext();
|
|
24
|
+
api.logDebugMessage(`UI__DEBUG_MODE__RESET_CONTEXT__MESSAGE`);
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
//# sourceMappingURL=resetContext.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cognigyTranslationProviderModule = exports.cognigySpeechProviderModule = exports.cognigyGenerativeAIProviderModule = exports.cognigyInternalStorageProviderModule = exports.cognigyVoiceGateway2Module = exports.cognigyMicrosoftModule = exports.cognigyVoiceGatewayModule = exports.cognigySMTPModule = exports.cognigySQLModule = exports.cognigyMongoDBModule = exports.cognigyBasicModule = void 0;
|
|
3
|
+
exports.cognigyDocumentParserProviderModule = exports.cognigyTranslationProviderModule = exports.cognigySpeechProviderModule = exports.cognigyGenerativeAIProviderModule = exports.cognigyInternalStorageProviderModule = exports.cognigyVoiceGateway2Module = exports.cognigyMicrosoftModule = exports.cognigyVoiceGatewayModule = exports.cognigySMTPModule = exports.cognigySQLModule = exports.cognigyMongoDBModule = exports.cognigyBasicModule = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../createNodeDescriptor");
|
|
6
6
|
/* Nodes */
|
|
@@ -18,6 +18,7 @@ const service_1 = require("./service");
|
|
|
18
18
|
const apps_1 = require("./apps");
|
|
19
19
|
const agentAssist_1 = require("./agentAssist");
|
|
20
20
|
const liveAgent_1 = require("./liveAgent");
|
|
21
|
+
const transcripts_1 = require("./transcripts");
|
|
21
22
|
// import { REQUIRED_FIELDS } from "./requiredFields";
|
|
22
23
|
// import { ALL_FIELDS } from "./allFields";
|
|
23
24
|
const nodes = [
|
|
@@ -31,6 +32,7 @@ const nodes = [
|
|
|
31
32
|
data_1.RESET_CONTEXT,
|
|
32
33
|
data_1.CODE,
|
|
33
34
|
data_1.LOG,
|
|
35
|
+
data_1.DEBUG_MESSAGE,
|
|
34
36
|
logic_1.INTERVAL,
|
|
35
37
|
logic_1.ELSE_INTERVAL,
|
|
36
38
|
logic_1.ON_INTERVAL,
|
|
@@ -79,6 +81,7 @@ const nodes = [
|
|
|
79
81
|
analytics_1.DELETE_PROFILE,
|
|
80
82
|
analytics_1.MERGE_PROFILE,
|
|
81
83
|
analytics_1.UPDATE_PROFILE,
|
|
84
|
+
analytics_1.ADD_MEMORY,
|
|
82
85
|
analytics_1.BLIND_MODE,
|
|
83
86
|
analytics_1.OVERWRITE_ANALYTICS,
|
|
84
87
|
service_1.HANDOVER,
|
|
@@ -114,6 +117,7 @@ const nodes = [
|
|
|
114
117
|
apps_1.SET_ADAPTIVE_CARD_APP_STATE,
|
|
115
118
|
agentAssist_1.SET_IFRAME_TILE,
|
|
116
119
|
agentAssist_1.SET_HTML_TILE,
|
|
120
|
+
agentAssist_1.SEND_TILE_DATA,
|
|
117
121
|
agentAssist_1.SET_SECURE_FORMS_TILE,
|
|
118
122
|
agentAssist_1.SET_ADAPTIVE_CARD_TILE,
|
|
119
123
|
agentAssist_1.SET_AGENT_ASSIST_GRID,
|
|
@@ -126,6 +130,18 @@ const nodes = [
|
|
|
126
130
|
agentAssist_1.KNOWLEDGE_ASSIST,
|
|
127
131
|
knowledgeSearch_1.SEARCH_EXTRACT_OUTPUT,
|
|
128
132
|
];
|
|
133
|
+
if (process.env.FEATURE_USE_GOALS === "true") {
|
|
134
|
+
nodes.push(analytics_1.TRACK_GOAL);
|
|
135
|
+
}
|
|
136
|
+
if (process.env.DISABLE_FEATURE_TRANSCRIPT_MANAGER !== "true") {
|
|
137
|
+
nodes.push(transcripts_1.GET_TRANSCRIPT);
|
|
138
|
+
nodes.push(transcripts_1.ADD_TRANSCRIPT_STEP);
|
|
139
|
+
nodes.push(service_1.AI_AGENT_JOB);
|
|
140
|
+
nodes.push(service_1.AI_AGENT_JOB_DEFAULT);
|
|
141
|
+
nodes.push(service_1.AI_AGENT_JOB_TOOL);
|
|
142
|
+
nodes.push(service_1.AI_AGENT_TOOL_ANSWER);
|
|
143
|
+
nodes.push(service_1.AI_AGENT_HANDOVER);
|
|
144
|
+
}
|
|
129
145
|
if (process.env.FEATURE_USE_COGNIGY_LIVE_AGENT === "true") {
|
|
130
146
|
nodes.push(liveAgent_1.ASSIST_INFO);
|
|
131
147
|
}
|
|
@@ -161,4 +177,6 @@ var speechProviders_1 = require("./connectionNodes/speechProviders");
|
|
|
161
177
|
Object.defineProperty(exports, "cognigySpeechProviderModule", { enumerable: true, get: function () { return speechProviders_1.cognigySpeechProviderModule; } });
|
|
162
178
|
var translationProviders_1 = require("./connectionNodes/translationProviders");
|
|
163
179
|
Object.defineProperty(exports, "cognigyTranslationProviderModule", { enumerable: true, get: function () { return translationProviders_1.cognigyTranslationProviderModule; } });
|
|
180
|
+
var documentParserProviders_1 = require("./connectionNodes/documentParserProviders");
|
|
181
|
+
Object.defineProperty(exports, "cognigyDocumentParserProviderModule", { enumerable: true, get: function () { return documentParserProviders_1.cognigyDocumentParserProviderModule; } });
|
|
164
182
|
//# sourceMappingURL=index.js.map
|
|
@@ -97,7 +97,7 @@ exports.KNOWLEDGE_SEARCH_V2 = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
97
97
|
key: "text",
|
|
98
98
|
type: "text"
|
|
99
99
|
},
|
|
100
|
-
tags: ["knowledgeSearch", "knowledge", "search"],
|
|
100
|
+
tags: ["ai", "knowledgeSearch", "knowledge", "search"],
|
|
101
101
|
function: async (knowledgeSearchParams) => {
|
|
102
102
|
var _a;
|
|
103
103
|
const { cognigy, config } = knowledgeSearchParams;
|
|
@@ -196,6 +196,25 @@ exports.SEARCH_EXTRACT_OUTPUT = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
196
196
|
tagLimit: 5
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
|
+
{
|
|
200
|
+
key: "searchSourceTagsFilterOp",
|
|
201
|
+
type: "select",
|
|
202
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__SOURCE_TAGS_FILTER_OP__LABEL",
|
|
203
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__SOURCE_TAGS_FILTER_OP__DESCRIPTION",
|
|
204
|
+
defaultValue: "and",
|
|
205
|
+
params: {
|
|
206
|
+
options: [
|
|
207
|
+
{
|
|
208
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__SOURCE_TAGS_FILTER_OP__OPTIONS__AND__LABEL",
|
|
209
|
+
value: "and"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__SOURCE_TAGS_FILTER_OP__OPTIONS__OR__LABEL",
|
|
213
|
+
value: "or"
|
|
214
|
+
},
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
},
|
|
199
218
|
{
|
|
200
219
|
key: "prompt",
|
|
201
220
|
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__PROMPT__LABEL",
|
|
@@ -451,7 +470,7 @@ exports.SEARCH_EXTRACT_OUTPUT = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
451
470
|
key: "searchSettings",
|
|
452
471
|
label: "Search Settings",
|
|
453
472
|
defaultCollapsed: true,
|
|
454
|
-
fields: ["followUpDetection", "followUpDetectionSteps", "searchString", "searchStringDescription", "topK", "searchStoreLocation", "searchStoreWarning", "searchStoreLocationInputKey", "searchStoreLocationContextKey", "searchSourceTags"]
|
|
473
|
+
fields: ["followUpDetection", "followUpDetectionSteps", "searchString", "searchStringDescription", "topK", "searchStoreLocation", "searchStoreWarning", "searchStoreLocationInputKey", "searchStoreLocationContextKey", "searchSourceTags", "searchSourceTagsFilterOp"]
|
|
455
474
|
},
|
|
456
475
|
{
|
|
457
476
|
key: "extractSettings",
|
|
@@ -527,12 +546,12 @@ exports.SEARCH_EXTRACT_OUTPUT = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
527
546
|
key: "text",
|
|
528
547
|
type: "text"
|
|
529
548
|
},
|
|
530
|
-
tags: ["knowledgeSearch", "knowledge", "search"],
|
|
549
|
+
tags: ["ai", "knowledgeSearch", "knowledge", "search"],
|
|
531
550
|
function: async (knowledgeSearchParams) => {
|
|
532
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
551
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
533
552
|
const { cognigy, config, nodeId } = knowledgeSearchParams;
|
|
534
553
|
const { input, api } = cognigy;
|
|
535
|
-
const { topK, searchString, searchStoreLocation, searchStoreLocationContextKey, searchStoreLocationInputKey, searchSourceTags, temperature, maxTokens, topP, presencePenalty, frequencyPenalty, useStop, stop, storeLocation, contextKey, inputKey, timeout, timeoutMessage, outputFallback, outputMode, mode, errorHandling, errorHandlingGotoTarget, streamStopTokens, followUpDetection, debugLogTokenCount, debugLogRequestAndCompletion } = config;
|
|
554
|
+
const { topK, searchString, searchStoreLocation, searchStoreLocationContextKey, searchStoreLocationInputKey, searchSourceTags, searchSourceTagsFilterOp, temperature, maxTokens, topP, presencePenalty, frequencyPenalty, useStop, stop, storeLocation, contextKey, inputKey, timeout, timeoutMessage, outputFallback, outputMode, mode, errorHandling, errorHandlingGotoTarget, streamStopTokens, followUpDetection, debugLogTokenCount, debugLogRequestAndCompletion } = config;
|
|
536
555
|
let { followUpDetectionSteps } = config;
|
|
537
556
|
let { prompt } = config;
|
|
538
557
|
// timeout message name not changed because of legacy compatibility
|
|
@@ -554,6 +573,7 @@ exports.SEARCH_EXTRACT_OUTPUT = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
554
573
|
}
|
|
555
574
|
let actualSearchString = searchString;
|
|
556
575
|
// check if follow up detection is active and if yes, handle accordingly
|
|
576
|
+
// this is "context aware search"
|
|
557
577
|
if (followUpDetection === "transcript") {
|
|
558
578
|
let prompt;
|
|
559
579
|
let lastRoundTrip;
|
|
@@ -573,10 +593,13 @@ USER: ${searchString}
|
|
|
573
593
|
Does the last USER input refer to the conversation before?
|
|
574
594
|
Answer with "true" or "false". Answer:`;
|
|
575
595
|
let promptResponse;
|
|
596
|
+
// set the detailed results to true to get the token usage
|
|
597
|
+
const returnDetailedResults = true;
|
|
576
598
|
try {
|
|
577
|
-
|
|
599
|
+
const firstFollowUpResponse = await api.runGenerativeAIPrompt({ prompt, detailedResults: returnDetailedResults }, "answerExtraction");
|
|
600
|
+
promptResponse = firstFollowUpResponse.result;
|
|
578
601
|
// if we're in adminconsole, process debugging options
|
|
579
|
-
|
|
602
|
+
(0, prompt_1.writeLLMDebugLogs)("Search Extract Output Follow Up Detection", prompt, firstFollowUpResponse, debugLogTokenCount, false, cognigy);
|
|
580
603
|
// check if LLM thinks the input was a follow up
|
|
581
604
|
if (promptResponse === null || promptResponse === void 0 ? void 0 : promptResponse.toLowerCase().includes("true")) {
|
|
582
605
|
prompt = `You are tasked to rewrite a question based on a context, so that the question is clearer.
|
|
@@ -593,11 +616,13 @@ Context:
|
|
|
593
616
|
${lastRoundTrip}
|
|
594
617
|
Question: ${searchString}
|
|
595
618
|
New: `;
|
|
596
|
-
|
|
619
|
+
const secondFollowUpResponse = await api.runGenerativeAIPrompt({ prompt, detailedResults: returnDetailedResults }, "answerExtraction");
|
|
620
|
+
promptResponse = secondFollowUpResponse.result;
|
|
597
621
|
// if we're in adminconsole, process debugging options
|
|
598
|
-
|
|
622
|
+
(0, prompt_1.writeLLMDebugLogs)("Search Extract Output Follow Up Detection 2", prompt, secondFollowUpResponse, debugLogTokenCount, false, cognigy);
|
|
599
623
|
// the actual search string to now use is the rewritten question
|
|
600
624
|
actualSearchString = promptResponse;
|
|
625
|
+
api.logDebugMessage(`UI__DEBUG_MODE__SEO__MESSAGE '${actualSearchString}'`);
|
|
601
626
|
}
|
|
602
627
|
}
|
|
603
628
|
catch (err) {
|
|
@@ -612,6 +637,7 @@ New: `;
|
|
|
612
637
|
const compactError = {
|
|
613
638
|
message: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
614
639
|
};
|
|
640
|
+
api.logDebugError(JSON.stringify(compactError, undefined, 2), "Search Extract Output: Error");
|
|
615
641
|
if ((_a = error === null || error === void 0 ? void 0 : error.originalErrorDetails) === null || _a === void 0 ? void 0 : _a.code) {
|
|
616
642
|
compactError["code"] = error.originalErrorDetails.code;
|
|
617
643
|
}
|
|
@@ -673,7 +699,10 @@ New: `;
|
|
|
673
699
|
searchSourceTags.forEach((tag, index) => {
|
|
674
700
|
searchSourceTags[index] = tag.toString();
|
|
675
701
|
});
|
|
676
|
-
data.
|
|
702
|
+
data.tagsData = {
|
|
703
|
+
tags: searchSourceTags,
|
|
704
|
+
op: searchSourceTagsFilterOp || "and" // default to "and" if not set (backwards compatibility)
|
|
705
|
+
};
|
|
677
706
|
}
|
|
678
707
|
// Add knowledgeStoreIds to data
|
|
679
708
|
if (knowledgeStoreId) {
|
|
@@ -681,8 +710,11 @@ New: `;
|
|
|
681
710
|
}
|
|
682
711
|
// Perform knowledge search
|
|
683
712
|
try {
|
|
713
|
+
// Set understood to true so that the interaction doesn't look false in our analytics
|
|
714
|
+
(_d = api.setAnalyticsData) === null || _d === void 0 ? void 0 : _d.call(api, "understood", "true");
|
|
715
|
+
input.understood = true;
|
|
684
716
|
const knowledgeSearchResponse = await api.knowledgeSearch(data);
|
|
685
|
-
|
|
717
|
+
(0, prompt_1.writeLLMDebugLogs)("Search Extract Output Embeddings Call", data.query, undefined, debugLogTokenCount, false, cognigy);
|
|
686
718
|
// Handle possible response errors
|
|
687
719
|
if ((knowledgeSearchResponse === null || knowledgeSearchResponse === void 0 ? void 0 : knowledgeSearchResponse.status) !== "success") {
|
|
688
720
|
const errorMessage = (knowledgeSearchResponse === null || knowledgeSearchResponse === void 0 ? void 0 : knowledgeSearchResponse.error) || "empty";
|
|
@@ -712,10 +744,10 @@ New: `;
|
|
|
712
744
|
}
|
|
713
745
|
// #endregion 1 Perform Search
|
|
714
746
|
// #region 2 Perform Answer Extraction
|
|
715
|
-
let documents = (
|
|
747
|
+
let documents = (_e = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _e === void 0 ? void 0 : _e.map(result => result === null || result === void 0 ? void 0 : result.text).join(' ');
|
|
716
748
|
const replacedUserInput = input.text + (actualSearchString !== input.text ? ` possibly meaning "${actualSearchString}"` : "");
|
|
717
|
-
prompt = prompt.replace(/@userInput
|
|
718
|
-
prompt = prompt.replace(/@foundDocuments
|
|
749
|
+
prompt = prompt.replace(/@userInput/g, replacedUserInput);
|
|
750
|
+
prompt = prompt.replace(/@foundDocuments/g, documents);
|
|
719
751
|
const answerLanguage = (() => {
|
|
720
752
|
const answerLanguage = getLanguageName(language);
|
|
721
753
|
// generic (ge-GE) and any other unknown languages result in "undefined"
|
|
@@ -724,7 +756,7 @@ New: `;
|
|
|
724
756
|
}
|
|
725
757
|
return answerLanguage;
|
|
726
758
|
})();
|
|
727
|
-
prompt = prompt.replace(/@answerLanguage
|
|
759
|
+
prompt = prompt.replace(/@answerLanguage/g, answerLanguage);
|
|
728
760
|
// check if we have found documents and if we are not just in "Search" only mode
|
|
729
761
|
if (documents && (mode !== "s")) {
|
|
730
762
|
// check if we received streamed output at all
|
|
@@ -743,16 +775,19 @@ New: `;
|
|
|
743
775
|
streamedOutput = true;
|
|
744
776
|
api.output(text, null);
|
|
745
777
|
},
|
|
746
|
-
streamStopTokens
|
|
778
|
+
streamStopTokens,
|
|
779
|
+
// set the detailed results to true to get the token usage
|
|
780
|
+
detailedResults: true
|
|
747
781
|
};
|
|
748
782
|
if (useStop) {
|
|
749
783
|
promptData["stop"] = stop;
|
|
750
784
|
}
|
|
751
785
|
let promptResponse;
|
|
752
786
|
try {
|
|
753
|
-
|
|
787
|
+
const mainPromptResponse = await api.runGenerativeAIPrompt(promptData, "answerExtraction");
|
|
788
|
+
promptResponse = mainPromptResponse.result;
|
|
754
789
|
// if we're in adminconsole, process debugging options
|
|
755
|
-
|
|
790
|
+
(0, prompt_1.writeLLMDebugLogs)("Search Extract Output Main Prompt", prompt, mainPromptResponse, debugLogTokenCount, debugLogRequestAndCompletion, cognigy);
|
|
756
791
|
if (storeLocation === "context") {
|
|
757
792
|
api.addToContext(contextKey, promptResponse, "simple");
|
|
758
793
|
}
|
|
@@ -907,7 +942,7 @@ New: `;
|
|
|
907
942
|
{
|
|
908
943
|
"separator": true,
|
|
909
944
|
"type": "TextBlock",
|
|
910
|
-
"text": (
|
|
945
|
+
"text": (_f = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _f === void 0 ? void 0 : _f[0].text,
|
|
911
946
|
"wrap": true,
|
|
912
947
|
"spacing": "Padding"
|
|
913
948
|
}
|
|
@@ -928,7 +963,7 @@ New: `;
|
|
|
928
963
|
"version": "1.6"
|
|
929
964
|
};
|
|
930
965
|
// @ts-ignore
|
|
931
|
-
if ((
|
|
966
|
+
if ((_j = (_h = (_g = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.chunkMetaData) === null || _j === void 0 ? void 0 : _j.url) {
|
|
932
967
|
ADAPTIVE_CARD_RESULT.body[2].items[0].columns[1].items.push({
|
|
933
968
|
"type": "ActionSet",
|
|
934
969
|
"actions": [
|
|
@@ -936,7 +971,7 @@ New: `;
|
|
|
936
971
|
"type": "Action.OpenUrl",
|
|
937
972
|
"title": "Open Source",
|
|
938
973
|
// @ts-ignore
|
|
939
|
-
"url": (
|
|
974
|
+
"url": (_k = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _k === void 0 ? void 0 : _k[0].chunkMetaData.url
|
|
940
975
|
}
|
|
941
976
|
],
|
|
942
977
|
"separator": true
|
|
@@ -29,7 +29,7 @@ exports.DISABLE_SLOT_FILLERS = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
29
29
|
label: "UI__NODE_EDITOR__DISABLE_SLOT_FILLERS__RESET__LABEL",
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
|
-
tags: ["nlu"],
|
|
32
|
+
tags: ["ai", "nlu"],
|
|
33
33
|
function: async ({ cognigy, config }) => {
|
|
34
34
|
const { slotFillersToDisable, reset } = config;
|
|
35
35
|
const { api, flowReferenceId } = cognigy;
|
|
@@ -24,7 +24,7 @@ exports.ENABLE_SLOT_FILLERS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
24
24
|
description: "UI__NODE_EDITOR__ENABLE_SLOT_FILLERS__SLOT_FILLERS_TO_ENABLE__DESCRIPTION"
|
|
25
25
|
}
|
|
26
26
|
],
|
|
27
|
-
tags: ["nlu"],
|
|
27
|
+
tags: ["ai", "nlu"],
|
|
28
28
|
function: async ({ cognigy, config }) => {
|
|
29
29
|
const { slotFillersToEnable } = config;
|
|
30
30
|
const { api, flowReferenceId } = cognigy;
|
|
@@ -22,6 +22,7 @@ exports.RESET_STATE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
22
22
|
const { api, input } = cognigy;
|
|
23
23
|
const state = await api.resetState();
|
|
24
24
|
input.state = state;
|
|
25
|
+
api.logDebugMessage(`UI__DEBUG_MODE__RESET_STATE__MESSAGE`);
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
28
|
//# sourceMappingURL=resetState.js.map
|
|
@@ -30,7 +30,7 @@ exports.SET_STATE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
30
30
|
{
|
|
31
31
|
key: "data",
|
|
32
32
|
type: "json",
|
|
33
|
-
label: "UI__NODE_EDITOR__SET_STATE__DATA__LABEL
|
|
33
|
+
label: "UI__NODE_EDITOR__SET_STATE__DATA__LABEL"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
36
|
preview: {
|
|
@@ -43,6 +43,7 @@ exports.SET_STATE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
43
43
|
const { input, api } = cognigy;
|
|
44
44
|
api.setState(state);
|
|
45
45
|
input.state = state;
|
|
46
|
+
api.logDebugMessage(`UI__DEBUG_MODE__SET_STATE__MESSAGE ${state}`);
|
|
46
47
|
if (text || data) {
|
|
47
48
|
api.think(text, data);
|
|
48
49
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SET_TRANSLATION = void 0;
|
|
4
4
|
/** Custom Modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const logFullConfigToDebugMode_1 = require("../../../helper/logFullConfigToDebugMode");
|
|
6
7
|
exports.SET_TRANSLATION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
8
|
type: "setTranslation",
|
|
8
9
|
defaultLabel: "Set Translation",
|
|
@@ -72,7 +73,7 @@ exports.SET_TRANSLATION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
72
73
|
{ type: "field", key: "alwaysRemoveNoTranslateMarker" },
|
|
73
74
|
],
|
|
74
75
|
function: async ({ cognigy, config }) => {
|
|
75
|
-
const { api } = cognigy;
|
|
76
|
+
const { api, input } = cognigy;
|
|
76
77
|
const { translationEnabled, flowLanguage, inputLanguage, padPayloads, alwaysRemoveNoTranslateMarker, noTranslateMarker, setInputLanguageOnExecutionCount } = config;
|
|
77
78
|
api.setTranslationSettings({
|
|
78
79
|
translationEnabled,
|
|
@@ -83,6 +84,7 @@ exports.SET_TRANSLATION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
83
84
|
noTranslateMarker,
|
|
84
85
|
setInputLanguageOnExecutionCount
|
|
85
86
|
});
|
|
87
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
86
88
|
}
|
|
87
89
|
});
|
|
88
90
|
//# sourceMappingURL=setTranslation.js.map
|
|
@@ -59,6 +59,7 @@ exports.SWITCH_LOCALE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
59
59
|
else {
|
|
60
60
|
await api.setLocaleReferenceId(localeReferenceId);
|
|
61
61
|
}
|
|
62
|
+
api.logDebugMessage(`UI__DEBUG_MODE__SWITCH_LOCALE__MESSAGE`);
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
65
|
//# sourceMappingURL=switchLocale.js.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.THINK = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const logFullConfigToDebugMode_1 = require("../../../helper/logFullConfigToDebugMode");
|
|
6
7
|
/**
|
|
7
8
|
* Node name: 'think'
|
|
8
9
|
*
|
|
@@ -93,10 +94,11 @@ exports.THINK = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
93
94
|
key: "text",
|
|
94
95
|
type: "text",
|
|
95
96
|
},
|
|
96
|
-
tags: ["
|
|
97
|
+
tags: ["logic", "recursion", "inject"],
|
|
97
98
|
function: async ({ cognigy, config }) => {
|
|
98
99
|
const { text, data, intent, thinkType, } = config;
|
|
99
100
|
const { api } = cognigy;
|
|
101
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
100
102
|
if (thinkType === "intent") {
|
|
101
103
|
api.think(`cIntent:${intent}`, null);
|
|
102
104
|
}
|