@cognigy/rest-api-client 4.98.0 → 4.100.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/RestAPIClient.js +7 -0
- package/build/apigroups/AIOpsCenterAPIGroup_2_0.js +22 -0
- package/build/apigroups/ResourcesAPIGroup_2_0.js +11 -9
- package/build/apigroups/index.js +3 -1
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/knowledgeAssistTemplate.js +0 -44
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage0.js +0 -45
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage1.js +0 -43
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stageError.js +0 -45
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +6 -2
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/mistralProviderConnection.js +11 -0
- package/build/shared/charts/descriptors/index.js +7 -1
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +10 -1
- package/build/shared/charts/descriptors/service/GPTPrompt.js +14 -4
- package/build/shared/charts/descriptors/service/LLMEntityExtract.js +1 -1
- package/build/shared/charts/descriptors/service/LLMModerate.js +275 -0
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +185 -63
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobCallMCPTool.js +180 -0
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobMCPTool.js +196 -0
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentToolAnswer.js +5 -1
- package/build/shared/charts/descriptors/service/index.js +9 -1
- package/build/shared/charts/descriptors/service/niceCXOneAAHAuthenticationConnection.js +12 -0
- package/build/shared/charts/descriptors/voice/mappers/hangup.mapper.js +9 -8
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +9 -10
- package/build/shared/charts/descriptors/voice/nodes/hangup.js +1 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/hangup.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +24 -2
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +25 -5
- package/build/shared/interfaces/amqpInterface.js +3 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +10 -1
- package/build/shared/interfaces/messageAPI/endpoints.js +44 -119
- package/build/shared/interfaces/resources/IEndpoint.js +23 -4
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +10 -1
- package/build/shared/interfaces/resources/ISipConnectivityInfo.js +16 -0
- package/build/shared/interfaces/resources/IWebrtcWidgetConfig.js +11 -0
- package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IConversationCounterPreAggregatedValue_3_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterOrganisationRest_3_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterRest_3_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/alerts/IIndexOpsCenterAlertsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/alerts/IOpsCenterAlert.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/component/IOpsCenterComponents.js +34 -0
- package/build/shared/interfaces/restAPI/opsCenter/errors/IDeleteOpsCenterErrorRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/errors/IGetOpsCenterErrorRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/errors/IIndexOpsCenterErrorsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/errors/IOpsCenterError.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetrics.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetricsConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetricsRangeRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetricsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/metrics/IOpsCenterMetricsConfig.js +6 -0
- package/build/shared/interfaces/restAPI/opsCenter/observationConfig/IGetOpsCenterObservationConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/observationConfig/IOpsCenterObservationConfig.js +4 -0
- package/build/shared/interfaces/restAPI/opsCenter/observationConfig/IPatchOpsCenterObservationConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/observationConfig/ISetupOpsCenterObservationConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/security/IConversationCounterPreAggregatedValue.js +3 -0
- package/build/shared/interfaces/security/IIdentityProvider.js +1 -0
- package/build/shared/json-schema.js +2 -1
- package/dist/esm/RestAPIClient.js +7 -0
- package/dist/esm/apigroups/AIOpsCenterAPIGroup_2_0.js +18 -0
- package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +11 -9
- package/dist/esm/apigroups/index.js +1 -0
- package/dist/esm/shared/charts/descriptors/agentAssist/htmlTemplates/knowledgeAssistTemplate.js +0 -44
- package/dist/esm/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage0.js +0 -45
- package/dist/esm/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage1.js +0 -43
- package/dist/esm/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stageError.js +0 -45
- package/dist/esm/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +4 -1
- package/dist/esm/shared/charts/descriptors/connectionNodes/generativeAIProviders/mistralProviderConnection.js +8 -0
- package/dist/esm/shared/charts/descriptors/index.js +8 -2
- package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +12 -3
- package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +18 -8
- package/dist/esm/shared/charts/descriptors/service/LLMEntityExtract.js +1 -1
- package/dist/esm/shared/charts/descriptors/service/LLMModerate.js +273 -0
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +185 -63
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobCallMCPTool.js +178 -0
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobMCPTool.js +193 -0
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentToolAnswer.js +5 -1
- package/dist/esm/shared/charts/descriptors/service/index.js +4 -0
- package/dist/esm/shared/charts/descriptors/service/niceCXOneAAHAuthenticationConnection.js +9 -0
- package/dist/esm/shared/charts/descriptors/voice/mappers/hangup.mapper.js +9 -8
- package/dist/esm/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +9 -10
- package/dist/esm/shared/charts/descriptors/voice/nodes/hangup.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway/nodes/hangup.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/hangup.js +24 -2
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +25 -5
- package/dist/esm/shared/interfaces/amqpInterface.js +3 -0
- package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +10 -1
- package/dist/esm/shared/interfaces/messageAPI/endpoints.js +43 -118
- package/dist/esm/shared/interfaces/resources/IEndpoint.js +26 -7
- package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +9 -0
- package/dist/esm/shared/interfaces/resources/ISipConnectivityInfo.js +13 -0
- package/dist/esm/shared/interfaces/resources/IWebrtcWidgetConfig.js +8 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IConversationCounterPreAggregatedValue_3_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterOrganisationRest_3_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/IGetConversationCounterRest_3_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/conversationCounter/v3.0/index.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/alerts/IIndexOpsCenterAlertsRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/alerts/IOpsCenterAlert.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/component/IOpsCenterComponents.js +31 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/errors/IDeleteOpsCenterErrorRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/errors/IGetOpsCenterErrorRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/errors/IIndexOpsCenterErrorsRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/errors/IOpsCenterError.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetrics.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetricsConfigRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetricsRangeRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/metrics/IGetOpsCenterMetricsRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/metrics/IOpsCenterMetricsConfig.js +5 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/observationConfig/IGetOpsCenterObservationConfigRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/observationConfig/IOpsCenterObservationConfig.js +3 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/observationConfig/IPatchOpsCenterObservationConfigRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/observationConfig/ISetupOpsCenterObservationConfigRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/security/IConversationCounterPreAggregatedValue.js +2 -0
- package/dist/esm/shared/interfaces/security/IIdentityProvider.js +1 -0
- package/dist/esm/shared/json-schema.js +2 -1
- package/package.json +1 -1
- package/types/index.d.ts +392 -43
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_AGENT_JOB_CALL_MCP_TOOL = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
|
+
const transcripts_1 = require("../../../../interfaces/transcripts/transcripts");
|
|
7
|
+
exports.AI_AGENT_JOB_CALL_MCP_TOOL = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
8
|
+
type: "aiAgentJobCallMCPTool",
|
|
9
|
+
defaultLabel: "Call MCP Tool",
|
|
10
|
+
summary: "UI__NODE_EDITOR__SERVICE__AI_AGENT_CALL_MCP_TOOL__SUMMARY",
|
|
11
|
+
parentType: "",
|
|
12
|
+
tokens: [
|
|
13
|
+
{
|
|
14
|
+
type: "input",
|
|
15
|
+
label: "MCP Tool Result",
|
|
16
|
+
script: "input.aiAgent.toolResult",
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
fields: [
|
|
20
|
+
{
|
|
21
|
+
key: "storeLocation",
|
|
22
|
+
type: "select",
|
|
23
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STORE_LOCATION__LABEL",
|
|
24
|
+
defaultValue: "input",
|
|
25
|
+
params: {
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STORE_LOCATION__OPTIONS__INPUT__LABEL",
|
|
29
|
+
value: "input",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STORE_LOCATION__OPTIONS__CONTEXT__LABEL",
|
|
33
|
+
value: "context",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: "inputKey",
|
|
40
|
+
type: "cognigyText",
|
|
41
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__INPUT_KEY__LABEL",
|
|
42
|
+
defaultValue: "aiAgent.toolResult",
|
|
43
|
+
condition: {
|
|
44
|
+
key: "storeLocation",
|
|
45
|
+
value: "input",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "contextKey",
|
|
50
|
+
type: "cognigyText",
|
|
51
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__CONTEXT_KEY__LABEL",
|
|
52
|
+
defaultValue: "aiAgent.toolResult",
|
|
53
|
+
condition: {
|
|
54
|
+
key: "storeLocation",
|
|
55
|
+
value: "context",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "resolveImmediately",
|
|
60
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_CALL_MCP_TOOL__FIELDS__RESOLVE_IMMEDIATELY__LABEL",
|
|
61
|
+
type: "toggle",
|
|
62
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_CALL_MCP_TOOL__FIELDS__RESOLVE_IMMEDIATELY__DESCRIPTION",
|
|
63
|
+
defaultValue: false,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "debugToolResult",
|
|
67
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_CALL_MCP_TOOL__FIELDS__DEBUG_TOOL_RESULT__LABEL",
|
|
68
|
+
type: "toggle",
|
|
69
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_CALL_MCP_TOOL__FIELDS__DEBUG_TOOL_RESULT__DESCRIPTION",
|
|
70
|
+
defaultValue: false,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
sections: [
|
|
74
|
+
{
|
|
75
|
+
key: "storage",
|
|
76
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_CALL_MCP_TOOL__SECTIONS__STORAGE__LABEL",
|
|
77
|
+
defaultCollapsed: false,
|
|
78
|
+
fields: ["storeLocation", "inputKey", "contextKey"],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: "debugging",
|
|
82
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__SECTIONS__DEBUG_SETTINGS__LABEL",
|
|
83
|
+
defaultCollapsed: true,
|
|
84
|
+
fields: ["debugToolResult"],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
form: [
|
|
88
|
+
{ type: "field", key: "resolveImmediately" },
|
|
89
|
+
{ type: "section", key: "storage" },
|
|
90
|
+
{ type: "section", key: "debugging" },
|
|
91
|
+
],
|
|
92
|
+
appearance: {
|
|
93
|
+
color: "#252525",
|
|
94
|
+
},
|
|
95
|
+
tags: ["ai", "aiAgent"],
|
|
96
|
+
function: async ({ cognigy, config }) => {
|
|
97
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
98
|
+
const { api } = cognigy;
|
|
99
|
+
const { storeLocation, contextKey, inputKey, resolveImmediately, debugToolResult } = config;
|
|
100
|
+
const sessionState = await api.loadSessionState();
|
|
101
|
+
const toolCall = (_a = sessionState.lastToolCall) === null || _a === void 0 ? void 0 : _a.toolCall;
|
|
102
|
+
const aiAgentJobNode = (_b = sessionState.lastToolCall) === null || _b === void 0 ? void 0 : _b.aiAgentJobNode;
|
|
103
|
+
const mcpServerUrl = (_c = sessionState.lastToolCall) === null || _c === void 0 ? void 0 : _c.mcpServerUrl;
|
|
104
|
+
const timeout = (_d = sessionState.lastToolCall) === null || _d === void 0 ? void 0 : _d.timeout;
|
|
105
|
+
if (!(toolCall === null || toolCall === void 0 ? void 0 : toolCall.id)) {
|
|
106
|
+
(_e = api.logDebugError) === null || _e === void 0 ? void 0 : _e.call(api, "UI__DEBUG_MODE__AI_AGENT_ANSWER__ERROR__MESSAGE");
|
|
107
|
+
}
|
|
108
|
+
if (toolCall && aiAgentJobNode && mcpServerUrl && timeout) {
|
|
109
|
+
let toolResult = null;
|
|
110
|
+
let fullResult = null;
|
|
111
|
+
try {
|
|
112
|
+
toolResult = await api.executeMcpTool({
|
|
113
|
+
mcpServerUrl,
|
|
114
|
+
toolName: toolCall.function.name,
|
|
115
|
+
toolArgs: toolCall.function.arguments,
|
|
116
|
+
timeout,
|
|
117
|
+
});
|
|
118
|
+
fullResult = JSON.stringify(toolResult, null, 2);
|
|
119
|
+
if (debugToolResult) {
|
|
120
|
+
(_f = api.logDebugMessage) === null || _f === void 0 ? void 0 : _f.call(api, `Tool <b>${(_g = toolCall === null || toolCall === void 0 ? void 0 : toolCall.function) === null || _g === void 0 ? void 0 : _g.name}</b> called successfully.<br><br><b>Result:</b><br>${fullResult}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
const errorDetails = error instanceof Error
|
|
125
|
+
? {
|
|
126
|
+
name: error.name,
|
|
127
|
+
message: error.message,
|
|
128
|
+
}
|
|
129
|
+
: error;
|
|
130
|
+
(_h = api.logDebugError) === null || _h === void 0 ? void 0 : _h.call(api, `Failed to execute MCP Tool ${(_j = toolCall === null || toolCall === void 0 ? void 0 : toolCall.function) === null || _j === void 0 ? void 0 : _j.name}:<br>${JSON.stringify(errorDetails, null, 2)}`);
|
|
131
|
+
}
|
|
132
|
+
// Add result to Cognigy Input/Context for further usage
|
|
133
|
+
if (storeLocation === "context") {
|
|
134
|
+
(_k = api.addToContext) === null || _k === void 0 ? void 0 : _k.call(api, contextKey, toolResult, "simple");
|
|
135
|
+
}
|
|
136
|
+
else if (storeLocation === "input") {
|
|
137
|
+
api.addToInput(inputKey, toolResult);
|
|
138
|
+
}
|
|
139
|
+
const { flow, node } = aiAgentJobNode;
|
|
140
|
+
if (resolveImmediately && fullResult && flow && node) {
|
|
141
|
+
// Add Tool Call Message to Transcript
|
|
142
|
+
const toolCallTranscriptStep = {
|
|
143
|
+
role: transcripts_1.TranscriptRole.ASSISTANT,
|
|
144
|
+
type: transcripts_1.TranscriptEntryType.TOOL_CALL,
|
|
145
|
+
source: "system",
|
|
146
|
+
payload: {
|
|
147
|
+
name: toolCall.function.name,
|
|
148
|
+
id: toolCall.id,
|
|
149
|
+
input: toolCall.function.arguments,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
await api.addTranscriptStep(toolCallTranscriptStep);
|
|
153
|
+
// Add Tool Answer Message to Transcript
|
|
154
|
+
const toolAnswer = {
|
|
155
|
+
role: transcripts_1.TranscriptRole.TOOL,
|
|
156
|
+
type: transcripts_1.TranscriptEntryType.TOOL_ANSWER,
|
|
157
|
+
source: "system",
|
|
158
|
+
payload: {
|
|
159
|
+
toolCallId: toolCall.id,
|
|
160
|
+
content: fullResult,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
await api.addTranscriptStep(toolAnswer);
|
|
164
|
+
api.resetNextNodes();
|
|
165
|
+
// remove the call from the session state, because the call has been answered
|
|
166
|
+
api.updateSessionStateValues({
|
|
167
|
+
lastToolCall: undefined,
|
|
168
|
+
});
|
|
169
|
+
await api.executeFlow({
|
|
170
|
+
flowNode: {
|
|
171
|
+
flow,
|
|
172
|
+
node,
|
|
173
|
+
},
|
|
174
|
+
absorbContext: true,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
//# sourceMappingURL=aiAgentJobCallMCPTool.js.map
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_AGENT_JOB_MCP_TOOL = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
|
+
exports.AI_AGENT_JOB_MCP_TOOL = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
|
+
type: "aiAgentJobMCPTool",
|
|
8
|
+
defaultLabel: "MCP Tool",
|
|
9
|
+
summary: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__SUMMARY",
|
|
10
|
+
parentType: "aiAgentJob",
|
|
11
|
+
constraints: {
|
|
12
|
+
editable: true,
|
|
13
|
+
deletable: true,
|
|
14
|
+
collapsable: true,
|
|
15
|
+
creatable: true,
|
|
16
|
+
movable: true,
|
|
17
|
+
placement: {
|
|
18
|
+
predecessor: {
|
|
19
|
+
whitelist: [],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
childFlowCreatable: false,
|
|
23
|
+
},
|
|
24
|
+
preview: {
|
|
25
|
+
type: "text",
|
|
26
|
+
key: "name",
|
|
27
|
+
},
|
|
28
|
+
fields: [
|
|
29
|
+
{
|
|
30
|
+
type: "description",
|
|
31
|
+
key: "cachingWarning",
|
|
32
|
+
label: " ",
|
|
33
|
+
params: {
|
|
34
|
+
text: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__CACHING_WARNING__TEXT",
|
|
35
|
+
},
|
|
36
|
+
condition: {
|
|
37
|
+
key: "cacheTools",
|
|
38
|
+
value: false,
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "name",
|
|
43
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__NAME__LABEL",
|
|
44
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__NAME__DESCRIPTION",
|
|
45
|
+
type: "cognigyText",
|
|
46
|
+
params: {
|
|
47
|
+
required: true,
|
|
48
|
+
rows: 1,
|
|
49
|
+
multiline: false,
|
|
50
|
+
maxLength: 64,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "description",
|
|
55
|
+
key: "mcpWarning",
|
|
56
|
+
label: " ",
|
|
57
|
+
params: {
|
|
58
|
+
text: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__MCP_WARNING__TEXT",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: "mcpServerUrl",
|
|
63
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__MCP_SERVER_SSE_URL__LABEL",
|
|
64
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__MCP_SERVER_SSE_URL__DESCRIPTION",
|
|
65
|
+
type: "cognigyText",
|
|
66
|
+
params: {
|
|
67
|
+
required: true,
|
|
68
|
+
rows: 5,
|
|
69
|
+
multiline: true,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "timeout",
|
|
74
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__TIMEOUT__LABEL",
|
|
75
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__TIMEOUT__DESCRIPTION",
|
|
76
|
+
type: "slider",
|
|
77
|
+
defaultValue: 12,
|
|
78
|
+
params: {
|
|
79
|
+
min: 1,
|
|
80
|
+
max: 30,
|
|
81
|
+
step: 1,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: "debugMessageFetchedTools",
|
|
86
|
+
type: "toggle",
|
|
87
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__DEBUG_TOOLS__LABEL",
|
|
88
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__DEBUG_TOOLS__DESCRIPTION",
|
|
89
|
+
defaultValue: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
key: "debugMessageParameters",
|
|
93
|
+
type: "toggle",
|
|
94
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__DEBUG_PARAMETERS__LABEL",
|
|
95
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__DEBUG_PARAMETERS__DESCRIPTION",
|
|
96
|
+
defaultValue: false,
|
|
97
|
+
condition: {
|
|
98
|
+
key: "debugMessageFetchedTools",
|
|
99
|
+
value: true,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: "debugMessage",
|
|
104
|
+
type: "toggle",
|
|
105
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__DEBUG_MESSAGE__LABEL",
|
|
106
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__DEBUG_MESSAGE__DESCRIPTION",
|
|
107
|
+
defaultValue: true,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
key: "cacheTools",
|
|
111
|
+
type: "toggle",
|
|
112
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__CACHE_TOOLS__LABEL",
|
|
113
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__CACHE_TOOLS__DESCRIPTION",
|
|
114
|
+
defaultValue: true,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: "condition",
|
|
118
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__CONDITION__LABEL",
|
|
119
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_TOOL__FIELDS__CONDITION__DESCRIPTION",
|
|
120
|
+
type: "cognigyText",
|
|
121
|
+
defaultValue: "",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: "toolFilter",
|
|
125
|
+
type: "select",
|
|
126
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__TOOL_FILTER__LABEL",
|
|
127
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__TOOL_FILTER__DESCRIPTION",
|
|
128
|
+
defaultValue: "none",
|
|
129
|
+
params: {
|
|
130
|
+
options: [
|
|
131
|
+
{
|
|
132
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__TOOL_FILTER__OPTIONS__NONE__LABEL",
|
|
133
|
+
value: "none",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__TOOL_FILTER__OPTIONS__WHITELIST__LABEL",
|
|
137
|
+
value: "whitelist",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__TOOL_FILTER__OPTIONS__BLACKLIST__LABEL",
|
|
141
|
+
value: "blacklist",
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: "whitelist",
|
|
148
|
+
type: "cognigyTextArray",
|
|
149
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__WHITELIST__LABEL",
|
|
150
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__WHITELIST__DESCRIPTION",
|
|
151
|
+
condition: {
|
|
152
|
+
key: "toolFilter",
|
|
153
|
+
value: "whitelist",
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: "blacklist",
|
|
158
|
+
type: "cognigyTextArray",
|
|
159
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__BLACKLIST__LABEL",
|
|
160
|
+
description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_MCP_TOOL__FIELDS__BLACKLIST__DESCRIPTION",
|
|
161
|
+
condition: {
|
|
162
|
+
key: "toolFilter",
|
|
163
|
+
value: "blacklist",
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
sections: [
|
|
168
|
+
{
|
|
169
|
+
key: "debugging",
|
|
170
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__SECTIONS__DEBUG_SETTINGS__LABEL",
|
|
171
|
+
defaultCollapsed: true,
|
|
172
|
+
fields: ["debugMessageFetchedTools", "debugMessageParameters", "debugMessage"],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
key: "advanced",
|
|
176
|
+
label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__SECTIONS__ADVANCED__LABEL",
|
|
177
|
+
defaultCollapsed: true,
|
|
178
|
+
fields: ["cacheTools", "condition", "toolFilter", "whitelist", "blacklist"],
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
form: [
|
|
182
|
+
{ type: "field", key: "cachingWarning" },
|
|
183
|
+
{ type: "field", key: "name" },
|
|
184
|
+
{ type: "field", key: "mcpWarning" },
|
|
185
|
+
{ type: "field", key: "mcpServerUrl" },
|
|
186
|
+
{ type: "field", key: "timeout" },
|
|
187
|
+
{ type: "section", key: "debugging" },
|
|
188
|
+
{ type: "section", key: "advanced" },
|
|
189
|
+
],
|
|
190
|
+
appearance: {
|
|
191
|
+
color: "white",
|
|
192
|
+
textColor: "#252525",
|
|
193
|
+
variant: "mini",
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
//# sourceMappingURL=aiAgentJobMCPTool.js.map
|
|
@@ -58,7 +58,7 @@ exports.AI_AGENT_TOOL_ANSWER = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
58
58
|
},
|
|
59
59
|
tags: ["ai", "aiAgent"],
|
|
60
60
|
function: async ({ cognigy, config, nodeId: thisNodeId }) => {
|
|
61
|
-
var _a, _b, _c, _d, _e;
|
|
61
|
+
var _a, _b, _c, _d, _e, _f;
|
|
62
62
|
const { api, context } = cognigy;
|
|
63
63
|
const { answer, debugToolAnswer, } = config;
|
|
64
64
|
const sessionState = await api.loadSessionState();
|
|
@@ -90,6 +90,7 @@ exports.AI_AGENT_TOOL_ANSWER = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
90
90
|
source: "system",
|
|
91
91
|
payload: {
|
|
92
92
|
toolCallId: toolCall.id,
|
|
93
|
+
name: toolCall.function.name,
|
|
93
94
|
content: answer,
|
|
94
95
|
}
|
|
95
96
|
};
|
|
@@ -110,6 +111,9 @@ exports.AI_AGENT_TOOL_ANSWER = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
110
111
|
absorbContext: true,
|
|
111
112
|
});
|
|
112
113
|
}
|
|
114
|
+
else if (!answer) {
|
|
115
|
+
(_f = api.logDebugError) === null || _f === void 0 ? void 0 : _f.call(api, "UI__DEBUG_MODE__AI_AGENT_ANSWER__MISSING_ANSWER");
|
|
116
|
+
}
|
|
113
117
|
}
|
|
114
118
|
else {
|
|
115
119
|
throw new Error("Infinite Loop Detected");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GENESYS_CLOUD_CONNECTION_OM = exports.GENESYS_CLOUD_CONNECTION = exports.EIGHT_BY_EIGHT_CONNECTION = exports.CHATWOOT_CONNECTION = exports.RINGCENTRAL_ENGAGE_CONNECTION = exports.LIVE_AGENT_CONNECTION = exports.AI_AGENT_HANDOVER = exports.AI_AGENT_TOOL_ANSWER = exports.AI_AGENT_JOB_TOOL = exports.AI_AGENT_JOB_DEFAULT = exports.AI_AGENT_JOB = exports.LLM_ENTITY_EXTRACT = exports.GPT_CONVERSATION_SUMMARY = exports.GPT_CONVERSATION = exports.HANDOVER_INACTIVITY_TIMER = exports.CLOSE_HANDOVER = exports.GPT_PROMPT = exports.ON_SCHEDULING_ERROR = exports.ON_SCHEDULED = exports.TRIGGER_FUNCTION = exports.JWT_SECRET_CONNECTION = exports.HTTP_CONNECTION_OAUTH2 = exports.HTTP_CONNECTION_APIKEYXKEY = exports.HTTP_CONNECTION_APIKEYAUTHKEY = exports.HTTP_CONNECTION_BASIC = exports.HTTP_REQUEST = exports.CHECK_AGENT_AVAILABILITY = exports.HANDOVER_V2 = exports.HANDOVER = void 0;
|
|
3
|
+
exports.NICECXONEAAH_AUTHENTICATION_CONNECTION = exports.GENESYS_CLOUD_CONNECTION_OM = exports.GENESYS_CLOUD_CONNECTION = exports.EIGHT_BY_EIGHT_CONNECTION = exports.CHATWOOT_CONNECTION = exports.RINGCENTRAL_ENGAGE_CONNECTION = exports.LIVE_AGENT_CONNECTION = exports.AI_AGENT_JOB_CALL_MCP_TOOL = exports.AI_AGENT_HANDOVER = exports.AI_AGENT_TOOL_ANSWER = exports.AI_AGENT_JOB_MCP_TOOL = exports.AI_AGENT_JOB_TOOL = exports.AI_AGENT_JOB_DEFAULT = exports.AI_AGENT_JOB = exports.LLM_MODERATE = exports.LLM_ENTITY_EXTRACT = exports.GPT_CONVERSATION_SUMMARY = exports.GPT_CONVERSATION = exports.HANDOVER_INACTIVITY_TIMER = exports.CLOSE_HANDOVER = exports.GPT_PROMPT = exports.ON_SCHEDULING_ERROR = exports.ON_SCHEDULED = exports.TRIGGER_FUNCTION = exports.JWT_SECRET_CONNECTION = exports.HTTP_CONNECTION_OAUTH2 = exports.HTTP_CONNECTION_APIKEYXKEY = exports.HTTP_CONNECTION_APIKEYAUTHKEY = exports.HTTP_CONNECTION_BASIC = exports.HTTP_REQUEST = exports.CHECK_AGENT_AVAILABILITY = exports.HANDOVER_V2 = exports.HANDOVER = void 0;
|
|
4
4
|
var handover_1 = require("./handover");
|
|
5
5
|
Object.defineProperty(exports, "HANDOVER", { enumerable: true, get: function () { return handover_1.HANDOVER; } });
|
|
6
6
|
var handoverV2_1 = require("./handoverV2");
|
|
@@ -35,16 +35,22 @@ var conversationSummary_1 = require("./conversationSummary");
|
|
|
35
35
|
Object.defineProperty(exports, "GPT_CONVERSATION_SUMMARY", { enumerable: true, get: function () { return conversationSummary_1.GPT_CONVERSATION_SUMMARY; } });
|
|
36
36
|
var LLMEntityExtract_1 = require("./LLMEntityExtract");
|
|
37
37
|
Object.defineProperty(exports, "LLM_ENTITY_EXTRACT", { enumerable: true, get: function () { return LLMEntityExtract_1.LLM_ENTITY_EXTRACT; } });
|
|
38
|
+
var LLMModerate_1 = require("./LLMModerate");
|
|
39
|
+
Object.defineProperty(exports, "LLM_MODERATE", { enumerable: true, get: function () { return LLMModerate_1.LLM_MODERATE; } });
|
|
38
40
|
var aiAgentJob_1 = require("./aiAgent/aiAgentJob");
|
|
39
41
|
Object.defineProperty(exports, "AI_AGENT_JOB", { enumerable: true, get: function () { return aiAgentJob_1.AI_AGENT_JOB; } });
|
|
40
42
|
var aiAgentJobDefault_1 = require("./aiAgent/aiAgentJobDefault");
|
|
41
43
|
Object.defineProperty(exports, "AI_AGENT_JOB_DEFAULT", { enumerable: true, get: function () { return aiAgentJobDefault_1.AI_AGENT_JOB_DEFAULT; } });
|
|
42
44
|
var aiAgentJobTool_1 = require("./aiAgent/aiAgentJobTool");
|
|
43
45
|
Object.defineProperty(exports, "AI_AGENT_JOB_TOOL", { enumerable: true, get: function () { return aiAgentJobTool_1.AI_AGENT_JOB_TOOL; } });
|
|
46
|
+
var aiAgentJobMCPTool_1 = require("./aiAgent/aiAgentJobMCPTool");
|
|
47
|
+
Object.defineProperty(exports, "AI_AGENT_JOB_MCP_TOOL", { enumerable: true, get: function () { return aiAgentJobMCPTool_1.AI_AGENT_JOB_MCP_TOOL; } });
|
|
44
48
|
var aiAgentToolAnswer_1 = require("./aiAgent/aiAgentToolAnswer");
|
|
45
49
|
Object.defineProperty(exports, "AI_AGENT_TOOL_ANSWER", { enumerable: true, get: function () { return aiAgentToolAnswer_1.AI_AGENT_TOOL_ANSWER; } });
|
|
46
50
|
var aiAgentHandover_1 = require("./aiAgent/aiAgentHandover");
|
|
47
51
|
Object.defineProperty(exports, "AI_AGENT_HANDOVER", { enumerable: true, get: function () { return aiAgentHandover_1.AI_AGENT_HANDOVER; } });
|
|
52
|
+
var aiAgentJobCallMCPTool_1 = require("./aiAgent/aiAgentJobCallMCPTool");
|
|
53
|
+
Object.defineProperty(exports, "AI_AGENT_JOB_CALL_MCP_TOOL", { enumerable: true, get: function () { return aiAgentJobCallMCPTool_1.AI_AGENT_JOB_CALL_MCP_TOOL; } });
|
|
48
54
|
var handoverConnections_1 = require("./handoverConnections");
|
|
49
55
|
Object.defineProperty(exports, "LIVE_AGENT_CONNECTION", { enumerable: true, get: function () { return handoverConnections_1.LIVE_AGENT_CONNECTION; } });
|
|
50
56
|
Object.defineProperty(exports, "RINGCENTRAL_ENGAGE_CONNECTION", { enumerable: true, get: function () { return handoverConnections_1.RINGCENTRAL_ENGAGE_CONNECTION; } });
|
|
@@ -52,4 +58,6 @@ Object.defineProperty(exports, "CHATWOOT_CONNECTION", { enumerable: true, get: f
|
|
|
52
58
|
Object.defineProperty(exports, "EIGHT_BY_EIGHT_CONNECTION", { enumerable: true, get: function () { return handoverConnections_1.EIGHT_BY_EIGHT_CONNECTION; } });
|
|
53
59
|
Object.defineProperty(exports, "GENESYS_CLOUD_CONNECTION", { enumerable: true, get: function () { return handoverConnections_1.GENESYS_CLOUD_CONNECTION; } });
|
|
54
60
|
Object.defineProperty(exports, "GENESYS_CLOUD_CONNECTION_OM", { enumerable: true, get: function () { return handoverConnections_1.GENESYS_CLOUD_CONNECTION_OM; } });
|
|
61
|
+
var niceCXOneAAHAuthenticationConnection_1 = require("./niceCXOneAAHAuthenticationConnection");
|
|
62
|
+
Object.defineProperty(exports, "NICECXONEAAH_AUTHENTICATION_CONNECTION", { enumerable: true, get: function () { return niceCXOneAAHAuthenticationConnection_1.NICECXONEAAH_AUTHENTICATION_CONNECTION; } });
|
|
55
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NICECXONEAAH_AUTHENTICATION_CONNECTION = void 0;
|
|
4
|
+
/* JWT Secret Connection */
|
|
5
|
+
exports.NICECXONEAAH_AUTHENTICATION_CONNECTION = {
|
|
6
|
+
type: "niceCXOneAAHAuthentication",
|
|
7
|
+
label: "UI__CONNECTION_EDITOR__FIELD_NICECXONEAAH_AUTHENTICATION_APIKEY__LABEL",
|
|
8
|
+
fields: [
|
|
9
|
+
{ fieldName: "apiKey", label: "UI__CONNECTION_EDITOR__FIELD_API_KEY" },
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=niceCXOneAAHAuthenticationConnection.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hangUp = void 0;
|
|
4
4
|
exports.hangUp = {
|
|
5
|
-
handleInput(endpointType, hangUpReason) {
|
|
5
|
+
handleInput(endpointType, hangUpReason, hangupImmediately) {
|
|
6
6
|
switch (endpointType) {
|
|
7
7
|
case "bandwidth":
|
|
8
8
|
return this.handleBandwidthInput(hangUpReason);
|
|
@@ -10,23 +10,24 @@ exports.hangUp = {
|
|
|
10
10
|
return this.handleAudioCodesInput(hangUpReason);
|
|
11
11
|
case "voiceGateway2":
|
|
12
12
|
default:
|
|
13
|
-
return this.handleVGInput(hangUpReason);
|
|
13
|
+
return this.handleVGInput(hangupImmediately, hangUpReason);
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
handleVGInput(hangUpReason) {
|
|
16
|
+
handleVGInput(hangupImmediately, hangUpReason) {
|
|
17
17
|
const payload = {
|
|
18
18
|
_voiceGateway2: {
|
|
19
19
|
json: {
|
|
20
|
-
hangup: {
|
|
20
|
+
hangup: {
|
|
21
|
+
headers: {},
|
|
22
|
+
hangupImmediately
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
};
|
|
24
27
|
if (hangUpReason) {
|
|
25
|
-
payload._voiceGateway2.json.hangup = {
|
|
26
|
-
headers: {
|
|
28
|
+
payload._voiceGateway2.json.hangup = Object.assign(Object.assign({}, payload._voiceGateway2.json.hangup), { headers: {
|
|
27
29
|
"X-Reason": hangUpReason
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
+
} });
|
|
30
31
|
}
|
|
31
32
|
return payload;
|
|
32
33
|
},
|
|
@@ -182,7 +182,7 @@ class SessionConfigMapper extends base_mapper_1.BaseMapper {
|
|
|
182
182
|
buildRecognizer(sessionParams, stt, vad, azureConfig) {
|
|
183
183
|
var _a, _b, _c;
|
|
184
184
|
const { recognizer: sessionParamsRecognizer } = sessionParams || {};
|
|
185
|
-
const { vendor: spVendor, language: spLanguage, hints: spHints, label: spLabel, model: spModel, azureSttEndpointId: spAzureSttEndpointId, audioLogging: spAudioLogging, hintsBoost: spHintsBoost, punctuation: spPunctuation, altLanguages: spAltLanguages = [], deepgramOptions: spDeepgramOptions, vad: spVad } = sessionParamsRecognizer || {};
|
|
185
|
+
const { vendor: spVendor, language: spLanguage, hints: spHints, label: spLabel, model: spModel, azureSttEndpointId: spAzureSttEndpointId, audioLogging: spAudioLogging, hintsBoost: spHintsBoost, punctuation: spPunctuation, altLanguages: spAltLanguages = [], deepgramOptions: spDeepgramOptions, vad: spVad, profanityOption: spProfanityOption } = sessionParamsRecognizer || {};
|
|
186
186
|
const { sttVendor, sttLanguage, sttHints, sttLabel, sttHintsBoost, sttDisablePunctuation, googleModel, deepgramEndpointing, deepgramEndpointingValue, sttDeepgramModel, deepgramSmartFormatting, deepgramShortUtterance, altLanguages = [] } = stt || {};
|
|
187
187
|
const recognizer = {};
|
|
188
188
|
recognizer.language = spLanguage || sttLanguage || undefined;
|
|
@@ -196,6 +196,9 @@ class SessionConfigMapper extends base_mapper_1.BaseMapper {
|
|
|
196
196
|
recognizer.azureSttEndpointId = spAzureSttEndpointId || (azureConfig === null || azureConfig === void 0 ? void 0 : azureConfig.azureSttContextId) || "";
|
|
197
197
|
recognizer.audioLogging = spAudioLogging || (azureConfig === null || azureConfig === void 0 ? void 0 : azureConfig.azureEnableAudioLogging);
|
|
198
198
|
if (recognizer.vendor) {
|
|
199
|
+
if (recognizer.vendor === "microsoft") {
|
|
200
|
+
recognizer.profanityOption = spProfanityOption || (azureConfig === null || azureConfig === void 0 ? void 0 : azureConfig.azureProfanityOption) || "raw";
|
|
201
|
+
}
|
|
199
202
|
if (recognizer.vendor === "microsoft" || recognizer.vendor === "google") {
|
|
200
203
|
if (this.has(spAltLanguages)) {
|
|
201
204
|
recognizer.altLanguages = spAltLanguages;
|
|
@@ -359,6 +362,11 @@ function voiceConfigParamsToVoiceSettings(config, api) {
|
|
|
359
362
|
ttsLabel: config.ttsLabel,
|
|
360
363
|
};
|
|
361
364
|
if (config.sttVendor === "microsoft") {
|
|
365
|
+
voiceSettings.azureConfig = {
|
|
366
|
+
azureSttContextId: config.azureSttContextId ? config.azureSttContextId.trim() : undefined,
|
|
367
|
+
azureEnableAudioLogging: config.azureEnableAudioLogging || undefined,
|
|
368
|
+
azureProfanityOption: config.azureProfanityOption || "raw",
|
|
369
|
+
};
|
|
362
370
|
if (config.recognizeLanguagesAzure) {
|
|
363
371
|
voiceSettings.stt.altLanguages = [];
|
|
364
372
|
const languages = [config.sttAzureLang1, config.sttAzureLang2, config.sttAzureLang3];
|
|
@@ -453,15 +461,6 @@ function voiceConfigParamsToVoiceSettings(config, api) {
|
|
|
453
461
|
delete voiceSettings.continuousAsr.asrDigit;
|
|
454
462
|
}
|
|
455
463
|
}
|
|
456
|
-
// Azure configurations
|
|
457
|
-
if ((config.sttVendor === "microsoft" && config.azureSttContextId)) {
|
|
458
|
-
voiceSettings.azureConfig = {
|
|
459
|
-
azureSttContextId: config.azureSttContextId
|
|
460
|
-
? config.azureSttContextId.trim()
|
|
461
|
-
: undefined,
|
|
462
|
-
azureEnableAudioLogging: config.azureEnableAudioLogging || undefined
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
464
|
// atmosphere sounds
|
|
466
465
|
if (config.atmosphereAction) {
|
|
467
466
|
if ((_m = config.atmosphereUrl) === null || _m === void 0 ? void 0 : _m.length) {
|
|
@@ -34,7 +34,7 @@ exports.HANG_UP = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
34
34
|
const { hangupReason } = config;
|
|
35
35
|
const { endpointType } = input;
|
|
36
36
|
try {
|
|
37
|
-
const payload = hangup_mapper_1.hangUp.handleInput(endpointType, hangupReason);
|
|
37
|
+
const payload = hangup_mapper_1.hangUp.handleInput(endpointType, hangupReason, false);
|
|
38
38
|
await api.say(null, {
|
|
39
39
|
_cognigy: payload
|
|
40
40
|
});
|
|
@@ -37,7 +37,7 @@ exports.hangupNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
37
37
|
const { hangupReason } = config;
|
|
38
38
|
try {
|
|
39
39
|
const { isFeatureAccmEnabled } = api.getEndpointSettings();
|
|
40
|
-
const payload = isFeatureAccmEnabled ? (0, utils_1.buildPayloadAccm)("hangup", config, nodeId) : hangup_mapper_1.hangUp.handleInput("audioCodes", hangupReason);
|
|
40
|
+
const payload = isFeatureAccmEnabled ? (0, utils_1.buildPayloadAccm)("hangup", config, nodeId) : hangup_mapper_1.hangUp.handleInput("audioCodes", hangupReason, false);
|
|
41
41
|
await api.say(null, {
|
|
42
42
|
_cognigy: payload
|
|
43
43
|
});
|
|
@@ -27,13 +27,35 @@ exports.hangupNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
27
27
|
params: {
|
|
28
28
|
required: true
|
|
29
29
|
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: "hangupImmediately",
|
|
33
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__HANGUP__FIELDS__HANGUP_IMMEDIATELY__LABEL",
|
|
34
|
+
description: "UI__NODE_EDITOR__VOICEGATEWAY2__HANGUP__FIELDS__HANGUP_IMMEDIATELY__DESCRIPTION",
|
|
35
|
+
type: "toggle",
|
|
36
|
+
defaultValue: false,
|
|
37
|
+
params: {
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
30
40
|
}
|
|
31
41
|
],
|
|
42
|
+
sections: [
|
|
43
|
+
{
|
|
44
|
+
key: "advanced",
|
|
45
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__SECTIONS__ADVANCED__LABEL",
|
|
46
|
+
defaultCollapsed: true,
|
|
47
|
+
fields: ["hangupImmediately"]
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
form: [
|
|
51
|
+
{ "type": "field", "key": "hangupReason" },
|
|
52
|
+
{ "type": "section", "key": "advanced" },
|
|
53
|
+
],
|
|
32
54
|
function: async ({ cognigy, config }) => {
|
|
33
55
|
const { api } = cognigy;
|
|
34
|
-
const { hangupReason } = config;
|
|
56
|
+
const { hangupReason, hangupImmediately } = config;
|
|
35
57
|
try {
|
|
36
|
-
const payload = hangup_mapper_1.hangUp.handleInput("voiceGateway2", hangupReason);
|
|
58
|
+
const payload = hangup_mapper_1.hangUp.handleInput("voiceGateway2", hangupReason, hangupImmediately);
|
|
37
59
|
await api.say(null, {
|
|
38
60
|
_cognigy: payload
|
|
39
61
|
});
|
|
@@ -754,14 +754,33 @@ exports.voiceConfigFields = [
|
|
|
754
754
|
description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_ENABLE_AUDIO_LOGGING__DESCRIPTION",
|
|
755
755
|
defaultValue: false,
|
|
756
756
|
condition: {
|
|
757
|
-
|
|
757
|
+
key: "enableAdvancedSTTConfig",
|
|
758
|
+
value: true
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
key: "azureProfanityOption",
|
|
763
|
+
type: "select",
|
|
764
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__LABEL",
|
|
765
|
+
description: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__DESCRIPTION",
|
|
766
|
+
defaultValue: "raw",
|
|
767
|
+
condition: {
|
|
768
|
+
key: "enableAdvancedSTTConfig",
|
|
769
|
+
value: true
|
|
770
|
+
},
|
|
771
|
+
params: {
|
|
772
|
+
options: [
|
|
758
773
|
{
|
|
759
|
-
|
|
760
|
-
value:
|
|
774
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__RAW__LABEL",
|
|
775
|
+
value: "raw"
|
|
761
776
|
},
|
|
762
777
|
{
|
|
763
|
-
|
|
764
|
-
value: "
|
|
778
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__MASKED__LABEL",
|
|
779
|
+
value: "masked"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__SET_SESSION_CONFIG__AZURE_PROFANITY_OPTION__REMOVED__LABEL",
|
|
783
|
+
value: "removed"
|
|
765
784
|
}
|
|
766
785
|
]
|
|
767
786
|
}
|
|
@@ -965,6 +984,7 @@ exports.setSessionConfigNode = (0, createNodeDescriptor_1.createNodeDescriptor)(
|
|
|
965
984
|
"enableAdvancedSTTConfig",
|
|
966
985
|
"azureSttContextId",
|
|
967
986
|
"azureEnableAudioLogging",
|
|
987
|
+
"azureProfanityOption",
|
|
968
988
|
"recognizeLanguagesAzure",
|
|
969
989
|
"sttAzure",
|
|
970
990
|
"recognizeLanguagesGoogle",
|