@cognigy/rest-api-client 2025.15.1 → 2025.17.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 +15 -0
- package/build/apigroups/MetricsAPIGroup_2_0.js +10 -0
- package/build/apigroups/ResourcesAPIGroup_2_0.js +6 -0
- package/build/apigroups/SimulationAPIGroup_2_0.js +4 -0
- package/build/shared/charts/descriptors/data/debugMessage.js +13 -3
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +48 -49
- package/build/shared/charts/descriptors/logic/if/if.js +2 -2
- package/build/shared/charts/descriptors/logic/switch/switch.js +30 -21
- package/build/shared/charts/descriptors/message/question/question.js +3 -3
- package/build/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +2 -2
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/prompt.js +31 -2
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +40 -24
- package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +4 -4
- package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +36 -21
- package/build/shared/charts/descriptors/transcripts/addTranscriptStep.js +3 -3
- package/build/shared/charts/descriptors/transcripts/getTranscript.js +23 -3
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +3 -0
- package/build/shared/generativeAI/getPrompt.js +75 -0
- package/build/shared/generativeAI/utils/generativeAIPrompts.js +613 -0
- package/build/shared/generativeAI/utils/prompts/contextAwareUserQueryRephrasing.js +84 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +2 -0
- package/build/shared/interfaces/messageAPI/handover.js +6 -0
- package/build/shared/interfaces/resources/IGetAiAgentJobsTools.js +3 -0
- package/build/shared/interfaces/resources/IKnowledgeDescriptor.js +38 -5
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +16 -1
- package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/ICallCounterPreAggregatedValue_3_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterOrganisationRest_3_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterRest_3_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IAiAgentJobNodeWithTools_2_0.js +65 -0
- package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IGetAiAgentJobAndToolsRest_2_0 .js +4 -0
- package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/IIndexKnowledgeDescriptorsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/extension/IRunKnowledgeExtensionRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/index.js +16 -0
- package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IStopSimulationRunBatchRest_2_0.js +3 -0
- package/build/shared/interfaces/security/ICallCounterPreAggregatedValue.js +3 -0
- package/build/test.js +39 -0
- package/dist/esm/apigroups/MetricsAPIGroup_2_0.js +10 -0
- package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +6 -0
- package/dist/esm/apigroups/SimulationAPIGroup_2_0.js +4 -0
- package/dist/esm/shared/charts/descriptors/data/debugMessage.js +13 -3
- package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +48 -50
- package/dist/esm/shared/charts/descriptors/logic/if/if.js +2 -2
- package/dist/esm/shared/charts/descriptors/logic/switch/switch.js +30 -21
- package/dist/esm/shared/charts/descriptors/message/question/question.js +3 -3
- package/dist/esm/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +4 -3
- package/dist/esm/shared/charts/descriptors/nlu/generativeSlotFiller/prompt.js +29 -1
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +39 -23
- package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +4 -4
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +43 -28
- package/dist/esm/shared/charts/descriptors/transcripts/addTranscriptStep.js +3 -3
- package/dist/esm/shared/charts/descriptors/transcripts/getTranscript.js +23 -3
- package/dist/esm/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +3 -0
- package/dist/esm/shared/generativeAI/getPrompt.js +68 -0
- package/dist/esm/shared/generativeAI/utils/generativeAIPrompts.js +610 -0
- package/dist/esm/shared/generativeAI/utils/prompts/contextAwareUserQueryRephrasing.js +81 -0
- package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +2 -0
- package/dist/esm/shared/interfaces/messageAPI/handover.js +6 -0
- package/dist/esm/shared/interfaces/resources/IGetAiAgentJobsTools.js +2 -0
- package/dist/esm/shared/interfaces/resources/IKnowledgeDescriptor.js +37 -5
- package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +14 -0
- package/dist/esm/shared/interfaces/restAPI/management/authentication/ICreateJWTToken.js +1 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/ICallCounterPreAggregatedValue_3_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterOrganisationRest_3_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterRest_3_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/index.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/aiAgent/v2.0/IAiAgentJobNodeWithTools_2_0.js +65 -0
- package/dist/esm/shared/interfaces/restAPI/resources/aiAgent/v2.0/IGetAiAgentJobAndToolsRest_2_0 .js +3 -0
- package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/IIndexKnowledgeDescriptorsRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/extension/IRunKnowledgeExtensionRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/index.js +2 -1
- package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IStopSimulationRunBatchRest_2_0.js +2 -0
- package/dist/esm/shared/interfaces/security/ICallCounterPreAggregatedValue.js +2 -0
- package/dist/esm/test.js +39 -0
- package/package.json +1 -1
- package/types/index.d.ts +299 -42
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alternativeContextAwareUserQueryRephrasingChatPrompt = exports.contextAwareUserQueryRephrasingChatPrompt = void 0;
|
|
4
|
+
const contextAwareUserQueryRephrasingBasePrompt = `You are classifying and rephrasing user queries. Your rephrased user queries will be used as input for RAG and other LLM calls.
|
|
5
|
+
|
|
6
|
+
Instructions:
|
|
7
|
+
- Do not respond to the user query as in a real conversation.
|
|
8
|
+
- Determine whether the latest user query relates to the recent chat history.
|
|
9
|
+
- If it does, rephrase the latest user query, possibly including details from the previous chat history.
|
|
10
|
+
- If it does not, respond with "false".
|
|
11
|
+
|
|
12
|
+
What follows are some example conversations, followed last by the real conversation which you are working on.`;
|
|
13
|
+
const example1 = [
|
|
14
|
+
{ role: "user", content: "Hi, my name is Micheal. I'm looking for support regarding an issue." },
|
|
15
|
+
{ role: "assistant", content: "Great, let's get you connected with an agent. What is your customer ID?" },
|
|
16
|
+
{ role: "user", content: "My ID is S0-F45T" },
|
|
17
|
+
{ role: "assistant", content: "false" },
|
|
18
|
+
];
|
|
19
|
+
const example2 = [
|
|
20
|
+
{ role: "user", content: "The Toyota Proace City looks quite nice. I'm looking to fit a bunch of stuff in the car. How much capacity does it have?" },
|
|
21
|
+
{ role: "assistant", content: "There are two variants: L1 has 3,8 m3 loading volume and L2 has 4,4 m3 loading volume." },
|
|
22
|
+
{ role: "user", content: "And how much can I load?" },
|
|
23
|
+
{ role: "assistant", content: "What is the maximum payload and towing capacity of the Toyota Proace City?" },
|
|
24
|
+
];
|
|
25
|
+
const example3 = [
|
|
26
|
+
{ role: "user", content: "I am looking for a new smartphone." },
|
|
27
|
+
{ role: "assistant", content: "What features are you interested in?" },
|
|
28
|
+
{ role: "user", content: "I want a good camera and long battery life." },
|
|
29
|
+
{ role: "assistant", content: "Great! Are you looking for a specific brand or operating system, like Android or iOS?" },
|
|
30
|
+
{ role: "user", content: "I prefer Android devices." },
|
|
31
|
+
{ role: "assistant", content: "Do you have a budget in mind?" },
|
|
32
|
+
{ role: "user", content: "I would like to keep it under $800." },
|
|
33
|
+
{ role: "user", content: "Can you recommend a model?" },
|
|
34
|
+
{ role: "assistant", content: "Can you suggest an Android smartphone under $800 with a good camera and long battery life?" },
|
|
35
|
+
];
|
|
36
|
+
exports.contextAwareUserQueryRephrasingChatPrompt = [
|
|
37
|
+
{
|
|
38
|
+
role: "system",
|
|
39
|
+
content: contextAwareUserQueryRephrasingBasePrompt,
|
|
40
|
+
},
|
|
41
|
+
...example1,
|
|
42
|
+
...example2,
|
|
43
|
+
...example3,
|
|
44
|
+
];
|
|
45
|
+
const mapExampleToPrompt = (example) => {
|
|
46
|
+
return example.map(message => message.role === "user" ? `User: ${message.content}` : `Assistant: ${message.content}`).join("\n");
|
|
47
|
+
};
|
|
48
|
+
exports.alternativeContextAwareUserQueryRephrasingChatPrompt = [
|
|
49
|
+
{
|
|
50
|
+
role: "system",
|
|
51
|
+
content: `# Role and Objective
|
|
52
|
+
You are classifying and rephrasing user queries. Your rephrased user queries will be used as input for RAG and other LLM calls.
|
|
53
|
+
|
|
54
|
+
# Instructions
|
|
55
|
+
- Do not respond to the user query as in a real conversation.
|
|
56
|
+
- Determine whether the latest user query relates to the previous messages.
|
|
57
|
+
- If it does relate, rephrase the latest user query, possibly including details from the previous messages.
|
|
58
|
+
- If it does not relate, respond with "false".
|
|
59
|
+
|
|
60
|
+
## Rephrasing
|
|
61
|
+
- View the previous messages and look at related context in the immediate past.
|
|
62
|
+
- Pull relevant context from those messages and include them in the rephrased user query.
|
|
63
|
+
- Such context include, but is not limited to, user or product information, names, and dates.
|
|
64
|
+
|
|
65
|
+
# Output Format
|
|
66
|
+
- Rephrased user query
|
|
67
|
+
- or false, if unrelated to the previous messages
|
|
68
|
+
|
|
69
|
+
# Examples
|
|
70
|
+
|
|
71
|
+
## Example 1
|
|
72
|
+
${mapExampleToPrompt(example1)}
|
|
73
|
+
|
|
74
|
+
## Example 2
|
|
75
|
+
${mapExampleToPrompt(example2)}
|
|
76
|
+
|
|
77
|
+
## Example 3
|
|
78
|
+
${mapExampleToPrompt(example3)}
|
|
79
|
+
|
|
80
|
+
# Final instructions and prompt to think step by step
|
|
81
|
+
- Let’s think step-by-step.`,
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
//# sourceMappingURL=contextAwareUserQueryRephrasing.js.map
|
|
@@ -36,6 +36,7 @@ exports.generativeAIModels = [
|
|
|
36
36
|
"claude-sonnet-4-0",
|
|
37
37
|
"text-bison@001",
|
|
38
38
|
"custom-model",
|
|
39
|
+
"custom-embedding-model",
|
|
39
40
|
"gemini-1.0-pro",
|
|
40
41
|
"gemini-1.5-pro",
|
|
41
42
|
"gemini-1.5-flash",
|
|
@@ -53,6 +54,7 @@ exports.generativeAIModels = [
|
|
|
53
54
|
"pixtral-large-latest",
|
|
54
55
|
"mistral-medium-latest",
|
|
55
56
|
"mistral-small-latest",
|
|
57
|
+
"text-davinci-003",
|
|
56
58
|
...exports.embeddingModels,
|
|
57
59
|
];
|
|
58
60
|
exports.generativeAIProviders = [
|
|
@@ -133,6 +133,12 @@ exports.createHandoverRequestDataSchema = {
|
|
|
133
133
|
enableHandoverConnectMessageRingCentralEngage: {
|
|
134
134
|
type: "boolean"
|
|
135
135
|
},
|
|
136
|
+
enableHandoverDisconnectMessageSalesforceMIAW: {
|
|
137
|
+
type: "boolean"
|
|
138
|
+
},
|
|
139
|
+
enableHandoverConnectMessageSalesforceMIAW: {
|
|
140
|
+
type: "boolean"
|
|
141
|
+
},
|
|
136
142
|
"notifySessionId": {
|
|
137
143
|
"type": "string",
|
|
138
144
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.knowledgeDescriptorSchema = exports.knowledgeFieldSchema = exports.knowledgeFieldTypes = void 0;
|
|
3
|
+
exports.buildConfigValidationSchema = exports.knowledgeDescriptorSchema = exports.knowledgeFieldSchema = exports.knowledgeFieldTypes = void 0;
|
|
4
4
|
const INodeDescriptorSet_1 = require("./INodeDescriptorSet");
|
|
5
5
|
exports.knowledgeFieldTypes = [
|
|
6
6
|
"text",
|
|
@@ -20,13 +20,13 @@ exports.knowledgeFieldTypes = [
|
|
|
20
20
|
"daterange",
|
|
21
21
|
"connection",
|
|
22
22
|
"condition",
|
|
23
|
-
"description"
|
|
23
|
+
"description"
|
|
24
24
|
];
|
|
25
25
|
exports.knowledgeFieldSchema = {
|
|
26
26
|
title: "knowledgeFieldSchema",
|
|
27
27
|
type: "object",
|
|
28
28
|
additionalProperties: false,
|
|
29
|
-
properties: Object.assign(Object.assign({}, INodeDescriptorSet_1.nodeFieldSchema.properties), { type: { type: "string", enum: [...exports.knowledgeFieldTypes] }, key: { type: "string", minLength: 1, maxLength: 200 } })
|
|
29
|
+
properties: Object.assign(Object.assign({}, INodeDescriptorSet_1.nodeFieldSchema.properties), { type: { type: "string", enum: [...exports.knowledgeFieldTypes] }, key: { type: "string", minLength: 1, maxLength: 200 } })
|
|
30
30
|
};
|
|
31
31
|
const { type, summary, defaultLabel, sections, form } = INodeDescriptorSet_1.nodeDescriptorSchema.properties;
|
|
32
32
|
exports.knowledgeDescriptorSchema = {
|
|
@@ -39,7 +39,40 @@ exports.knowledgeDescriptorSchema = {
|
|
|
39
39
|
summary,
|
|
40
40
|
sections,
|
|
41
41
|
form,
|
|
42
|
-
fields: { type: "array", items: exports.knowledgeFieldSchema }
|
|
43
|
-
}
|
|
42
|
+
fields: { type: "array", items: exports.knowledgeFieldSchema }
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const filterNonConfigFields = ({ type }) => !["description"].includes(type);
|
|
46
|
+
const buildConfigValidationSchema = (fields) => ({
|
|
47
|
+
type: "object",
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
required: (fields || []).filter(filterNonConfigFields).map(({ key }) => key),
|
|
50
|
+
properties: Object.assign({}, (fields || []).filter(filterNonConfigFields).reduce((result, field) => (Object.assign(Object.assign({}, result), { [field.key]: mapFieldToSchema(field) })), {}))
|
|
51
|
+
});
|
|
52
|
+
exports.buildConfigValidationSchema = buildConfigValidationSchema;
|
|
53
|
+
const mapFieldToSchema = ({ type, params }) => {
|
|
54
|
+
switch (type) {
|
|
55
|
+
case "checkbox":
|
|
56
|
+
case "toggle":
|
|
57
|
+
return { type: "boolean" };
|
|
58
|
+
case "number":
|
|
59
|
+
case "slider":
|
|
60
|
+
return { type: "number" };
|
|
61
|
+
case "textArray":
|
|
62
|
+
return {
|
|
63
|
+
type: "array",
|
|
64
|
+
minLength: (params === null || params === void 0 ? void 0 : params.required) ? 1 : 0
|
|
65
|
+
};
|
|
66
|
+
case "json":
|
|
67
|
+
return {
|
|
68
|
+
type: ["object", "array"],
|
|
69
|
+
additionalProperties: true
|
|
70
|
+
};
|
|
71
|
+
default:
|
|
72
|
+
return {
|
|
73
|
+
type: "string",
|
|
74
|
+
minLength: (params === null || params === void 0 ? void 0 : params.required) ? 1 : 0
|
|
75
|
+
};
|
|
76
|
+
}
|
|
44
77
|
};
|
|
45
78
|
//# sourceMappingURL=IKnowledgeDescriptor.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.largeLanguageModelQuerySchema = exports.largeLanguageModelSchema = exports.largeLanguageModelDataSchema = exports.llmFallbackSchema = exports.googleGeminiMetaSchema = exports.googleVertexAIMetaSchema = exports.azureOpenAIMetaSchema = exports.openAICompatibleMetaSchema = exports.openAIMetaSchema = exports.alephAlphaMetaSchema = exports.awsBedrockMetaSchema = exports.mistralMetaSchema = exports.anthropicMetaSchema = void 0;
|
|
3
|
+
exports.isIGraphLargeLanguageModel = exports.largeLanguageModelQuerySchema = exports.largeLanguageModelSchema = exports.largeLanguageModelDataSchema = exports.llmFallbackSchema = exports.googleGeminiMetaSchema = exports.googleVertexAIMetaSchema = exports.azureOpenAIMetaSchema = exports.openAICompatibleMetaSchema = exports.openAIMetaSchema = exports.alephAlphaMetaSchema = exports.awsBedrockMetaSchema = exports.mistralMetaSchema = exports.anthropicMetaSchema = void 0;
|
|
4
4
|
/* Custom Modules */
|
|
5
5
|
const createQuerySchema_1 = require("../../helper/createQuerySchema");
|
|
6
6
|
const IEntityMeta_1 = require("./IEntityMeta");
|
|
@@ -57,6 +57,7 @@ exports.openAICompatibleMetaSchema = {
|
|
|
57
57
|
customModel: { type: "string" },
|
|
58
58
|
baseCustomUrl: { type: "string" },
|
|
59
59
|
customAuthHeader: { type: "string" },
|
|
60
|
+
embeddingVectorSize: { type: "number" },
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
exports.azureOpenAIMetaSchema = {
|
|
@@ -162,4 +163,18 @@ exports.largeLanguageModelSchema = {
|
|
|
162
163
|
properties: Object.assign(Object.assign(Object.assign({}, exports.largeLanguageModelDataSchema.properties), IEntityMeta_1.entityMetaSchema.properties), { projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" } })
|
|
163
164
|
};
|
|
164
165
|
exports.largeLanguageModelQuerySchema = (0, createQuerySchema_1.createQuerySchema)("largeLanguageModelQuerySchema", exports.largeLanguageModelSchema);
|
|
166
|
+
const isIGraphLargeLanguageModel = (resource) => {
|
|
167
|
+
return (resource &&
|
|
168
|
+
resource.type === "largeLanguageModel" &&
|
|
169
|
+
resource._id &&
|
|
170
|
+
resource.name &&
|
|
171
|
+
resource.referenceId &&
|
|
172
|
+
resource.properties &&
|
|
173
|
+
resource.properties.modelType &&
|
|
174
|
+
resource.properties.createdAt &&
|
|
175
|
+
resource.properties.createdBy &&
|
|
176
|
+
resource.properties.lastChanged &&
|
|
177
|
+
resource.properties.lastChangedBy);
|
|
178
|
+
};
|
|
179
|
+
exports.isIGraphLargeLanguageModel = isIGraphLargeLanguageModel;
|
|
165
180
|
//# sourceMappingURL=ILargeLanguageModel.js.map
|
package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IAiAgentJobNodeWithTools_2_0.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @openapi
|
|
3
|
+
* components:
|
|
4
|
+
* schemas:
|
|
5
|
+
* IAiAgentJobNodeWithTools_2_0:
|
|
6
|
+
* type: object
|
|
7
|
+
* properties:
|
|
8
|
+
* _id:
|
|
9
|
+
* type: string
|
|
10
|
+
* referenceId:
|
|
11
|
+
* type: string
|
|
12
|
+
* type:
|
|
13
|
+
* type: string
|
|
14
|
+
* example: "aiAgentJob"
|
|
15
|
+
* label:
|
|
16
|
+
* type: string
|
|
17
|
+
* comment:
|
|
18
|
+
* type: string
|
|
19
|
+
* commentColor:
|
|
20
|
+
* type: string
|
|
21
|
+
* analyticsLabel:
|
|
22
|
+
* type: string
|
|
23
|
+
* nullable: true
|
|
24
|
+
* isDisabled:
|
|
25
|
+
* type: boolean
|
|
26
|
+
* isEntryPoint:
|
|
27
|
+
* type: boolean
|
|
28
|
+
* extension:
|
|
29
|
+
* type: string
|
|
30
|
+
* config:
|
|
31
|
+
* type: object
|
|
32
|
+
* description: Job node configuration (content varies by implementation)
|
|
33
|
+
* tools:
|
|
34
|
+
* type: array
|
|
35
|
+
* items:
|
|
36
|
+
* $ref: '#/components/schemas/IAiAgentJobToolNode_2_0'
|
|
37
|
+
* IAiAgentJobToolNode_2_0:
|
|
38
|
+
* type: object
|
|
39
|
+
* properties:
|
|
40
|
+
* _id:
|
|
41
|
+
* type: string
|
|
42
|
+
* referenceId:
|
|
43
|
+
* type: string
|
|
44
|
+
* type:
|
|
45
|
+
* type: string
|
|
46
|
+
* label:
|
|
47
|
+
* type: string
|
|
48
|
+
* comment:
|
|
49
|
+
* type: string
|
|
50
|
+
* commentColor:
|
|
51
|
+
* type: string
|
|
52
|
+
* analyticsLabel:
|
|
53
|
+
* type: string
|
|
54
|
+
* nullable: true
|
|
55
|
+
* isDisabled:
|
|
56
|
+
* type: boolean
|
|
57
|
+
* isEntryPoint:
|
|
58
|
+
* type: boolean
|
|
59
|
+
* extension:
|
|
60
|
+
* type: string
|
|
61
|
+
* config:
|
|
62
|
+
* type: object
|
|
63
|
+
* description: Tool node configuration (content varies by tool type)
|
|
64
|
+
*/
|
|
65
|
+
//# sourceMappingURL=IAiAgentJobNodeWithTools_2_0.js.map
|
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IIndexKnowledgeDescriptorsRest_2_0"), exports);
|
|
18
|
+
__exportStar(require("./extension/IRunKnowledgeExtensionRest_2_0"), exports);
|
|
3
19
|
//# sourceMappingURL=index.js.map
|
package/build/test.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* import { RestAPIClient, TRestAPIClient } from "./RestAPIClient";
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
const FormData = require("form-data");
|
|
4
|
+
|
|
5
|
+
const OAUTH_CLIENT_ID = "cognigy-ui";
|
|
6
|
+
const OAUTH_CLIENT_SECRET =
|
|
7
|
+
"KR7yxR3rAhZ9sEn923dZ5KeNs9SVuwBjHxXKpmqtvSNXw5xWz35Y5YRtTBt96Jaa";
|
|
8
|
+
const baseUrl = "https://api.test";
|
|
9
|
+
|
|
10
|
+
const instance = new RestAPIClient({
|
|
11
|
+
numberOfRetries: 2,
|
|
12
|
+
baseUrl,
|
|
13
|
+
versions: {
|
|
14
|
+
administration: "2.0",
|
|
15
|
+
external: "2.0",
|
|
16
|
+
metrics: "2.0",
|
|
17
|
+
resources: "2.0",
|
|
18
|
+
sessions: "2.0"
|
|
19
|
+
},
|
|
20
|
+
timeout: 10000
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
(async () => {
|
|
24
|
+
|
|
25
|
+
const base64SnapshotString = fs.readFileSync('./src/IDE/fixtures/snapshots/overrideSnapshotConnections_project.csnap')
|
|
26
|
+
const form = new FormData();
|
|
27
|
+
|
|
28
|
+
form.append("projectId", projectId);
|
|
29
|
+
form.append("file", base64SnapshotString, "snapshot.csnap");
|
|
30
|
+
|
|
31
|
+
const slot = await instance.uploadExtension({
|
|
32
|
+
projectId: "your-project-id"
|
|
33
|
+
fs.readFileSync('./src/IDE/fixtures/snapshots/overrideSnapshotConnections_project.csnap'),
|
|
34
|
+
user: "your-user-id",
|
|
35
|
+
});
|
|
36
|
+
console.log(slot);
|
|
37
|
+
})();
|
|
38
|
+
*/
|
|
39
|
+
//# sourceMappingURL=test.js.map
|
|
@@ -51,6 +51,16 @@ export function MetricsAPIGroup_2_0(instance) {
|
|
|
51
51
|
return GenericAPIFn(`/new/v2.0/projects/${projectId}/conversationcounter?${stringifyQuery(args)}`, "GET", self)(undefined, options);
|
|
52
52
|
},
|
|
53
53
|
getConversationCounterOrganisation: (args, options) => GenericAPIFn(`/new/v2.0/conversationcounter?${stringifyQuery(args)}`, "GET", self)(undefined, options),
|
|
54
|
+
getPreAggregatedConversationCounter: (_a, options) => {
|
|
55
|
+
var { projectId } = _a, args = __rest(_a, ["projectId"]);
|
|
56
|
+
return GenericAPIFn(`/new/v3.0/projects/${projectId}/conversationcounter?${stringifyQuery(args)}`, "GET", self)(undefined, options);
|
|
57
|
+
},
|
|
58
|
+
getPreAggregatedConversationCounterOrganisation: (args, options) => GenericAPIFn(`/new/v3.0/conversationcounter?${stringifyQuery(args)}`, "GET", self)(undefined, options),
|
|
59
|
+
getPreAggregatedCallCounter: (_a, options) => {
|
|
60
|
+
var { projectId } = _a, args = __rest(_a, ["projectId"]);
|
|
61
|
+
return GenericAPIFn(`/new/v3.0/projects/${projectId}/callcounter?${stringifyQuery(args)}`, "GET", self)(undefined, options);
|
|
62
|
+
},
|
|
63
|
+
getPreAggregatedCallCounterOrganisation: (args, options) => GenericAPIFn(`/new/v3.0/callcounter?${stringifyQuery(args)}`, "GET", self)(undefined, options),
|
|
54
64
|
getKnowledgeQueryCounter: (_a, options) => {
|
|
55
65
|
var { projectId } = _a, args = __rest(_a, ["projectId"]);
|
|
56
66
|
return GenericAPIFn(`/new/v2.0/projects/${projectId}/knowledgequerycounter?${stringifyQuery(args)}`, "GET", self)(undefined, options);
|
|
@@ -546,6 +546,7 @@ export const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
546
546
|
validateAiAgentName: (args, options) => GenericAPIFn("/new/v2.0/aiagents/validatename", "POST", self)(args, options),
|
|
547
547
|
getAiAgentHiringTemplates: (args, options) => GenericAPIFn("/new/v2.0/aiagents/hire/templates", "GET", self)(args, options),
|
|
548
548
|
hireAiAgent: (args, options) => GenericAPIFn("/new/v2.0/aiagents/hire", "POST", self)(args, options),
|
|
549
|
+
getAiAgentJobsAndTools: ({ aiAgentId }, options) => GenericAPIFn(`/new/v2.0/aiagents/${aiAgentId}/jobs`, "GET", self)(undefined, options),
|
|
549
550
|
generateNodeOutput(_a, options) {
|
|
550
551
|
var { flowId } = _a, args = __rest(_a, ["flowId"]);
|
|
551
552
|
return GenericAPIFn(`/new/v2.0/flows/${flowId}/chart/nodes/output/generate`, "POST", self)(args, options);
|
|
@@ -578,6 +579,11 @@ export const ResourcesAPIGroup_2_0 = (instance) => {
|
|
|
578
579
|
var { knowledgeStoreId } = _a, args = __rest(_a, ["knowledgeStoreId"]);
|
|
579
580
|
return GenericAPIFn(`/new/v2.0/knowledgestores/${knowledgeStoreId}`, "PATCH", self)(args, options);
|
|
580
581
|
},
|
|
582
|
+
runKnowledgeExtension: (_a, options) => {
|
|
583
|
+
var { knowledgeStoreId } = _a, args = __rest(_a, ["knowledgeStoreId"]);
|
|
584
|
+
return GenericAPIFn(`/new/v2.0/knowledgestores/${knowledgeStoreId}/extensions/run`, "POST", self)(args, options);
|
|
585
|
+
},
|
|
586
|
+
indexKnowledgeDescriptors: ({ knowledgeStoreId }, options) => GenericAPIFn(`/new/v2.0/knowledgestores/${knowledgeStoreId}/descriptors`, "GET", self)(undefined, options),
|
|
581
587
|
indexKnowledgeSources: (_a, options) => {
|
|
582
588
|
var { knowledgeStoreId } = _a, args = __rest(_a, ["knowledgeStoreId"]);
|
|
583
589
|
return GenericAPIFn(`/new/v2.0/knowledgestores/${knowledgeStoreId}/sources?${stringifyQuery(args)}`, "GET", self)(undefined, options);
|
|
@@ -31,6 +31,10 @@ export function SimulationAPIGroup_2_0(instance) {
|
|
|
31
31
|
var { simulationReference, simulationRunBatchReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference"]);
|
|
32
32
|
return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}?${stringifyQuery(args)}`, "GET", self)(undefined, options);
|
|
33
33
|
},
|
|
34
|
+
stopSimulationRunBatch: (_a, options) => {
|
|
35
|
+
var { simulationReference, simulationRunBatchReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference"]);
|
|
36
|
+
return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}/stop?${stringifyQuery(args)}`, "POST", self)(undefined, options);
|
|
37
|
+
},
|
|
34
38
|
indexSimulationRuns: (_a, options) => {
|
|
35
39
|
var { simulationReference, simulationRunBatchReference } = _a, args = __rest(_a, ["simulationReference", "simulationRunBatchReference"]);
|
|
36
40
|
return GenericAPIFn(`/testing/beta/simulations/${simulationReference}/batches/${simulationRunBatchReference}/runs?${stringifyQuery(args)}`, "GET", self)(undefined, options);
|
|
@@ -58,12 +58,22 @@ export const DEBUG_MESSAGE = createNodeDescriptor({
|
|
|
58
58
|
function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
59
|
const { api } = cognigy;
|
|
60
60
|
const { level, message, header } = config;
|
|
61
|
-
|
|
61
|
+
let messageToOutput = message;
|
|
62
|
+
//Atp message can be of type any since cognigyScript can return any type
|
|
63
|
+
// whereas logDebugMessage expects a string or object
|
|
64
|
+
// so we need to change the type of message to string if not string or object
|
|
65
|
+
if (message === undefined || message === null) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
else if (typeof message !== "string" && typeof message !== "object") {
|
|
69
|
+
messageToOutput = JSON.stringify(message);
|
|
70
|
+
}
|
|
71
|
+
if (level) {
|
|
62
72
|
if (level === "info") {
|
|
63
|
-
api.logDebugMessage(
|
|
73
|
+
api.logDebugMessage(messageToOutput, header);
|
|
64
74
|
}
|
|
65
75
|
if (level === "error") {
|
|
66
|
-
api.logDebugError(
|
|
76
|
+
api.logDebugError(messageToOutput, header);
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
})
|