@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.
Files changed (55) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/apigroups/MetricsAPIGroup_2_0.js +10 -0
  3. package/build/apigroups/ResourcesAPIGroup_2_0.js +6 -0
  4. package/build/apigroups/SimulationAPIGroup_2_0.js +4 -0
  5. package/build/shared/charts/descriptors/logic/if/if.js +2 -2
  6. package/build/shared/charts/descriptors/logic/switch/switch.js +30 -21
  7. package/build/shared/charts/descriptors/message/question/question.js +3 -3
  8. package/build/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +2 -2
  9. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +29 -22
  10. package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +4 -4
  11. package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +24 -18
  12. package/build/shared/charts/descriptors/transcripts/addTranscriptStep.js +3 -3
  13. package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -0
  14. package/build/shared/interfaces/resources/IGetAiAgentJobsTools.js +3 -0
  15. package/build/shared/interfaces/resources/IKnowledgeDescriptor.js +38 -5
  16. package/build/shared/interfaces/resources/ILargeLanguageModel.js +15 -1
  17. package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/ICallCounterPreAggregatedValue_3_0.js +3 -0
  18. package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterOrganisationRest_3_0.js +3 -0
  19. package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterRest_3_0.js +3 -0
  20. package/build/shared/interfaces/restAPI/metrics/callCounter/v3.0/index.js +3 -0
  21. package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IAiAgentJobNodeWithTools_2_0.js +65 -0
  22. package/build/shared/interfaces/restAPI/resources/aiAgent/v2.0/IGetAiAgentJobAndToolsRest_2_0 .js +4 -0
  23. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/IIndexKnowledgeDescriptorsRest_2_0.js +3 -0
  24. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/extension/IRunKnowledgeExtensionRest_2_0.js +3 -0
  25. package/build/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/index.js +16 -0
  26. package/build/shared/interfaces/restAPI/simulation/simulationRunBatch/IStopSimulationRunBatchRest_2_0.js +3 -0
  27. package/build/shared/interfaces/security/ICallCounterPreAggregatedValue.js +3 -0
  28. package/dist/esm/apigroups/MetricsAPIGroup_2_0.js +10 -0
  29. package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +6 -0
  30. package/dist/esm/apigroups/SimulationAPIGroup_2_0.js +4 -0
  31. package/dist/esm/shared/charts/descriptors/logic/if/if.js +2 -2
  32. package/dist/esm/shared/charts/descriptors/logic/switch/switch.js +30 -21
  33. package/dist/esm/shared/charts/descriptors/message/question/question.js +3 -3
  34. package/dist/esm/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +4 -3
  35. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +28 -21
  36. package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +4 -4
  37. package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +31 -25
  38. package/dist/esm/shared/charts/descriptors/transcripts/addTranscriptStep.js +3 -3
  39. package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -0
  40. package/dist/esm/shared/interfaces/resources/IGetAiAgentJobsTools.js +2 -0
  41. package/dist/esm/shared/interfaces/resources/IKnowledgeDescriptor.js +37 -5
  42. package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +13 -0
  43. package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/ICallCounterPreAggregatedValue_3_0.js +2 -0
  44. package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterOrganisationRest_3_0.js +2 -0
  45. package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/IGetCallCounterRest_3_0.js +2 -0
  46. package/dist/esm/shared/interfaces/restAPI/metrics/callCounter/v3.0/index.js +2 -0
  47. package/dist/esm/shared/interfaces/restAPI/resources/aiAgent/v2.0/IAiAgentJobNodeWithTools_2_0.js +65 -0
  48. package/dist/esm/shared/interfaces/restAPI/resources/aiAgent/v2.0/IGetAiAgentJobAndToolsRest_2_0 .js +3 -0
  49. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/IIndexKnowledgeDescriptorsRest_2_0.js +2 -0
  50. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/extension/IRunKnowledgeExtensionRest_2_0.js +2 -0
  51. package/dist/esm/shared/interfaces/restAPI/resources/knowledgeStore/v2.0/index.js +2 -1
  52. package/dist/esm/shared/interfaces/restAPI/simulation/simulationRunBatch/IStopSimulationRunBatchRest_2_0.js +2 -0
  53. package/dist/esm/shared/interfaces/security/ICallCounterPreAggregatedValue.js +2 -0
  54. package/package.json +2 -2
  55. 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 _w, _x, _y, _z, _0, _1;
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 ((_w = error === null || error === void 0 ? void 0 : error.meta) === null || _w === void 0 ? void 0 : _w.requestId) {
664
- compactError["requestId"] = (_x = error === null || error === void 0 ? void 0 : error.meta) === null || _x === void 0 ? void 0 : _x.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 ((_y = error === null || error === void 0 ? void 0 : error.originalErrorDetails) === null || _y === void 0 ? void 0 : _y.code) {
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
- (_z = api.addToContext) === null || _z === void 0 ? void 0 : _z.call(api, contextKey, errorResponse, "simple");
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 ((_0 = api.output) === null || _0 === void 0 ? void 0 : _0.call(api, errorMessage, null));
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 ((_1 = GO_TO.function) === null || _1 === void 0 ? void 0 : _1.call(GO_TO, gotoParams));
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 = childConfigs.find(child => { var _a, _b; return child.type === "llmPromptTool" && ((_a = child.config) === null || _a === void 0 ? void 0 : _a.toolId) && api.parseCognigyScriptText((_b = child.config) === null || _b === void 0 ? void 0 : _b.toolId) === mainToolCall.function.name; });
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
- (_e = api.logDebugError) === null || _e === void 0 ? void 0 : _e.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");
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: (_f = toolChild === null || toolChild === void 0 ? void 0 : toolChild.config) === null || _f === void 0 ? void 0 : _f.mcpServerUrl,
836
- timeout: (_g = toolChild === null || toolChild === void 0 ? void 0 : toolChild.config) === null || _g === void 0 ? void 0 : _g.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({}, (_j = (_h = input.llmPrompt) === null || _h === void 0 ? void 0 : _h.toolArgs) !== null && _j !== void 0 ? _j : {}), mainToolCall.function.arguments) });
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 ((_k = toolChild === null || toolChild === void 0 ? void 0 : toolChild.config) === null || _k === void 0 ? void 0 : _k.debugMessage) {
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 = ((_l = mainToolCall === null || mainToolCall === void 0 ? void 0 : mainToolCall.function) === null || _l === void 0 ? void 0 : _l.arguments) && Object.keys(mainToolCall.function.arguments);
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
- (_m = api.logDebugMessage) === null || _m === void 0 ? void 0 : _m.call(api, messageLines.join("\n"), "UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER");
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 ((_o = api.output) === null || _o === void 0 ? void 0 : _o.call(api, resultToOutput, {}));
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
- (_p = api.output) === null || _p === void 0 ? void 0 : _p.call(api, "", {
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
- (_q = api.addToContext) === null || _q === void 0 ? void 0 : _q.call(api, contextKey, llmResult, "simple");
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) || ((_r = error.originalErrorDetails) === null || _r === void 0 ? void 0 : _r.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 ((_s = error.meta) === null || _s === void 0 ? void 0 : _s.requestId) {
938
+ if ((_u = error.meta) === null || _u === void 0 ? void 0 : _u.requestId) {
933
939
  errorDetails["meta"] = {
934
- requestId: (_t = error.meta) === null || _t === void 0 ? void 0 : _t.requestId
940
+ requestId: (_v = error.meta) === null || _v === void 0 ? void 0 : _v.requestId
935
941
  };
936
942
  }
937
943
  if (logErrorToSystem) {
938
- (_u = api.log) === null || _u === void 0 ? void 0 : _u.call(api, "error", JSON.stringify(errorDetailsBase));
944
+ (_w = api.log) === null || _w === void 0 ? void 0 : _w.call(api, "error", JSON.stringify(errorDetailsBase));
939
945
  }
940
- (_v = api.logDebugError) === null || _v === void 0 ? void 0 : _v.call(api, errorDetailsBase, "UI__DEBUG_MODE__LLM_PROMPT__ERROR");
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, agentType, text, data, name, id, input, toolCallId, content, header, message, metadata } = config;
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 (agentType === TranscriptEntryType.OUTPUT) {
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 (agentType === TranscriptEntryType.TOOL_CALL) {
356
+ else if (assistantType === TranscriptEntryType.TOOL_CALL) {
357
357
  log = {
358
358
  role: TranscriptRole.ASSISTANT,
359
359
  type: TranscriptEntryType.TOOL_CALL,
@@ -50,6 +50,7 @@ export const generativeAIModels = [
50
50
  "pixtral-large-latest",
51
51
  "mistral-medium-latest",
52
52
  "mistral-small-latest",
53
+ "text-davinci-003",
53
54
  ...embeddingModels,
54
55
  ];
55
56
  export const generativeAIProviders = [
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IGetAiAgentJobsTools.js.map
@@ -1,4 +1,4 @@
1
- import { nodeDescriptorSchema, nodeFieldSchema, } from "./INodeDescriptorSet";
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
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ICallCounterPreAggregatedValue_3_0.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IGetCallCounterOrganisationRest_3_0.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IGetCallCounterRest_3_0.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -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
@@ -0,0 +1,3 @@
1
+ /* Interfaces */
2
+ export {};
3
+ //# sourceMappingURL=IGetAiAgentJobAndToolsRest_2_0%20.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IIndexKnowledgeDescriptorsRest_2_0.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRunKnowledgeExtensionRest_2_0.js.map
@@ -1,2 +1,3 @@
1
- export {};
1
+ export * from "./IIndexKnowledgeDescriptorsRest_2_0";
2
+ export * from "./extension/IRunKnowledgeExtensionRest_2_0";
2
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IStopSimulationRunBatchRest_2_0.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ICallCounterPreAggregatedValue.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognigy/rest-api-client",
3
- "version": "2025.15.0",
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.0",
35
+ "form-data": "4.0.4",
36
36
  "tus-js-client": "^3.1.1",
37
37
  "uuidv4": "6.2.13"
38
38
  },