@cognigy/rest-api-client 4.95.0 → 4.97.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 +10 -0
- package/build/apigroups/ManagementAPIGroup_2_0.js +2 -1
- package/build/apigroups/ResourcesAPIGroup_2_0.js +9 -0
- package/build/authentication/AuthenticationAPI.js +6 -1
- package/build/authentication/JWT/IJwtTokenAuthentication.js +3 -0
- package/build/authentication/JWT/JwtTokenAuthentication.js +22 -0
- package/build/shared/charts/descriptors/allFields.js +6 -0
- package/build/shared/charts/descriptors/analytics/addMemory.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +6 -2
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAICompatibleProviderConnection.js +11 -0
- package/build/shared/charts/descriptors/connectionNodes/speechProviders/deepgramSpeechProviderConnection.js +11 -0
- package/build/shared/charts/descriptors/connectionNodes/speechProviders/index.js +2 -0
- package/build/shared/charts/descriptors/index.js +6 -0
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +13 -1
- package/build/shared/charts/descriptors/message/question/question.js +21 -13
- package/build/shared/charts/descriptors/message/say.js +25 -2
- package/build/shared/charts/descriptors/service/GPTPrompt.js +10 -2
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +184 -51
- package/build/shared/charts/descriptors/service/checkAgentAvailability.js +63 -3
- package/build/shared/charts/descriptors/service/handoverConnections.js +51 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +124 -64
- package/build/shared/charts/descriptors/service/index.js +8 -1
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +4 -1
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/continuousAsr.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/hangup.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/noUserInput.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/play.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/sendMetadata.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/record.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +47 -2
- package/build/shared/constants.js +10 -1
- package/build/shared/helper/nlu/textCleaner.js +10 -2
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +3 -0
- package/build/shared/interfaces/handover.js +74 -10
- package/build/shared/interfaces/handoverProviders.js +23 -0
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/build/shared/interfaces/messageAPI/handover.js +25 -5
- package/build/shared/interfaces/resources/IAiAgent.js +10 -0
- package/build/shared/interfaces/resources/IExternalModel.js +3 -0
- package/build/shared/interfaces/resources/IHandoverProvider.js +3 -0
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +13 -2
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +9 -5
- package/build/shared/interfaces/resources/TResourceType.js +6 -0
- package/build/shared/interfaces/resources/intent/IDefaultReply.js +0 -1
- package/build/shared/interfaces/resources/settings/IAudioPreviewSettings.js +8 -2
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/ICreateHandoverProviderRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IDeleteHandoverProviderRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverProvider_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverService_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverProvidersRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverServicesRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IReadHandoverProviderRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IUpdateHandoverProviderRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/index.js +3 -0
- package/build/shared/interfaces/security/IPermission.js +2 -0
- package/build/shared/interfaces/security/IRole.js +2 -0
- package/build/shared/interfaces/security/index.js +1 -1
- package/dist/esm/apigroups/ManagementAPIGroup_2_0.js +2 -1
- package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +9 -0
- package/dist/esm/authentication/AuthenticationAPI.js +6 -1
- package/dist/esm/authentication/JWT/IJwtTokenAuthentication.js +2 -0
- package/dist/esm/authentication/JWT/JwtTokenAuthentication.js +21 -0
- package/dist/esm/shared/charts/descriptors/allFields.js +6 -0
- package/dist/esm/shared/charts/descriptors/analytics/addMemory.js +1 -1
- package/dist/esm/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +4 -1
- package/dist/esm/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAICompatibleProviderConnection.js +8 -0
- package/dist/esm/shared/charts/descriptors/connectionNodes/speechProviders/deepgramSpeechProviderConnection.js +8 -0
- package/dist/esm/shared/charts/descriptors/connectionNodes/speechProviders/index.js +2 -0
- package/dist/esm/shared/charts/descriptors/index.js +7 -1
- package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +13 -1
- package/dist/esm/shared/charts/descriptors/message/question/question.js +21 -13
- package/dist/esm/shared/charts/descriptors/message/say.js +25 -2
- package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +10 -2
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +184 -51
- package/dist/esm/shared/charts/descriptors/service/checkAgentAvailability.js +63 -3
- package/dist/esm/shared/charts/descriptors/service/handoverConnections.js +48 -0
- package/dist/esm/shared/charts/descriptors/service/handoverV2.js +124 -64
- package/dist/esm/shared/charts/descriptors/service/index.js +1 -0
- package/dist/esm/shared/charts/descriptors/voice/mappers/transfer.mapper.js +4 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/bargeIn.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/continuousAsr.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/dtmf.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/hangup.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/noUserInput.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/play.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/sendMetadata.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/transfer.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/hangup.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/play.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/record.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/refer.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/transfer.js +47 -2
- package/dist/esm/shared/constants.js +9 -0
- package/dist/esm/shared/helper/nlu/textCleaner.js +10 -2
- package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +3 -0
- package/dist/esm/shared/interfaces/handover.js +73 -9
- package/dist/esm/shared/interfaces/handoverProviders.js +20 -0
- package/dist/esm/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/dist/esm/shared/interfaces/messageAPI/handover.js +24 -4
- package/dist/esm/shared/interfaces/resources/IAiAgent.js +10 -0
- package/dist/esm/shared/interfaces/resources/IExternalModel.js +2 -0
- package/dist/esm/shared/interfaces/resources/IHandoverProvider.js +2 -0
- package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +12 -1
- package/dist/esm/shared/interfaces/resources/INodeDescriptorSet.js +9 -5
- package/dist/esm/shared/interfaces/resources/TResourceType.js +6 -0
- package/dist/esm/shared/interfaces/resources/intent/IDefaultReply.js +0 -1
- package/dist/esm/shared/interfaces/resources/settings/IAudioPreviewSettings.js +8 -2
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/ICreateHandoverProviderRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IDeleteHandoverProviderRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverProvider_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverService_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverProvidersRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverServicesRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IReadHandoverProviderRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IUpdateHandoverProviderRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/index.js +2 -0
- package/dist/esm/shared/interfaces/security/IPermission.js +2 -0
- package/dist/esm/shared/interfaces/security/IRole.js +2 -0
- package/dist/esm/shared/interfaces/security/index.js +1 -1
- package/package.json +2 -2
- package/types/index.d.ts +626 -25
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
const JwtTokenAuthentication = function (credentials, self) {
|
|
3
|
+
if (!(this instanceof JwtTokenAuthentication)) {
|
|
4
|
+
return new JwtTokenAuthentication(credentials, self);
|
|
5
|
+
}
|
|
6
|
+
else {
|
|
7
|
+
self.credentials = {
|
|
8
|
+
token: credentials.token,
|
|
9
|
+
type: credentials.type
|
|
10
|
+
};
|
|
11
|
+
const JwtTokenAuthentication = function () { };
|
|
12
|
+
JwtTokenAuthentication.prototype.getAuthenticationHeaders = () => __awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
const headers = {};
|
|
14
|
+
headers["Authorization"] = `Bearer ${credentials.token}`;
|
|
15
|
+
return headers;
|
|
16
|
+
});
|
|
17
|
+
return new JwtTokenAuthentication(credentials, self);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export default JwtTokenAuthentication;
|
|
21
|
+
//# sourceMappingURL=JwtTokenAuthentication.js.map
|
|
@@ -67,6 +67,12 @@ export const ALL_FIELDS = createNodeDescriptor({
|
|
|
67
67
|
locale: "de-DE",
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
|
+
{
|
|
71
|
+
key: "handoverProvider",
|
|
72
|
+
type: "handoverProvider",
|
|
73
|
+
label: "Handover Provider Configuration",
|
|
74
|
+
description: "Select and configure a handover provider",
|
|
75
|
+
},
|
|
70
76
|
{
|
|
71
77
|
key: "select",
|
|
72
78
|
type: "select",
|
|
@@ -28,7 +28,7 @@ export const ADD_MEMORY = createNodeDescriptor({
|
|
|
28
28
|
var _a, _b;
|
|
29
29
|
const { memory: memoryText } = config;
|
|
30
30
|
const { api } = cognigy;
|
|
31
|
-
if (memoryText) {
|
|
31
|
+
if (memoryText !== undefined && memoryText !== null && memoryText !== "") {
|
|
32
32
|
let memoryToAdd;
|
|
33
33
|
if (typeof memoryText === 'string') {
|
|
34
34
|
memoryToAdd = memoryText;
|
|
@@ -8,6 +8,7 @@ import { ANTHROPIC_PROVIDER_CONNECTION } from "./anthropicProviderConnection";
|
|
|
8
8
|
import { GOOGLE_VERTEXAI_PROVIDER_CONNECTION } from "./googleVertexAIProviderConnection";
|
|
9
9
|
import { ALEPH_ALPHA_PROVIDER_CONNECTION } from "./alephAlphaProviderConnection";
|
|
10
10
|
import { AWS_BEDROCK_PROVIDER_CONNECTION } from "./awsBedrockProviderConnection";
|
|
11
|
+
import { OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION } from "./openAICompatibleProviderConnection";
|
|
11
12
|
export { OPEN_AI_PROVIDER_CONNECTION } from "./openAIProviderConnection";
|
|
12
13
|
export { AZURE_OPEN_AI_PROVIDER_CONNECTION } from "./azureOpenAIProviderConnection";
|
|
13
14
|
export { AZURE_OPEN_AI_V2_PROVIDER_CONNECTION } from "./azureOpenAIProviderConnectionV2";
|
|
@@ -16,6 +17,7 @@ export { ANTHROPIC_PROVIDER_CONNECTION } from "./anthropicProviderConnection";
|
|
|
16
17
|
export { GOOGLE_VERTEXAI_PROVIDER_CONNECTION } from "./googleVertexAIProviderConnection";
|
|
17
18
|
export { ALEPH_ALPHA_PROVIDER_CONNECTION } from "./alephAlphaProviderConnection";
|
|
18
19
|
export { AWS_BEDROCK_PROVIDER_CONNECTION } from "./awsBedrockProviderConnection";
|
|
20
|
+
export { OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION } from "./openAICompatibleProviderConnection";
|
|
19
21
|
export const cognigyGenerativeAIProviderModule = createExtension({
|
|
20
22
|
nodes: [],
|
|
21
23
|
connections: [
|
|
@@ -26,7 +28,8 @@ export const cognigyGenerativeAIProviderModule = createExtension({
|
|
|
26
28
|
ANTHROPIC_PROVIDER_CONNECTION,
|
|
27
29
|
GOOGLE_VERTEXAI_PROVIDER_CONNECTION,
|
|
28
30
|
ALEPH_ALPHA_PROVIDER_CONNECTION,
|
|
29
|
-
AWS_BEDROCK_PROVIDER_CONNECTION
|
|
31
|
+
AWS_BEDROCK_PROVIDER_CONNECTION,
|
|
32
|
+
OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION
|
|
30
33
|
]
|
|
31
34
|
});
|
|
32
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION = {
|
|
2
|
+
type: "OpenAICompatibleProvider",
|
|
3
|
+
label: "UI__NODE_EDITOR__OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION__LABEL",
|
|
4
|
+
fields: [
|
|
5
|
+
{ fieldName: "apiKey", label: "UI__CONNECTION_EDITOR__FIELD_API_KEY" },
|
|
6
|
+
]
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=openAICompatibleProviderConnection.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const DEEPGRAM_SPEECH_PROVIDER_CONNECTION = {
|
|
2
|
+
type: "DeepgramSpeechProvider",
|
|
3
|
+
label: "UI__NODE_EDITOR__DEEPGRAM_SPEECH_PROVIDER__LABEL",
|
|
4
|
+
fields: [
|
|
5
|
+
{ fieldName: "apiKey", label: "UI__CONNECTION_EDITOR__FIELD_API_KEY" },
|
|
6
|
+
]
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=deepgramSpeechProviderConnection.js.map
|
|
@@ -3,6 +3,7 @@ import { createExtension } from "../../../createNodeDescriptor";
|
|
|
3
3
|
import { AWS_SPEECH_PROVIDER_CONNECTION } from "./awsSpeechProviderConnection";
|
|
4
4
|
import { MICROSOFT_SPEECH_PROVIDER_CONNECTION } from "./microsoftSpeechProviderConnection";
|
|
5
5
|
import { GOOGLE_SPEECH_PROVIDER_CONNECTION } from "./googleSpeechProviderConnection";
|
|
6
|
+
import { DEEPGRAM_SPEECH_PROVIDER_CONNECTION } from "./deepgramSpeechProviderConnection";
|
|
6
7
|
export { AWS_SPEECH_PROVIDER_CONNECTION } from "./awsSpeechProviderConnection";
|
|
7
8
|
export { MICROSOFT_SPEECH_PROVIDER_CONNECTION } from "./microsoftSpeechProviderConnection";
|
|
8
9
|
export { GOOGLE_SPEECH_PROVIDER_CONNECTION } from "./googleSpeechProviderConnection";
|
|
@@ -12,6 +13,7 @@ export const cognigySpeechProviderModule = createExtension({
|
|
|
12
13
|
AWS_SPEECH_PROVIDER_CONNECTION,
|
|
13
14
|
MICROSOFT_SPEECH_PROVIDER_CONNECTION,
|
|
14
15
|
GOOGLE_SPEECH_PROVIDER_CONNECTION,
|
|
16
|
+
DEEPGRAM_SPEECH_PROVIDER_CONNECTION,
|
|
15
17
|
]
|
|
16
18
|
});
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -11,7 +11,7 @@ import { REGEX_SLOT_FILLER, EXECUTE_COGNIGY_NLU, ADD_LEXICON_KEYPHRASE, FUZZY_SE
|
|
|
11
11
|
import { KNOWLEDGE_SEARCH, KNOWLEDGE_SEARCH_V2, SEARCH_EXTRACT_OUTPUT } from "./knowledgeSearch";
|
|
12
12
|
import { CONTINUOUS_ASR, DTMF, HANG_UP, PLAY, TRANSFER_VOICE, SESSION_SPEECH_PARAMETERS, USER_INPUT_TIMEOUT, SEND_METADATA, BARGE_IN, MUTE_SPEECH_INPUT, } from "./voice";
|
|
13
13
|
import { ACTIVATE_PROFILE, COMPLETE_GOAL, DEACTIVATE_PROFILE, DELETE_PROFILE, MERGE_PROFILE, UPDATE_PROFILE, ADD_MEMORY, BLIND_MODE, OVERWRITE_ANALYTICS, SET_RATING, REQUEST_RATING, TRACK_GOAL, } from "./analytics";
|
|
14
|
-
import { HANDOVER, HANDOVER_V2, CHECK_AGENT_AVAILABILITY, HTTP_REQUEST, HTTP_CONNECTION_BASIC, HTTP_CONNECTION_APIKEYAUTHKEY, HTTP_CONNECTION_APIKEYXKEY, HTTP_CONNECTION_OAUTH2, JWT_SECRET_CONNECTION, TRIGGER_FUNCTION, ON_SCHEDULING_ERROR, ON_SCHEDULED, GPT_PROMPT, CLOSE_HANDOVER, HANDOVER_INACTIVITY_TIMER, GPT_CONVERSATION, GPT_CONVERSATION_SUMMARY, LLM_ENTITY_EXTRACT, AI_AGENT_JOB, AI_AGENT_JOB_DEFAULT, AI_AGENT_JOB_TOOL, AI_AGENT_TOOL_ANSWER, AI_AGENT_HANDOVER, } from "./service";
|
|
14
|
+
import { HANDOVER, HANDOVER_V2, CHECK_AGENT_AVAILABILITY, HTTP_REQUEST, HTTP_CONNECTION_BASIC, HTTP_CONNECTION_APIKEYAUTHKEY, HTTP_CONNECTION_APIKEYXKEY, HTTP_CONNECTION_OAUTH2, JWT_SECRET_CONNECTION, TRIGGER_FUNCTION, ON_SCHEDULING_ERROR, ON_SCHEDULED, GPT_PROMPT, CLOSE_HANDOVER, HANDOVER_INACTIVITY_TIMER, GPT_CONVERSATION, GPT_CONVERSATION_SUMMARY, LLM_ENTITY_EXTRACT, AI_AGENT_JOB, AI_AGENT_JOB_DEFAULT, AI_AGENT_JOB_TOOL, AI_AGENT_TOOL_ANSWER, AI_AGENT_HANDOVER, LIVE_AGENT_CONNECTION, RINGCENTRAL_ENGAGE_CONNECTION, CHATWOOT_CONNECTION, EIGHT_BY_EIGHT_CONNECTION, GENESYS_CLOUD_CONNECTION, GENESYS_CLOUD_CONNECTION_OM } from "./service";
|
|
15
15
|
import { INIT_APP_SESSION, GET_APP_SESSION_PIN, SET_HTML_APP_STATE, SET_ADAPTIVE_CARD_APP_STATE, } from "./apps";
|
|
16
16
|
import { SET_IFRAME_TILE, SET_HTML_TILE, SEND_TILE_DATA, SET_SECURE_FORMS_TILE, SET_ADAPTIVE_CARD_TILE, SET_AGENT_ASSIST_GRID, NEXT_ACTION_ASSIST, SENTIMENT_ASSIST, TRANSCRIPT_ASSIST, IDENTITY_ASSIST, KNOWLEDGE_ASSIST, } from "./agentAssist";
|
|
17
17
|
import { ASSIST_INFO } from "./liveAgent";
|
|
@@ -153,6 +153,12 @@ export const cognigyBasicModule = createExtension({
|
|
|
153
153
|
HTTP_CONNECTION_APIKEYXKEY,
|
|
154
154
|
HTTP_CONNECTION_OAUTH2,
|
|
155
155
|
JWT_SECRET_CONNECTION,
|
|
156
|
+
LIVE_AGENT_CONNECTION,
|
|
157
|
+
RINGCENTRAL_ENGAGE_CONNECTION,
|
|
158
|
+
CHATWOOT_CONNECTION,
|
|
159
|
+
EIGHT_BY_EIGHT_CONNECTION,
|
|
160
|
+
GENESYS_CLOUD_CONNECTION,
|
|
161
|
+
GENESYS_CLOUD_CONNECTION_OM
|
|
156
162
|
],
|
|
157
163
|
});
|
|
158
164
|
export { cognigyMongoDBModule } from "./connectionNodes/mongoDB";
|
|
@@ -3,6 +3,7 @@ import { __awaiter } from "tslib";
|
|
|
3
3
|
import { createNodeDescriptor } from "../../createNodeDescriptor";
|
|
4
4
|
import { GO_TO } from "../logic";
|
|
5
5
|
import { writeLLMDebugLogs } from "../nlu/generativeSlotFiller/prompt";
|
|
6
|
+
import { randomUUID } from 'crypto';
|
|
6
7
|
import { InternalServerError } from "../../../errors";
|
|
7
8
|
/**
|
|
8
9
|
* Returns the simplified english name for a language given a language code
|
|
@@ -636,6 +637,10 @@ New: `;
|
|
|
636
637
|
message: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
637
638
|
};
|
|
638
639
|
api.logDebugError(JSON.stringify(compactError, undefined, 2), "Search Extract Output: Error");
|
|
640
|
+
api.emitToOpsCenter({
|
|
641
|
+
subComponent: "KnowledgeAIQueries",
|
|
642
|
+
title: error === null || error === void 0 ? void 0 : error.message
|
|
643
|
+
});
|
|
639
644
|
if ((_l = error === null || error === void 0 ? void 0 : error.originalErrorDetails) === null || _l === void 0 ? void 0 : _l.code) {
|
|
640
645
|
compactError["code"] = error.originalErrorDetails.code;
|
|
641
646
|
}
|
|
@@ -759,6 +764,8 @@ New: `;
|
|
|
759
764
|
if (documents && (mode !== "s")) {
|
|
760
765
|
// check if we received streamed output at all
|
|
761
766
|
let streamedOutput = false;
|
|
767
|
+
const isStreamingChannel = input.channel === "webchat3" || input.channel === "adminconsole";
|
|
768
|
+
const _messageId = randomUUID();
|
|
762
769
|
const promptData = {
|
|
763
770
|
prompt,
|
|
764
771
|
temperature,
|
|
@@ -771,9 +778,14 @@ New: `;
|
|
|
771
778
|
stream: outputMode === "stream" && mode === "seo",
|
|
772
779
|
streamOnDataHandler: (text) => {
|
|
773
780
|
streamedOutput = true;
|
|
774
|
-
api.output(text,
|
|
781
|
+
api.output(text, {
|
|
782
|
+
_cognigy: {
|
|
783
|
+
_messageId,
|
|
784
|
+
}
|
|
785
|
+
});
|
|
775
786
|
},
|
|
776
787
|
streamStopTokens,
|
|
788
|
+
preventNewLineRemoval: isStreamingChannel ? true : false,
|
|
777
789
|
// set the detailed results to true to get the token usage
|
|
778
790
|
detailedResults: true
|
|
779
791
|
};
|
|
@@ -538,6 +538,13 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
538
538
|
description: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__MAX_EXECUTION_DIFF__DESCRIPTION",
|
|
539
539
|
defaultValue: 1
|
|
540
540
|
},
|
|
541
|
+
{
|
|
542
|
+
key: "preventTranscript",
|
|
543
|
+
type: "toggle",
|
|
544
|
+
defaultValue: false,
|
|
545
|
+
label: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__LABEL",
|
|
546
|
+
description: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__DESCRIPTION",
|
|
547
|
+
},
|
|
541
548
|
{
|
|
542
549
|
key: "escalateAnswersAction",
|
|
543
550
|
type: "select",
|
|
@@ -1738,7 +1745,8 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
1738
1745
|
"onlyAcceptEscalationIntents",
|
|
1739
1746
|
"additionalValidation",
|
|
1740
1747
|
"resultLocation",
|
|
1741
|
-
"maxExecutionDiff"
|
|
1748
|
+
"maxExecutionDiff",
|
|
1749
|
+
"preventTranscript"
|
|
1742
1750
|
]
|
|
1743
1751
|
},
|
|
1744
1752
|
{
|
|
@@ -1830,7 +1838,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
1830
1838
|
//#endregion DescriptorFields
|
|
1831
1839
|
function: ({ cognigy, nodeId, organisationId, config, inputOptions }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1832
1840
|
var _a, _b, _c;
|
|
1833
|
-
const { say, type, validationMessage, repromptLLMProvider, repromptType = "text", repromptLLMPrompt, repromptLLMTurns, repromptLLMStream, repromptLLMStreamStopTokens, repromptSay, repromptFlowNode, repromptParseIntents, repromptParseKeyphrases, repromptAbsorbContext, validationRepeat, storeResultInContext, contextKey, storeInContactProfile, profileKey, storeDetailedResults, parseResultOnEntry, repromptCondition, maxExecutionDiff, resultLocation, skipRepromptOnIntent, onlyAcceptEscalationIntents, escalateAnswersAction, escalateAnswersThreshold, escalateAnswersGotoTarget, escalateAnswersExecuteTarget, escalateAnswersGotoExecutionMode, escalateAnswersInjectedText, escalateAnswersInjectedData, escalateAnswersMessage, escalateAnswersRepromptPrevention, escalateAnswersOnce, escalateAnswersHandoverText, escalateAnswersRepeatHandoverMessage, escalateAnswersHandoverCancelIntent, escalateAnswersHandoverQuickReply, escalateAnswersHandoverChatwootInboxId, escalateAnswersHandoverLiveAgentInboxId, escalateAnswersHandoverAdditionalCategoryIds, escalateAnswersHandoverSendTranscriptAsFirstMessage, escalateAnswersHandoverSalesforcePrechatEntities, escalateAnswersHandoverSalesforcePrechatDetails, escalateAnswersHandoverGenesysLanguage, escalateAnswersHandoverGenesysSkills, escalateAnswersHandoverGenesysPriority, escalateAnswersHandoverGenesysCustomAttributes, escalateAnswersHandoverEightByEightChannelId, escalateAnswersHandoverEightByEightQueueId, escalateAnswersHandoverEightByEightJSONProps, escalateAnswersHandoverSendResolveEvent, escalateAnswersHandoverResolveBehavior, escalateAnswersAgentAssistInitMessage, escalateAnswersAllowAgentInject, escalateAnswersSendOnActiveEvent, escalateAnswersSendOnQueueEvent, escalateIntentsAction, escalateIntentsValidIntents, escalateIntentsThreshold, escalateIntentsGotoTarget, escalateIntentsExecuteTarget, escalateIntentsGotoExecutionMode, escalateIntentsInjectedText, escalateIntentsInjectedData, escalateIntentsMessage, escalateIntentsHandoverText, escalateIntentsRepeatHandoverMessage, escalateIntentsHandoverCancelIntent, escalateIntentsHandoverQuickReply, escalateIntentsHandoverChatwootInboxId, escalateIntentsHandoverLiveAgentInboxId, escalateIntentsHandoverAdditionalCategoryIds, escalateIntentHandoverSendTranscriptAsFirstMessage, escalateIntentsHandoverSalesforcePrechatEntities, escalateIntentsHandoverSalesforcePrechatDetails, escalateIntentsHandoverGenesysLanguage, escalateIntentsHandoverGenesysSkills, escalateIntentsHandoverGenesysPriority, escalateIntentsHandoverGenesysCustomAttributes, escalateIntentsHandoverEightByEightChannelId, escalateIntentsHandoverEightByEightQueueId, escalateIntentsHandoverEightByEightJSONProps, escalateIntentsRepromptPrevention, escalateIntentsHandoverSendResolveEvent, escalateIntentsHandoverResolveBehavior, escalateIntentsAgentAssistInitMessage, escalateIntentsAllowAgentInject, escalateIntentsSendOnActiveEvent, escalateIntentsSendOnQueueEvent, reconfirmationBehaviour, reconfirmationQuestion, reconfirmationQuestionReprompt, handoverOutput, cleanTextLocale, cleanDisallowedSymbols, additionalAllowedCharacters, additionalSpecialPhrases, resolveSpelledOutNumbers, resolvePhoneticAlphabet, additionalPhoneticAlphabet, replaceSpecialWords, additionalMappedSymbols, resolveSpelledOutAlphabet, resolvePhoneticCounters, contractSingleCharacters, contractNumberGroups, trimResult, runNLUAfterCleaning, overwrittenBaseAnswer } = config;
|
|
1841
|
+
const { say, type, validationMessage, repromptLLMProvider, repromptType = "text", repromptLLMPrompt, repromptLLMTurns, repromptLLMStream, repromptLLMStreamStopTokens, repromptSay, repromptFlowNode, repromptParseIntents, repromptParseKeyphrases, repromptAbsorbContext, validationRepeat, storeResultInContext, contextKey, storeInContactProfile, profileKey, storeDetailedResults, parseResultOnEntry, repromptCondition, maxExecutionDiff, resultLocation, skipRepromptOnIntent, onlyAcceptEscalationIntents, preventTranscript, escalateAnswersAction, escalateAnswersThreshold, escalateAnswersGotoTarget, escalateAnswersExecuteTarget, escalateAnswersGotoExecutionMode, escalateAnswersInjectedText, escalateAnswersInjectedData, escalateAnswersMessage, escalateAnswersRepromptPrevention, escalateAnswersOnce, escalateAnswersHandoverText, escalateAnswersRepeatHandoverMessage, escalateAnswersHandoverCancelIntent, escalateAnswersHandoverQuickReply, escalateAnswersHandoverChatwootInboxId, escalateAnswersHandoverLiveAgentInboxId, escalateAnswersHandoverAdditionalCategoryIds, escalateAnswersHandoverSendTranscriptAsFirstMessage, escalateAnswersHandoverSalesforcePrechatEntities, escalateAnswersHandoverSalesforcePrechatDetails, escalateAnswersHandoverGenesysLanguage, escalateAnswersHandoverGenesysSkills, escalateAnswersHandoverGenesysPriority, escalateAnswersHandoverGenesysCustomAttributes, escalateAnswersHandoverEightByEightChannelId, escalateAnswersHandoverEightByEightQueueId, escalateAnswersHandoverEightByEightJSONProps, escalateAnswersHandoverSendResolveEvent, escalateAnswersHandoverResolveBehavior, escalateAnswersAgentAssistInitMessage, escalateAnswersAllowAgentInject, escalateAnswersSendOnActiveEvent, escalateAnswersSendOnQueueEvent, escalateIntentsAction, escalateIntentsValidIntents, escalateIntentsThreshold, escalateIntentsGotoTarget, escalateIntentsExecuteTarget, escalateIntentsGotoExecutionMode, escalateIntentsInjectedText, escalateIntentsInjectedData, escalateIntentsMessage, escalateIntentsHandoverText, escalateIntentsRepeatHandoverMessage, escalateIntentsHandoverCancelIntent, escalateIntentsHandoverQuickReply, escalateIntentsHandoverChatwootInboxId, escalateIntentsHandoverLiveAgentInboxId, escalateIntentsHandoverAdditionalCategoryIds, escalateIntentHandoverSendTranscriptAsFirstMessage, escalateIntentsHandoverSalesforcePrechatEntities, escalateIntentsHandoverSalesforcePrechatDetails, escalateIntentsHandoverGenesysLanguage, escalateIntentsHandoverGenesysSkills, escalateIntentsHandoverGenesysPriority, escalateIntentsHandoverGenesysCustomAttributes, escalateIntentsHandoverEightByEightChannelId, escalateIntentsHandoverEightByEightQueueId, escalateIntentsHandoverEightByEightJSONProps, escalateIntentsRepromptPrevention, escalateIntentsHandoverSendResolveEvent, escalateIntentsHandoverResolveBehavior, escalateIntentsAgentAssistInitMessage, escalateIntentsAllowAgentInject, escalateIntentsSendOnActiveEvent, escalateIntentsSendOnQueueEvent, reconfirmationBehaviour, reconfirmationQuestion, reconfirmationQuestionReprompt, handoverOutput, cleanTextLocale, cleanDisallowedSymbols, additionalAllowedCharacters, additionalSpecialPhrases, resolveSpelledOutNumbers, resolvePhoneticAlphabet, additionalPhoneticAlphabet, replaceSpecialWords, additionalMappedSymbols, resolveSpelledOutAlphabet, resolvePhoneticCounters, contractSingleCharacters, contractNumberGroups, trimResult, runNLUAfterCleaning, overwrittenBaseAnswer } = config;
|
|
1834
1842
|
const { input, context, profile, api } = cognigy;
|
|
1835
1843
|
const rephraseWithAIParams = {
|
|
1836
1844
|
generativeAI_rephraseOutputMode: config.generativeAI_rephraseOutputMode,
|
|
@@ -1973,11 +1981,11 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
1973
1981
|
}
|
|
1974
1982
|
// output reconfirmation reprompt
|
|
1975
1983
|
if (reconfirmationQuestionReprompt) {
|
|
1976
|
-
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, say: { type: "text", text: [reconfirmationQuestionReprompt] } } });
|
|
1984
|
+
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, preventTranscript, say: { type: "text", text: [reconfirmationQuestionReprompt] } } });
|
|
1977
1985
|
}
|
|
1978
1986
|
// output reconfirmationQuestion
|
|
1979
1987
|
const tentativeAnswerShortform = (activeQuestion === null || activeQuestion === void 0 ? void 0 : activeQuestion.tentativeAnswerShortform) || "";
|
|
1980
|
-
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", tentativeAnswerShortform)] } } });
|
|
1988
|
+
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, preventTranscript, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", tentativeAnswerShortform)] } } });
|
|
1981
1989
|
// set myself as next node and stop
|
|
1982
1990
|
api.setNextNode(nodeId);
|
|
1983
1991
|
api.stopExecution();
|
|
@@ -2043,7 +2051,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2043
2051
|
if (isFirstExecution && !parseResultOnEntry) {
|
|
2044
2052
|
rephraseWithAIParams.promptType = "question";
|
|
2045
2053
|
rephraseWithAIParams.questionType = config.type;
|
|
2046
|
-
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ say }, rephraseWithAIParams) });
|
|
2054
|
+
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, say }, rephraseWithAIParams) });
|
|
2047
2055
|
if (config.type === "date" && !config.datepicker_hidePicker) {
|
|
2048
2056
|
showDatePicker(cognigy, config);
|
|
2049
2057
|
}
|
|
@@ -2081,7 +2089,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2081
2089
|
// remember a shortform of the given answer in the activeQuestion object
|
|
2082
2090
|
activeQuestion.tentativeAnswerShortform = generateAnswerShortForm(type, result, cognigy.input.text);
|
|
2083
2091
|
// Output reconfirmationQuestion
|
|
2084
|
-
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", activeQuestion.tentativeAnswerShortform)] } } });
|
|
2092
|
+
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, preventTranscript, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", activeQuestion.tentativeAnswerShortform)] } } });
|
|
2085
2093
|
// remember that we are in reconfirmation mode and stop
|
|
2086
2094
|
api.setSystemContext("reconfirmationQuestionInProgress", true);
|
|
2087
2095
|
// we need to store the input, to be able to restore it afterwards
|
|
@@ -2206,7 +2214,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2206
2214
|
childConfigs: [],
|
|
2207
2215
|
nodeId,
|
|
2208
2216
|
organisationId,
|
|
2209
|
-
config: { handoverOutput, say: escalateIntentsMessage }
|
|
2217
|
+
config: { handoverOutput, preventTranscript, say: escalateIntentsMessage }
|
|
2210
2218
|
});
|
|
2211
2219
|
if (escalateIntentsRepromptPrevention) {
|
|
2212
2220
|
sayReprompt = false;
|
|
@@ -2355,7 +2363,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2355
2363
|
childConfigs: [],
|
|
2356
2364
|
nodeId,
|
|
2357
2365
|
organisationId,
|
|
2358
|
-
config: { handoverOutput, say: escalateAnswersMessage }
|
|
2366
|
+
config: { handoverOutput, preventTranscript, say: escalateAnswersMessage }
|
|
2359
2367
|
});
|
|
2360
2368
|
if (escalateAnswersRepromptPrevention) {
|
|
2361
2369
|
sayReprompt = false;
|
|
@@ -2433,7 +2441,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2433
2441
|
if (sayReprompt) {
|
|
2434
2442
|
switch (repromptType) {
|
|
2435
2443
|
case "say":
|
|
2436
|
-
yield SAY.function(Object.assign({ cognigy, childConfigs: [], nodeId, organisationId, config: { say: repromptSay } }, rephraseWithAIParams));
|
|
2444
|
+
yield SAY.function(Object.assign({ cognigy, childConfigs: [], nodeId, organisationId, config: { preventTranscript, say: repromptSay } }, rephraseWithAIParams));
|
|
2437
2445
|
break;
|
|
2438
2446
|
case "execute":
|
|
2439
2447
|
// if a question reprompt is set to execute flow and we have just executed
|
|
@@ -2482,11 +2490,11 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2482
2490
|
}
|
|
2483
2491
|
const repromptMessage = yield api.runGenerativeAIPrompt(data, "gptPromptNode");
|
|
2484
2492
|
if (!repromptLLMStream) {
|
|
2485
|
-
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ handoverOutput, say: { type: "text", text: [repromptMessage] } }, rephraseWithAIParams) });
|
|
2493
|
+
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [repromptMessage] } }, rephraseWithAIParams) });
|
|
2486
2494
|
}
|
|
2487
2495
|
break;
|
|
2488
2496
|
default: // this is also "text"
|
|
2489
|
-
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ handoverOutput, say: { type: "text", text: [validationMessage] } }, rephraseWithAIParams) });
|
|
2497
|
+
yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [validationMessage] } }, rephraseWithAIParams) });
|
|
2490
2498
|
}
|
|
2491
2499
|
}
|
|
2492
2500
|
/* If repeat toggle is on, also output question (and maybe datepicker) again */
|
|
@@ -2498,7 +2506,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2498
2506
|
childConfigs: [],
|
|
2499
2507
|
nodeId,
|
|
2500
2508
|
organisationId,
|
|
2501
|
-
config: Object.assign({ say }, rephraseWithAIParams)
|
|
2509
|
+
config: Object.assign({ preventTranscript, say }, rephraseWithAIParams)
|
|
2502
2510
|
});
|
|
2503
2511
|
if (config.type === "date" && !config.datepicker_hidePicker) {
|
|
2504
2512
|
showDatePicker(cognigy, config);
|
|
@@ -2514,7 +2522,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2514
2522
|
childConfigs: [],
|
|
2515
2523
|
nodeId,
|
|
2516
2524
|
organisationId,
|
|
2517
|
-
config: Object.assign({ say }, rephraseWithAIParams)
|
|
2525
|
+
config: Object.assign({ preventTranscript, say }, rephraseWithAIParams)
|
|
2518
2526
|
});
|
|
2519
2527
|
if (config.type === "date" && !config.datepicker_hidePicker) {
|
|
2520
2528
|
showDatePicker(cognigy, config);
|
|
@@ -47,6 +47,13 @@ export const SAY = createNodeDescriptor({
|
|
|
47
47
|
],
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
|
+
{
|
|
51
|
+
key: "preventTranscript",
|
|
52
|
+
type: "toggle",
|
|
53
|
+
defaultValue: false,
|
|
54
|
+
label: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__LABEL",
|
|
55
|
+
description: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__DESCRIPTION",
|
|
56
|
+
},
|
|
50
57
|
...getRephraseWithAIFields(),
|
|
51
58
|
].filter(field => !!field),
|
|
52
59
|
sections: [
|
|
@@ -58,12 +65,21 @@ export const SAY = createNodeDescriptor({
|
|
|
58
65
|
fields: [
|
|
59
66
|
"handoverOutput",
|
|
60
67
|
]
|
|
61
|
-
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "advanced",
|
|
71
|
+
label: "UI__NODE_EDITOR__MESSAGE__SAY__SECTIONS__ADVANCED__LABEL",
|
|
72
|
+
defaultCollapsed: true,
|
|
73
|
+
fields: [
|
|
74
|
+
"preventTranscript",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
62
77
|
].filter(section => !!section),
|
|
63
78
|
form: [
|
|
64
79
|
{ type: "field", key: "say" },
|
|
65
80
|
{ type: "section", key: "aiEnhancedOutput" },
|
|
66
81
|
{ type: "section", key: "handoverSettings" },
|
|
82
|
+
{ type: "section", key: "advanced" }
|
|
67
83
|
],
|
|
68
84
|
preview: {
|
|
69
85
|
key: "say",
|
|
@@ -121,6 +137,9 @@ export const SAY = createNodeDescriptor({
|
|
|
121
137
|
if ((_a = _data === null || _data === void 0 ? void 0 : _data._cognigy) === null || _a === void 0 ? void 0 : _a._default) {
|
|
122
138
|
delete _data._cognigy._default;
|
|
123
139
|
}
|
|
140
|
+
if (config.preventTranscript) {
|
|
141
|
+
_data._cognigy = Object.assign(Object.assign({}, _data._cognigy), { _preventTranscript: true });
|
|
142
|
+
}
|
|
124
143
|
outputText = yield rephraseSentenceWithAI(outputText, config, api, organisationId);
|
|
125
144
|
yield api.say(outputText, _data, settings);
|
|
126
145
|
}
|
|
@@ -145,11 +164,15 @@ export const SAY = createNodeDescriptor({
|
|
|
145
164
|
else if ((_f = _cognigyDefault === null || _cognigyDefault === void 0 ? void 0 : _cognigyDefault[typeKey]) === null || _f === void 0 ? void 0 : _f.fallbackText) {
|
|
146
165
|
_cognigyDefault[typeKey].fallbackText = yield rephraseSentenceWithAI(_cognigyDefault[typeKey].fallbackText, config, api, organisationId);
|
|
147
166
|
}
|
|
167
|
+
const data = config.say;
|
|
168
|
+
if (config.preventTranscript) {
|
|
169
|
+
data._cognigy = Object.assign(Object.assign({}, data._cognigy), { _preventTranscript: true });
|
|
170
|
+
}
|
|
148
171
|
/**
|
|
149
172
|
* This is a say node which is set to a type other than 'text' -
|
|
150
173
|
* so we have one of the new rich-media types such as 'gallery'
|
|
151
174
|
*/
|
|
152
|
-
yield api.say(null,
|
|
175
|
+
yield api.say(null, data, settings);
|
|
153
176
|
}
|
|
154
177
|
}),
|
|
155
178
|
});
|
|
@@ -2,6 +2,7 @@ import { __awaiter } from "tslib";
|
|
|
2
2
|
/* Custom modules */
|
|
3
3
|
import { createNodeDescriptor } from "../../createNodeDescriptor";
|
|
4
4
|
import { GO_TO } from "../logic";
|
|
5
|
+
import { randomUUID } from 'crypto';
|
|
5
6
|
import { createLastConverationString, createLastConversationChatObject, createLastUserInputString, writeLLMDebugLogs } from "../nlu/generativeSlotFiller/prompt";
|
|
6
7
|
import { InternalServerError } from "../../../errors";
|
|
7
8
|
export const GPT_PROMPT = createNodeDescriptor({
|
|
@@ -624,6 +625,8 @@ export const GPT_PROMPT = createNodeDescriptor({
|
|
|
624
625
|
}
|
|
625
626
|
});
|
|
626
627
|
try {
|
|
628
|
+
const isStreamingChannel = input.channel === "webchat3" || input.channel === "adminconsole";
|
|
629
|
+
const _messageId = randomUUID();
|
|
627
630
|
const data = {
|
|
628
631
|
prompt,
|
|
629
632
|
temperature,
|
|
@@ -635,13 +638,18 @@ export const GPT_PROMPT = createNodeDescriptor({
|
|
|
635
638
|
useCase: "promptNode",
|
|
636
639
|
stream: storeLocation === "stream",
|
|
637
640
|
streamOnDataHandler: (text) => {
|
|
638
|
-
text = text
|
|
641
|
+
text = isStreamingChannel ? text : text.trim();
|
|
639
642
|
if (text) {
|
|
640
|
-
api.output(text,
|
|
643
|
+
api.output(text, {
|
|
644
|
+
_cognigy: {
|
|
645
|
+
_messageId,
|
|
646
|
+
}
|
|
647
|
+
});
|
|
641
648
|
}
|
|
642
649
|
},
|
|
643
650
|
streamStopTokens,
|
|
644
651
|
streamStopTokenOverrides,
|
|
652
|
+
preventNewLineRemoval: isStreamingChannel ? true : false,
|
|
645
653
|
// set to true in order to get token usage
|
|
646
654
|
detailedResults: true,
|
|
647
655
|
seed: Number(seed) ? Number(seed) : undefined,
|