@cognigy/rest-api-client 2025.11.0 → 2025.13.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/ResourcesAPIGroup_2_0.js +4 -0
- package/build/apigroups/SimulationAPIGroup_2_0.js +58 -0
- package/build/apigroups/index.js +3 -1
- package/build/shared/charts/descriptors/analytics/trackGoal.js +3 -1
- package/build/shared/charts/descriptors/index.js +7 -1
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +4 -2
- package/build/shared/charts/descriptors/message/question/question.js +24 -5
- package/build/shared/charts/descriptors/service/GPTPrompt.js +15 -1
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +32 -173
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobTool.js +2 -2
- package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +175 -0
- package/build/shared/charts/descriptors/service/aiAgent/loadAiAgent.js +194 -0
- package/build/shared/charts/descriptors/service/aiOpsCenterConnection.js +12 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +1 -1
- package/build/shared/charts/descriptors/service/index.js +13 -1
- package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +922 -0
- package/build/shared/charts/descriptors/service/llmPrompt/llmPromptDefault.js +31 -0
- package/build/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +196 -0
- package/build/shared/charts/descriptors/service/llmPrompt/llmPromptTool.js +139 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +2 -2
- package/build/shared/constants.js +1 -5
- package/build/shared/interfaces/debugEvents/IGoalCompletedEventPayload.js +3 -0
- package/build/shared/interfaces/debugEvents/TDebugEventType.js +1 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +12 -1
- package/build/shared/interfaces/resources/IAuditEvent.js +3 -0
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +1 -0
- package/build/shared/interfaces/resources/TResourceType.js +2 -0
- package/build/shared/interfaces/resources/TRestChannelType.js +5 -0
- package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +2 -1
- package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +5 -18
- package/build/shared/interfaces/restAPI/operations/generateOutput/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/opsCenter/observationConfig/IOpsCenterObservationConfig.js +1 -1
- package/build/shared/interfaces/restAPI/simulation/simulation/ICreateSimulationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulation/IDeleteSimulationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulation/IIndexSimulationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulation/IReadSimulationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulation/IScheduleSimulationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulation/ISimulationRest_2_0.js +9 -0
- package/build/shared/interfaces/restAPI/simulation/simulation/IUpdateSimulationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRun/IIndexSimulationRunRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRun/IReadSimulationRunRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRun/ISimulationRunRest_2_0.js +19 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IGetAllSimulationRunBatchRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IIndexSimulationRunBatchRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IReadSimulationRunBatchRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/ISimulationRunBatchRest_2_0.js +9 -0
- package/build/shared/interfaces/security/IPermission.js +2 -0
- package/build/shared/interfaces/security/IRole.js +3 -1
- package/build/shared/interfaces/security/index.js +1 -1
- package/dist/esm/RestAPIClient.js +7 -0
- package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +4 -0
- package/dist/esm/apigroups/SimulationAPIGroup_2_0.js +44 -0
- package/dist/esm/apigroups/index.js +1 -0
- package/dist/esm/shared/charts/descriptors/analytics/trackGoal.js +3 -1
- package/dist/esm/shared/charts/descriptors/index.js +8 -2
- package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +4 -2
- package/dist/esm/shared/charts/descriptors/message/question/question.js +24 -5
- package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +15 -1
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +33 -174
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobTool.js +2 -2
- package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +172 -0
- package/dist/esm/shared/charts/descriptors/service/aiAgent/loadAiAgent.js +192 -0
- package/dist/esm/shared/charts/descriptors/service/aiOpsCenterConnection.js +9 -0
- package/dist/esm/shared/charts/descriptors/service/handoverV2.js +1 -1
- package/dist/esm/shared/charts/descriptors/service/index.js +6 -0
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +909 -0
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptDefault.js +28 -0
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +193 -0
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptTool.js +136 -0
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +2 -2
- package/dist/esm/shared/constants.js +1 -5
- package/dist/esm/shared/interfaces/debugEvents/IGoalCompletedEventPayload.js +2 -0
- package/dist/esm/shared/interfaces/debugEvents/TDebugEventType.js +1 -0
- package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +12 -1
- package/dist/esm/shared/interfaces/resources/IAuditEvent.js +3 -0
- package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +1 -0
- package/dist/esm/shared/interfaces/resources/TResourceType.js +2 -0
- package/dist/esm/shared/interfaces/resources/TRestChannelType.js +5 -0
- package/dist/esm/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +2 -1
- package/dist/esm/shared/interfaces/resources/settings/IGenerativeAISettings.js +4 -17
- package/dist/esm/shared/interfaces/restAPI/operations/generateOutput/v2.0/index.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/opsCenter/observationConfig/IOpsCenterObservationConfig.js +1 -1
- package/dist/esm/shared/interfaces/restAPI/simulation/simulation/ICreateSimulationRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IDeleteSimulationRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IIndexSimulationRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IReadSimulationRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IScheduleSimulationRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulation/ISimulationRest_2_0.js +6 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulation/IUpdateSimulationRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRun/IIndexSimulationRunRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRun/IReadSimulationRunRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRun/ISimulationRunRest_2_0.js +16 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IGetAllSimulationRunBatchRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IIndexSimulationRunBatchRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IReadSimulationRunBatchRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/ISimulationRunBatchRest_2_0.js +6 -0
- package/dist/esm/shared/interfaces/security/IPermission.js +2 -0
- package/dist/esm/shared/interfaces/security/IRole.js +3 -1
- package/dist/esm/shared/interfaces/security/index.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +394 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
# 2025.13.0
|
|
2
|
+
Released: June 24th, 2025
|
|
3
|
+
|
|
4
|
+
Released state of package up to date with Cognigy.AI v2025.13.0
|
|
5
|
+
|
|
6
|
+
# 2025.12.0
|
|
7
|
+
Released: June 10th, 2025
|
|
8
|
+
|
|
9
|
+
Released state of package up to date with Cognigy.AI v2025.12.0
|
|
10
|
+
|
|
1
11
|
# 2025.11.0
|
|
2
12
|
Released: May 27th, 2025
|
|
3
13
|
|
package/build/RestAPIClient.js
CHANGED
|
@@ -18,6 +18,7 @@ const ResourcesAPIGroup_2_0_1 = require("./apigroups/ResourcesAPIGroup_2_0");
|
|
|
18
18
|
const SessionsAPIGroup_2_0_1 = require("./apigroups/SessionsAPIGroup_2_0");
|
|
19
19
|
const logger_1 = require("./shared/helper/logger");
|
|
20
20
|
const AIOpsCenterAPIGroup_2_0_1 = require("./apigroups/AIOpsCenterAPIGroup_2_0");
|
|
21
|
+
const SimulationAPIGroup_2_0_1 = require("./apigroups/SimulationAPIGroup_2_0");
|
|
21
22
|
exports.RestAPIClient = function (config) {
|
|
22
23
|
var _a;
|
|
23
24
|
if (!(this instanceof exports.RestAPIClient)) {
|
|
@@ -92,6 +93,12 @@ exports.RestAPIClient = function (config) {
|
|
|
92
93
|
plugins.push(AIOpsCenterAPIGroup_2_0_1.AIOpsCenterAPIGroup_2_0);
|
|
93
94
|
break;
|
|
94
95
|
}
|
|
96
|
+
switch (config.versions.simulation) {
|
|
97
|
+
default:
|
|
98
|
+
case "2.0":
|
|
99
|
+
plugins.push(SimulationAPIGroup_2_0_1.SimulationAPIGroup_2_0);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
95
102
|
const Client = PluginBase_1.Base.plugin(plugins);
|
|
96
103
|
Client.config = config;
|
|
97
104
|
Client.prototype.getHttpAdapter = () => {
|
|
@@ -628,6 +628,10 @@ const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
628
628
|
generateNluScores: (_a) => {
|
|
629
629
|
var { projectId } = _a, args = __rest(_a, ["projectId"]);
|
|
630
630
|
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/nlu/scores`, "POST", self)(args);
|
|
631
|
+
},
|
|
632
|
+
generateDesignTimeLLMOutput: (_a) => {
|
|
633
|
+
var { projectId } = _a, args = __rest(_a, ["projectId"]);
|
|
634
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/generate-output/design-time-llm`, "POST", self)(args);
|
|
631
635
|
}
|
|
632
636
|
};
|
|
633
637
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SimulationAPIGroup_2_0 = void 0;
|
|
15
|
+
const GenericAPIFn_1 = require("../GenericAPIFn");
|
|
16
|
+
const query_1 = require("../shared/helper/rest/query");
|
|
17
|
+
function SimulationAPIGroup_2_0(instance) {
|
|
18
|
+
const self = instance;
|
|
19
|
+
return {
|
|
20
|
+
indexSimulations: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options),
|
|
21
|
+
createSimulation: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/testing/beta/simulations", "POST", self)(args, options),
|
|
22
|
+
updateSimulation: (_a, options) => {
|
|
23
|
+
var { simulationReference, projectId } = _a, args = __rest(_a, ["simulationReference", "projectId"]);
|
|
24
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}?${(0, query_1.stringifyQuery)({
|
|
25
|
+
projectId
|
|
26
|
+
})}`, "PATCH", self)(args, options);
|
|
27
|
+
},
|
|
28
|
+
deleteSimulation: ({ simulationReference, projectId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}?${(0, query_1.stringifyQuery)({
|
|
29
|
+
projectId
|
|
30
|
+
})}`, "DELETE", self)(undefined, options),
|
|
31
|
+
readSimulation: ({ simulationReference, projectId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}?${(0, query_1.stringifyQuery)({
|
|
32
|
+
projectId
|
|
33
|
+
})}`, "GET", self)(undefined, options),
|
|
34
|
+
scheduleSimulation: (_a, options) => {
|
|
35
|
+
var { simulationReference } = _a, args = __rest(_a, ["simulationReference"]);
|
|
36
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/schedule`, "POST", self)(args, options);
|
|
37
|
+
},
|
|
38
|
+
indexSimulationRunBatches: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/batches?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options),
|
|
39
|
+
getAllSimulationRunBatches: (_a, options) => {
|
|
40
|
+
var { simulationReference } = _a, args = __rest(_a, ["simulationReference"]);
|
|
41
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/batches?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
|
|
42
|
+
},
|
|
43
|
+
readSimulationRunBatch: (_a, options) => {
|
|
44
|
+
var { simulationReference, simulationRunBatchReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference"]);
|
|
45
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
|
|
46
|
+
},
|
|
47
|
+
indexSimulationRuns: (_a, options) => {
|
|
48
|
+
var { simulationReference, simulationRunBatchReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference"]);
|
|
49
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}/runs?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
|
|
50
|
+
},
|
|
51
|
+
readSimulationRun: (_a, options) => {
|
|
52
|
+
var { simulationReference, simulationRunBatchReference, simulationRunReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference", "simulationRunReference"]);
|
|
53
|
+
return (0, GenericAPIFn_1.GenericAPIFn)(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}/runs/${simulationRunReference}?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.SimulationAPIGroup_2_0 = SimulationAPIGroup_2_0;
|
|
58
|
+
//# sourceMappingURL=SimulationAPIGroup_2_0.js.map
|
package/build/apigroups/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AIOpsCenterAPIGroup_2_0 = exports.AnalyticsAPIGroup_2_0 = exports.SessionsAPIGroup_2_0 = exports.ResourcesAPIGroup_2_0 = exports.ManagementAPIGroup_2_0 = exports.MetricsAPIGroup_2_0 = exports.JWTAuthAPIGroup_2_0 = exports.InsightsAPIGroup_2_0 = exports.ExternalAPIGroup_2_0 = exports.AdministrationAPIGroup_2_1 = exports.AdministrationAPIGroup_2_0 = void 0;
|
|
3
|
+
exports.SimulationAPIGroup_2_0 = exports.AIOpsCenterAPIGroup_2_0 = exports.AnalyticsAPIGroup_2_0 = exports.SessionsAPIGroup_2_0 = exports.ResourcesAPIGroup_2_0 = exports.ManagementAPIGroup_2_0 = exports.MetricsAPIGroup_2_0 = exports.JWTAuthAPIGroup_2_0 = exports.InsightsAPIGroup_2_0 = exports.ExternalAPIGroup_2_0 = exports.AdministrationAPIGroup_2_1 = exports.AdministrationAPIGroup_2_0 = void 0;
|
|
4
4
|
// AdministrationAPIGroup;
|
|
5
5
|
var AdministrationAPIGroup_2_0_1 = require("./AdministrationAPIGroup_2_0");
|
|
6
6
|
Object.defineProperty(exports, "AdministrationAPIGroup_2_0", { enumerable: true, get: function () { return AdministrationAPIGroup_2_0_1.AdministrationAPIGroup_2_0; } });
|
|
@@ -25,4 +25,6 @@ var AnalyticsAPIGroup_2_0_1 = require("./AnalyticsAPIGroup_2_0");
|
|
|
25
25
|
Object.defineProperty(exports, "AnalyticsAPIGroup_2_0", { enumerable: true, get: function () { return AnalyticsAPIGroup_2_0_1.AnalyticsAPIGroup_2_0; } });
|
|
26
26
|
var AIOpsCenterAPIGroup_2_0_1 = require("./AIOpsCenterAPIGroup_2_0");
|
|
27
27
|
Object.defineProperty(exports, "AIOpsCenterAPIGroup_2_0", { enumerable: true, get: function () { return AIOpsCenterAPIGroup_2_0_1.AIOpsCenterAPIGroup_2_0; } });
|
|
28
|
+
var SimulationAPIGroup_2_0_1 = require("./SimulationAPIGroup_2_0");
|
|
29
|
+
Object.defineProperty(exports, "SimulationAPIGroup_2_0", { enumerable: true, get: function () { return SimulationAPIGroup_2_0_1.SimulationAPIGroup_2_0; } });
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -47,7 +47,7 @@ exports.TRACK_GOAL = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
const sessionState = api.getSessionStateCopy();
|
|
50
|
-
const { selectedSteps, version, name, goalId, } = config.goal;
|
|
50
|
+
const { selectedSteps, referenceId, version, name, goalId, } = config.goal;
|
|
51
51
|
const activeCycleIds = ((_a = sessionState.analytics) === null || _a === void 0 ? void 0 : _a.goalCycleIds) || {};
|
|
52
52
|
let cycleId = activeCycleIds[goalId];
|
|
53
53
|
const hasStartStep = selectedSteps.some(step => step.type === "start");
|
|
@@ -75,10 +75,12 @@ exports.TRACK_GOAL = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
75
75
|
organisationId,
|
|
76
76
|
sessionId,
|
|
77
77
|
version,
|
|
78
|
+
referenceId,
|
|
78
79
|
timestamp: new Date(),
|
|
79
80
|
goalCycleId: cycleId,
|
|
80
81
|
goalId,
|
|
81
82
|
stepId: step.stepId,
|
|
83
|
+
stepType: step.type,
|
|
82
84
|
endpointUrlToken,
|
|
83
85
|
endpointName,
|
|
84
86
|
endpointType,
|
|
@@ -91,6 +91,10 @@ const nodes = [
|
|
|
91
91
|
service_1.CHECK_AGENT_AVAILABILITY,
|
|
92
92
|
service_1.HTTP_REQUEST,
|
|
93
93
|
service_1.GPT_PROMPT,
|
|
94
|
+
service_1.LLM_PROMPT_V2,
|
|
95
|
+
service_1.LLM_PROMPT_DEFAULT,
|
|
96
|
+
service_1.LLM_PROMPT_MCP_TOOL,
|
|
97
|
+
service_1.LLM_PROMPT_TOOL,
|
|
94
98
|
service_1.GPT_CONVERSATION,
|
|
95
99
|
service_1.GPT_CONVERSATION_SUMMARY,
|
|
96
100
|
service_1.LLM_ENTITY_EXTRACT,
|
|
@@ -146,6 +150,7 @@ if (process.env.DISABLE_FEATURE_TRANSCRIPT_MANAGER !== "true") {
|
|
|
146
150
|
nodes.push(service_1.AI_AGENT_JOB_CALL_MCP_TOOL);
|
|
147
151
|
nodes.push(service_1.AI_AGENT_TOOL_ANSWER);
|
|
148
152
|
nodes.push(service_1.AI_AGENT_HANDOVER);
|
|
153
|
+
nodes.push(service_1.LOAD_AI_AGENT);
|
|
149
154
|
}
|
|
150
155
|
if (process.env.FEATURE_USE_COGNIGY_LIVE_AGENT === "true") {
|
|
151
156
|
nodes.push(liveAgent_1.ASSIST_INFO);
|
|
@@ -167,7 +172,8 @@ exports.cognigyBasicModule = (0, createNodeDescriptor_1.createExtension)({
|
|
|
167
172
|
service_1.EIGHT_BY_EIGHT_CONNECTION,
|
|
168
173
|
service_1.GENESYS_CLOUD_CONNECTION,
|
|
169
174
|
service_1.GENESYS_CLOUD_CONNECTION_OM,
|
|
170
|
-
service_1.NICECXONEAAH_AUTHENTICATION_CONNECTION
|
|
175
|
+
service_1.NICECXONEAAH_AUTHENTICATION_CONNECTION,
|
|
176
|
+
service_1.AIOPS_CENTER_WEBHOOKS_CONNECTION,
|
|
171
177
|
],
|
|
172
178
|
});
|
|
173
179
|
var mongoDB_1 = require("./connectionNodes/mongoDB");
|
|
@@ -584,10 +584,12 @@ exports.SEARCH_EXTRACT_OUTPUT = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
584
584
|
// as it doesn't make sense to check for follow ups in the first execution
|
|
585
585
|
if (input.execution > 1) {
|
|
586
586
|
// always remember the last thing the user said (needed later)
|
|
587
|
-
lastRoundTrip = (_b = cognigy
|
|
587
|
+
lastRoundTrip = (_b = cognigy
|
|
588
|
+
.lastConversationEntries) === null || _b === void 0 ? void 0 : _b.slice(1, followUpDetectionSteps + 1).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
|
|
588
589
|
// if follow up detection is set to 2 or more, we use the conversation transcript
|
|
589
590
|
// as reference. Start at the second entry, because the first one is the current
|
|
590
|
-
const recentConversation = (_c = cognigy
|
|
591
|
+
const recentConversation = (_c = cognigy
|
|
592
|
+
.lastConversationEntries) === null || _c === void 0 ? void 0 : _c.slice(1, followUpDetectionSteps + 1).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
|
|
591
593
|
prompt = `Below is the transcript of a conversation:
|
|
592
594
|
${recentConversation}
|
|
593
595
|
USER: ${searchString}
|
|
@@ -309,7 +309,7 @@ exports.QUESTION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
309
309
|
},
|
|
310
310
|
{
|
|
311
311
|
key: "repromptLLMPrompt",
|
|
312
|
-
type: "
|
|
312
|
+
type: "cognigyLLMText",
|
|
313
313
|
label: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__REPROMPT_LLM_PROMPT__LABEL",
|
|
314
314
|
description: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__REPROMPT_LLM_PROMPT__DESCRIPTION",
|
|
315
315
|
defaultValue: `You are a chatbot that helps a user.
|
|
@@ -742,6 +742,17 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
742
742
|
},
|
|
743
743
|
defaultValue: true,
|
|
744
744
|
},
|
|
745
|
+
{
|
|
746
|
+
key: "escalateAnswersRepeatHandoverMessage",
|
|
747
|
+
type: "toggle",
|
|
748
|
+
label: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__ESCALATE_ANSWERS_REPEAT_HANDOVER_MESSAGE__LABEL",
|
|
749
|
+
description: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__ESCALATE_ANSWERS_REPEAT_HANDOVER_MESSAGE__DESCRIPTION",
|
|
750
|
+
defaultValue: false,
|
|
751
|
+
condition: {
|
|
752
|
+
key: "escalateAnswersAction",
|
|
753
|
+
value: "handover"
|
|
754
|
+
}
|
|
755
|
+
},
|
|
745
756
|
{
|
|
746
757
|
key: "escalateAnswersHandoverCancelIntent",
|
|
747
758
|
type: "cognigyText",
|
|
@@ -2409,6 +2420,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2409
2420
|
api.logDebugMessage(`UI__DEBUG_MODE__QUESTION__MESSAGE_5`, "Skipping Reprompt Message");
|
|
2410
2421
|
sayReprompt = false;
|
|
2411
2422
|
}
|
|
2423
|
+
let nodeType = "question";
|
|
2412
2424
|
// We will only output a reprompt if the user is not in the first execution
|
|
2413
2425
|
// and no skip condition is true
|
|
2414
2426
|
if ((validationMessage || repromptType) && !isFirstExecution && sayReprompt) {
|
|
@@ -2419,9 +2431,13 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2419
2431
|
rephraseWithAIParams.question = say.text[0];
|
|
2420
2432
|
rephraseWithAIParams.answer = input.text;
|
|
2421
2433
|
if (sayReprompt) {
|
|
2434
|
+
nodeType = "question.reprompt";
|
|
2422
2435
|
switch (repromptType) {
|
|
2423
2436
|
case "say":
|
|
2424
|
-
|
|
2437
|
+
if ((input === null || input === void 0 ? void 0 : input.channel) === "voiceGateway2" && !validationRepeat) {
|
|
2438
|
+
nodeType = "question";
|
|
2439
|
+
}
|
|
2440
|
+
await say_1.SAY.function(Object.assign({ nodeType, cognigy, childConfigs: [], nodeId, organisationId, config: { preventTranscript, say: repromptSay } }, rephraseWithAIParams));
|
|
2425
2441
|
break;
|
|
2426
2442
|
case "execute":
|
|
2427
2443
|
// if a question reprompt is set to execute flow and we have just executed
|
|
@@ -2470,11 +2486,14 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2470
2486
|
}
|
|
2471
2487
|
const repromptMessage = await api.runGenerativeAIPrompt(data, "gptPromptNode");
|
|
2472
2488
|
if (!repromptLLMStream) {
|
|
2473
|
-
await say_1.SAY.function({ nodeType
|
|
2489
|
+
await say_1.SAY.function({ nodeType, cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [repromptMessage] } }, rephraseWithAIParams) });
|
|
2474
2490
|
}
|
|
2475
2491
|
break;
|
|
2476
2492
|
default: // this is also "text"
|
|
2477
|
-
|
|
2493
|
+
if ((input === null || input === void 0 ? void 0 : input.channel) === "voiceGateway2" && !validationRepeat) {
|
|
2494
|
+
nodeType = "question";
|
|
2495
|
+
}
|
|
2496
|
+
await say_1.SAY.function({ nodeType, cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [validationMessage] } }, rephraseWithAIParams) });
|
|
2478
2497
|
}
|
|
2479
2498
|
}
|
|
2480
2499
|
/* If repeat toggle is on, also output question (and maybe datepicker) again */
|
|
@@ -2499,7 +2518,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
|
|
|
2499
2518
|
rephraseWithAIParams.promptType = "question";
|
|
2500
2519
|
rephraseWithAIParams.questionType = config.type;
|
|
2501
2520
|
await say_1.SAY.function({
|
|
2502
|
-
nodeType
|
|
2521
|
+
nodeType,
|
|
2503
2522
|
cognigy,
|
|
2504
2523
|
childConfigs: [],
|
|
2505
2524
|
nodeId,
|
|
@@ -7,9 +7,10 @@ const logic_1 = require("../logic");
|
|
|
7
7
|
const crypto_1 = require("crypto");
|
|
8
8
|
const prompt_1 = require("../nlu/generativeSlotFiller/prompt");
|
|
9
9
|
const errors_1 = require("../../../errors");
|
|
10
|
+
const transcripts_1 = require("../../../interfaces/transcripts/transcripts");
|
|
10
11
|
exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
11
12
|
type: "completeText",
|
|
12
|
-
defaultLabel: "LLM Prompt",
|
|
13
|
+
defaultLabel: "LLM Prompt (legacy)",
|
|
13
14
|
summary: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__DESCRIPTION",
|
|
14
15
|
fields: [
|
|
15
16
|
{
|
|
@@ -645,6 +646,7 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
645
646
|
api.output(text, {
|
|
646
647
|
_cognigy: {
|
|
647
648
|
_messageId,
|
|
649
|
+
_preventTranscript: true
|
|
648
650
|
}
|
|
649
651
|
});
|
|
650
652
|
}
|
|
@@ -702,6 +704,18 @@ exports.GPT_PROMPT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
702
704
|
const resultToOutput = typeof ((response === null || response === void 0 ? void 0 : response.result) || response) === "object" ? JSON.stringify((response === null || response === void 0 ? void 0 : response.result) || response, undefined, 2) : (response === null || response === void 0 ? void 0 : response.result) || response;
|
|
703
705
|
await api.output(resultToOutput, null);
|
|
704
706
|
}
|
|
707
|
+
else if (storeLocation === "stream") {
|
|
708
|
+
const transcriptContent = {
|
|
709
|
+
role: transcripts_1.TranscriptRole.ASSISTANT,
|
|
710
|
+
type: transcripts_1.TranscriptEntryType.OUTPUT,
|
|
711
|
+
source: "assistant",
|
|
712
|
+
payload: {
|
|
713
|
+
text: ((response === null || response === void 0 ? void 0 : response.result) || response),
|
|
714
|
+
data: {},
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
await api.addTranscriptStep(transcriptContent);
|
|
718
|
+
}
|
|
705
719
|
if (storeLocation === "stream" && responseToStore.finishReason) {
|
|
706
720
|
// send the finishReason as last output for a stream
|
|
707
721
|
(_a = api.output) === null || _a === void 0 ? void 0 : _a.call(api, "", {
|