@cognigy/rest-api-client 2025.15.0 → 2025.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/build/apigroups/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/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/service/aiAgent/aiAgentJob.js +29 -22
- package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +4 -4
- package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +24 -18
- package/build/shared/charts/descriptors/transcripts/addTranscriptStep.js +3 -3
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -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 +15 -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/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/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/service/aiAgent/aiAgentJob.js +28 -21
- package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +4 -4
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +31 -25
- package/dist/esm/shared/charts/descriptors/transcripts/addTranscriptStep.js +3 -3
- package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -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 +13 -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/package.json +2 -2
- package/types/index.d.ts +257 -23
|
@@ -625,7 +625,7 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
625
625
|
},
|
|
626
626
|
tags: ["ai", "llm", "gpt", "generative ai", "openai", "azure", "prompt"],
|
|
627
627
|
function: ({ cognigy, config, childConfigs, nodeId }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
628
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
628
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
629
629
|
const { api, input, flowReferenceId } = cognigy;
|
|
630
630
|
const { temperature, maxTokens, topP, presencePenalty, frequencyPenalty, useStop, stop, storeLocation, contextKey, inputKey, timeout, streamStopTokens, streamStopTokenOverrides, debugLogTokenCount, debugLogRequestAndCompletion, debugLogLLMLatency, debugLogToolDefinitions, llmProviderReferenceId, usePromptMode, chatTranscriptSteps, responseFormat, streamStoreCopyInInput, seed, immediateOutput, customModelOptions, customRequestOptions, errorHandling = "continue", // default behavior for LLM Prompt node was, continue its execution even though an error occurred (deviating it from the SEO node) & do not output an error message on UI explicitly. However, error is always stored in the input or context object. We can use an extra "say" node to output it.
|
|
631
631
|
errorHandlingGotoTarget, errorMessage, logErrorToSystem, processImages, transcriptImageHandling, toolChoice, useStrict } = config;
|
|
@@ -653,17 +653,17 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
653
653
|
}
|
|
654
654
|
// handle errors from external services, depending on the settings
|
|
655
655
|
const handleServiceError = (error) => __awaiter(void 0, void 0, void 0, function* () {
|
|
656
|
-
var
|
|
656
|
+
var _y, _z, _0, _1, _2, _3;
|
|
657
657
|
const compactError = {
|
|
658
658
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
659
659
|
code: error === null || error === void 0 ? void 0 : error.code,
|
|
660
660
|
message: (error === null || error === void 0 ? void 0 : error.message) || error
|
|
661
661
|
};
|
|
662
662
|
// return the requestId if it exist in the error obj.
|
|
663
|
-
if ((
|
|
664
|
-
compactError["requestId"] = (
|
|
663
|
+
if ((_y = error === null || error === void 0 ? void 0 : error.meta) === null || _y === void 0 ? void 0 : _y.requestId) {
|
|
664
|
+
compactError["requestId"] = (_z = error === null || error === void 0 ? void 0 : error.meta) === null || _z === void 0 ? void 0 : _z.requestId;
|
|
665
665
|
}
|
|
666
|
-
if ((
|
|
666
|
+
if ((_0 = error === null || error === void 0 ? void 0 : error.originalErrorDetails) === null || _0 === void 0 ? void 0 : _0.code) {
|
|
667
667
|
compactError.code = error.originalErrorDetails.code;
|
|
668
668
|
}
|
|
669
669
|
const errorResponse = {
|
|
@@ -672,7 +672,7 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
672
672
|
// add error to context or input
|
|
673
673
|
switch (storeLocation) {
|
|
674
674
|
case "context":
|
|
675
|
-
(
|
|
675
|
+
(_1 = api.addToContext) === null || _1 === void 0 ? void 0 : _1.call(api, contextKey, errorResponse, "simple");
|
|
676
676
|
break;
|
|
677
677
|
default:
|
|
678
678
|
api.addToInput(inputKey, errorResponse);
|
|
@@ -680,7 +680,7 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
680
680
|
if (errorHandling === "continue") {
|
|
681
681
|
// output the timeout message
|
|
682
682
|
if (errorMessage) {
|
|
683
|
-
yield ((
|
|
683
|
+
yield ((_2 = api.output) === null || _2 === void 0 ? void 0 : _2.call(api, errorMessage, null));
|
|
684
684
|
}
|
|
685
685
|
// Continue with default node as next node
|
|
686
686
|
const defaultChild = childConfigs === null || childConfigs === void 0 ? void 0 : childConfigs.find(child => child.type === "llmPromptDefault");
|
|
@@ -707,7 +707,7 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
707
707
|
absorbContext: false
|
|
708
708
|
}
|
|
709
709
|
};
|
|
710
|
-
yield ((
|
|
710
|
+
yield ((_3 = GO_TO.function) === null || _3 === void 0 ? void 0 : _3.call(GO_TO, gotoParams));
|
|
711
711
|
}
|
|
712
712
|
else {
|
|
713
713
|
throw new InternalServerError(error === null || error === void 0 ? void 0 : error.message, { traceId });
|
|
@@ -817,14 +817,20 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
817
817
|
const mainToolCall = llmResult.toolCalls[0];
|
|
818
818
|
let isMcpToolCall = false;
|
|
819
819
|
// Find the child node with the toolId of the tool call
|
|
820
|
-
let toolChild =
|
|
820
|
+
let toolChild = undefined;
|
|
821
|
+
for (const child of childConfigs) {
|
|
822
|
+
if (child.type === "llmPromptTool" && ((_e = child.config) === null || _e === void 0 ? void 0 : _e.toolId) && (yield api.parseCognigyScriptText((_f = child.config) === null || _f === void 0 ? void 0 : _f.toolId)) === mainToolCall.function.name) {
|
|
823
|
+
toolChild = child;
|
|
824
|
+
break;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
821
827
|
if (!toolChild && toolMap.has(mainToolCall.function.name)) {
|
|
822
828
|
// If the tool call is from an MCP tool, set the next node to the corresponding child node
|
|
823
829
|
toolChild = childConfigs.find(child => child.id === toolMap.get(mainToolCall.function.name));
|
|
824
830
|
isMcpToolCall = true;
|
|
825
831
|
}
|
|
826
832
|
if (mainToolCall.function.name !== "retrieve_knowledge" && toolChild === undefined) {
|
|
827
|
-
(
|
|
833
|
+
(_g = api.logDebugError) === null || _g === void 0 ? void 0 : _g.call(api, `UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__ERROR__BODY <b>${mainToolCall.function.name}</b>`, "UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__ERROR__HEADER");
|
|
828
834
|
}
|
|
829
835
|
// Add last tool call to session state for loading it from Tool Answer Node
|
|
830
836
|
api.updateSessionStateValues({
|
|
@@ -832,20 +838,20 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
832
838
|
flow: flowReferenceId,
|
|
833
839
|
node: nodeId,
|
|
834
840
|
} }, (isMcpToolCall && {
|
|
835
|
-
mcpServerUrl: (
|
|
836
|
-
timeout: (
|
|
841
|
+
mcpServerUrl: (_h = toolChild === null || toolChild === void 0 ? void 0 : toolChild.config) === null || _h === void 0 ? void 0 : _h.mcpServerUrl,
|
|
842
|
+
timeout: (_j = toolChild === null || toolChild === void 0 ? void 0 : toolChild.config) === null || _j === void 0 ? void 0 : _j.timeout,
|
|
837
843
|
mcpToolNode: toolChild === null || toolChild === void 0 ? void 0 : toolChild.id,
|
|
838
844
|
})), { toolCall: mainToolCall }),
|
|
839
845
|
});
|
|
840
846
|
// if there are any parameters/arguments, add them to the input slots
|
|
841
847
|
if (mainToolCall.function.arguments) {
|
|
842
|
-
input.llmPrompt = Object.assign(Object.assign({}, input.llmPrompt), { toolArgs: Object.assign(Object.assign({}, (
|
|
848
|
+
input.llmPrompt = Object.assign(Object.assign({}, input.llmPrompt), { toolArgs: Object.assign(Object.assign({}, (_l = (_k = input.llmPrompt) === null || _k === void 0 ? void 0 : _k.toolArgs) !== null && _l !== void 0 ? _l : {}), mainToolCall.function.arguments) });
|
|
843
849
|
}
|
|
844
850
|
// Debug Message for Tool Calls, configured in the Tool Node
|
|
845
|
-
if ((
|
|
846
|
-
const messageLines = [`<b>UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER:</b> ${api.parseCognigyScriptText(toolChild.config.toolId)}`];
|
|
851
|
+
if ((_m = toolChild === null || toolChild === void 0 ? void 0 : toolChild.config) === null || _m === void 0 ? void 0 : _m.debugMessage) {
|
|
852
|
+
const messageLines = [`<b>UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER:</b> ${yield api.parseCognigyScriptText(toolChild.config.toolId)}`];
|
|
847
853
|
// Arguments / Parameters Slots
|
|
848
|
-
const slots = ((
|
|
854
|
+
const slots = ((_o = mainToolCall === null || mainToolCall === void 0 ? void 0 : mainToolCall.function) === null || _o === void 0 ? void 0 : _o.arguments) && Object.keys(mainToolCall.function.arguments);
|
|
849
855
|
const hasSlots = slots && slots.length > 0;
|
|
850
856
|
messageLines.push(`<b>UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__SLOTS</b>${hasSlots ? "" : " -"}`);
|
|
851
857
|
if (hasSlots) {
|
|
@@ -860,7 +866,7 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
860
866
|
messageLines.push(`- ${slot}: ${slotValueAsString}`);
|
|
861
867
|
});
|
|
862
868
|
}
|
|
863
|
-
(
|
|
869
|
+
(_p = api.logDebugMessage) === null || _p === void 0 ? void 0 : _p.call(api, messageLines.join("\n"), "UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER");
|
|
864
870
|
}
|
|
865
871
|
if (toolChild) {
|
|
866
872
|
api.setNextNode(toolChild.id);
|
|
@@ -885,11 +891,11 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
885
891
|
// we stringify objects (e.g. results coming from JSON Mode)
|
|
886
892
|
// so that the transcript only contains text
|
|
887
893
|
const resultToOutput = typeof ((llmResult === null || llmResult === void 0 ? void 0 : llmResult.result) || llmResult) === "object" ? JSON.stringify((llmResult === null || llmResult === void 0 ? void 0 : llmResult.result) || llmResult, undefined, 2) : (llmResult === null || llmResult === void 0 ? void 0 : llmResult.result) || llmResult;
|
|
888
|
-
yield ((
|
|
894
|
+
yield ((_q = api.output) === null || _q === void 0 ? void 0 : _q.call(api, resultToOutput, {}));
|
|
889
895
|
}
|
|
890
896
|
else if (llmResult.finishReason && llmPromptOptions.stream) {
|
|
891
897
|
// send the finishReason as last output for a stream
|
|
892
|
-
(
|
|
898
|
+
(_r = api.output) === null || _r === void 0 ? void 0 : _r.call(api, "", {
|
|
893
899
|
_cognigy: {
|
|
894
900
|
_preventTranscript: true,
|
|
895
901
|
_messageId,
|
|
@@ -912,7 +918,7 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
912
918
|
}
|
|
913
919
|
// Add response to Cognigy Input/Context for further usage
|
|
914
920
|
if (storeLocation === "context") {
|
|
915
|
-
(
|
|
921
|
+
(_s = api.addToContext) === null || _s === void 0 ? void 0 : _s.call(api, contextKey, llmResult, "simple");
|
|
916
922
|
}
|
|
917
923
|
else if (storeLocation === "input") {
|
|
918
924
|
api.addToInput(inputKey, llmResult);
|
|
@@ -925,19 +931,19 @@ export const LLM_PROMPT_V2 = createNodeDescriptor({
|
|
|
925
931
|
const errorDetailsBase = {
|
|
926
932
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
927
933
|
code: (error === null || error === void 0 ? void 0 : error.code) || (error === null || error === void 0 ? void 0 : error.httpStatusCode),
|
|
928
|
-
message: (error === null || error === void 0 ? void 0 : error.message) || ((
|
|
934
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || ((_t = error.originalErrorDetails) === null || _t === void 0 ? void 0 : _t.message),
|
|
929
935
|
};
|
|
930
936
|
const errorDetails = Object.assign(Object.assign({}, errorDetailsBase), { originalErrorDetails: error === null || error === void 0 ? void 0 : error.originalErrorDetails });
|
|
931
937
|
// return the requestId if it exist in the error obj.
|
|
932
|
-
if ((
|
|
938
|
+
if ((_u = error.meta) === null || _u === void 0 ? void 0 : _u.requestId) {
|
|
933
939
|
errorDetails["meta"] = {
|
|
934
|
-
requestId: (
|
|
940
|
+
requestId: (_v = error.meta) === null || _v === void 0 ? void 0 : _v.requestId
|
|
935
941
|
};
|
|
936
942
|
}
|
|
937
943
|
if (logErrorToSystem) {
|
|
938
|
-
(
|
|
944
|
+
(_w = api.log) === null || _w === void 0 ? void 0 : _w.call(api, "error", JSON.stringify(errorDetailsBase));
|
|
939
945
|
}
|
|
940
|
-
(
|
|
946
|
+
(_x = api.logDebugError) === null || _x === void 0 ? void 0 : _x.call(api, errorDetailsBase, "UI__DEBUG_MODE__LLM_PROMPT__ERROR");
|
|
941
947
|
yield handleServiceError(errorDetails);
|
|
942
948
|
return;
|
|
943
949
|
}
|
|
@@ -326,7 +326,7 @@ export const ADD_TRANSCRIPT_STEP = createNodeDescriptor({
|
|
|
326
326
|
},
|
|
327
327
|
tags: ["service", "transcripts"],
|
|
328
328
|
function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
329
|
-
const { role,
|
|
329
|
+
const { role, text, data, name, id, input, toolCallId, assistantType, content, header, message, metadata } = config;
|
|
330
330
|
const { api } = cognigy;
|
|
331
331
|
let log = null;
|
|
332
332
|
switch (role) {
|
|
@@ -342,7 +342,7 @@ export const ADD_TRANSCRIPT_STEP = createNodeDescriptor({
|
|
|
342
342
|
};
|
|
343
343
|
break;
|
|
344
344
|
case TranscriptRole.ASSISTANT:
|
|
345
|
-
if (
|
|
345
|
+
if (assistantType === TranscriptEntryType.OUTPUT) {
|
|
346
346
|
log = {
|
|
347
347
|
role: TranscriptRole.ASSISTANT,
|
|
348
348
|
type: TranscriptEntryType.OUTPUT,
|
|
@@ -353,7 +353,7 @@ export const ADD_TRANSCRIPT_STEP = createNodeDescriptor({
|
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
|
-
else if (
|
|
356
|
+
else if (assistantType === TranscriptEntryType.TOOL_CALL) {
|
|
357
357
|
log = {
|
|
358
358
|
role: TranscriptRole.ASSISTANT,
|
|
359
359
|
type: TranscriptEntryType.TOOL_CALL,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nodeDescriptorSchema, nodeFieldSchema
|
|
1
|
+
import { nodeDescriptorSchema, nodeFieldSchema } from "./INodeDescriptorSet";
|
|
2
2
|
export const knowledgeFieldTypes = [
|
|
3
3
|
"text",
|
|
4
4
|
"rule",
|
|
@@ -17,13 +17,13 @@ export const knowledgeFieldTypes = [
|
|
|
17
17
|
"daterange",
|
|
18
18
|
"connection",
|
|
19
19
|
"condition",
|
|
20
|
-
"description"
|
|
20
|
+
"description"
|
|
21
21
|
];
|
|
22
22
|
export const knowledgeFieldSchema = {
|
|
23
23
|
title: "knowledgeFieldSchema",
|
|
24
24
|
type: "object",
|
|
25
25
|
additionalProperties: false,
|
|
26
|
-
properties: Object.assign(Object.assign({}, nodeFieldSchema.properties), { type: { type: "string", enum: [...knowledgeFieldTypes] }, key: { type: "string", minLength: 1, maxLength: 200 } })
|
|
26
|
+
properties: Object.assign(Object.assign({}, nodeFieldSchema.properties), { type: { type: "string", enum: [...knowledgeFieldTypes] }, key: { type: "string", minLength: 1, maxLength: 200 } })
|
|
27
27
|
};
|
|
28
28
|
const { type, summary, defaultLabel, sections, form } = nodeDescriptorSchema.properties;
|
|
29
29
|
export const knowledgeDescriptorSchema = {
|
|
@@ -36,7 +36,39 @@ export const knowledgeDescriptorSchema = {
|
|
|
36
36
|
summary,
|
|
37
37
|
sections,
|
|
38
38
|
form,
|
|
39
|
-
fields: { type: "array", items: knowledgeFieldSchema }
|
|
40
|
-
}
|
|
39
|
+
fields: { type: "array", items: knowledgeFieldSchema }
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const filterNonConfigFields = ({ type }) => !["description"].includes(type);
|
|
43
|
+
export const buildConfigValidationSchema = (fields) => ({
|
|
44
|
+
type: "object",
|
|
45
|
+
additionalProperties: false,
|
|
46
|
+
required: (fields || []).filter(filterNonConfigFields).map(({ key }) => key),
|
|
47
|
+
properties: Object.assign({}, (fields || []).filter(filterNonConfigFields).reduce((result, field) => (Object.assign(Object.assign({}, result), { [field.key]: mapFieldToSchema(field) })), {}))
|
|
48
|
+
});
|
|
49
|
+
const mapFieldToSchema = ({ type, params }) => {
|
|
50
|
+
switch (type) {
|
|
51
|
+
case "checkbox":
|
|
52
|
+
case "toggle":
|
|
53
|
+
return { type: "boolean" };
|
|
54
|
+
case "number":
|
|
55
|
+
case "slider":
|
|
56
|
+
return { type: "number" };
|
|
57
|
+
case "textArray":
|
|
58
|
+
return {
|
|
59
|
+
type: "array",
|
|
60
|
+
minLength: (params === null || params === void 0 ? void 0 : params.required) ? 1 : 0
|
|
61
|
+
};
|
|
62
|
+
case "json":
|
|
63
|
+
return {
|
|
64
|
+
type: ["object", "array"],
|
|
65
|
+
additionalProperties: true
|
|
66
|
+
};
|
|
67
|
+
default:
|
|
68
|
+
return {
|
|
69
|
+
type: "string",
|
|
70
|
+
minLength: (params === null || params === void 0 ? void 0 : params.required) ? 1 : 0
|
|
71
|
+
};
|
|
72
|
+
}
|
|
41
73
|
};
|
|
42
74
|
//# sourceMappingURL=IKnowledgeDescriptor.js.map
|
|
@@ -159,4 +159,17 @@ export const largeLanguageModelSchema = {
|
|
|
159
159
|
properties: Object.assign(Object.assign(Object.assign({}, largeLanguageModelDataSchema.properties), entityMetaSchema.properties), { projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" } })
|
|
160
160
|
};
|
|
161
161
|
export const largeLanguageModelQuerySchema = createQuerySchema("largeLanguageModelQuerySchema", largeLanguageModelSchema);
|
|
162
|
+
export const isIGraphLargeLanguageModel = (resource) => {
|
|
163
|
+
return (resource &&
|
|
164
|
+
resource.type === "largeLanguageModel" &&
|
|
165
|
+
resource._id &&
|
|
166
|
+
resource.name &&
|
|
167
|
+
resource.referenceId &&
|
|
168
|
+
resource.properties &&
|
|
169
|
+
resource.properties.modelType &&
|
|
170
|
+
resource.properties.createdAt &&
|
|
171
|
+
resource.properties.createdBy &&
|
|
172
|
+
resource.properties.lastChanged &&
|
|
173
|
+
resource.properties.lastChangedBy);
|
|
174
|
+
};
|
|
162
175
|
//# sourceMappingURL=ILargeLanguageModel.js.map
|
package/dist/esm/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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognigy/rest-api-client",
|
|
3
|
-
"version": "2025.
|
|
3
|
+
"version": "2025.16.0",
|
|
4
4
|
"description": "Cognigy REST-Client",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"ajv": "6.12.6",
|
|
34
34
|
"axios": "1.8.3",
|
|
35
|
-
"form-data": "4.0.
|
|
35
|
+
"form-data": "4.0.4",
|
|
36
36
|
"tus-js-client": "^3.1.1",
|
|
37
37
|
"uuidv4": "6.2.13"
|
|
38
38
|
},
|