@cognigy/rest-api-client 4.96.0 → 4.97.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 (87) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/build/apigroups/ManagementAPIGroup_2_0.js +2 -1
  3. package/build/apigroups/ResourcesAPIGroup_2_0.js +9 -0
  4. package/build/authentication/AuthenticationAPI.js +6 -1
  5. package/build/authentication/JWT/IJwtTokenAuthentication.js +3 -0
  6. package/build/authentication/JWT/JwtTokenAuthentication.js +22 -0
  7. package/build/shared/charts/descriptors/allFields.js +6 -0
  8. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +6 -2
  9. package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAICompatibleProviderConnection.js +11 -0
  10. package/build/shared/charts/descriptors/connectionNodes/speechProviders/deepgramSpeechProviderConnection.js +11 -0
  11. package/build/shared/charts/descriptors/connectionNodes/speechProviders/index.js +2 -0
  12. package/build/shared/charts/descriptors/index.js +6 -0
  13. package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +5 -1
  14. package/build/shared/charts/descriptors/message/question/question.js +21 -13
  15. package/build/shared/charts/descriptors/message/say.js +25 -2
  16. package/build/shared/charts/descriptors/service/GPTPrompt.js +1 -1
  17. package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +40 -28
  18. package/build/shared/charts/descriptors/service/checkAgentAvailability.js +63 -3
  19. package/build/shared/charts/descriptors/service/handoverConnections.js +51 -0
  20. package/build/shared/charts/descriptors/service/handoverV2.js +124 -64
  21. package/build/shared/charts/descriptors/service/index.js +8 -1
  22. package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +2 -0
  23. package/build/shared/interfaces/handover.js +74 -10
  24. package/build/shared/interfaces/handoverProviders.js +23 -0
  25. package/build/shared/interfaces/messageAPI/handover.js +22 -2
  26. package/build/shared/interfaces/resources/IExternalModel.js +3 -0
  27. package/build/shared/interfaces/resources/IHandoverProvider.js +3 -0
  28. package/build/shared/interfaces/resources/ILargeLanguageModel.js +13 -2
  29. package/build/shared/interfaces/resources/INodeDescriptorSet.js +9 -5
  30. package/build/shared/interfaces/resources/TResourceType.js +6 -0
  31. package/build/shared/interfaces/resources/settings/IAudioPreviewSettings.js +8 -2
  32. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/ICreateHandoverProviderRest_2_0.js +3 -0
  33. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IDeleteHandoverProviderRest_2_0.js +3 -0
  34. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverProvider_2_0.js +3 -0
  35. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverService_2_0.js +3 -0
  36. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverProvidersRest_2_0.js +3 -0
  37. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverServicesRest_2_0.js +3 -0
  38. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IReadHandoverProviderRest_2_0.js +3 -0
  39. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IUpdateHandoverProviderRest_2_0.js +3 -0
  40. package/build/shared/interfaces/restAPI/resources/handoverProvider/v2.0/index.js +3 -0
  41. package/build/shared/interfaces/security/IPermission.js +2 -0
  42. package/build/shared/interfaces/security/IRole.js +2 -0
  43. package/build/shared/interfaces/security/index.js +1 -1
  44. package/dist/esm/apigroups/ManagementAPIGroup_2_0.js +2 -1
  45. package/dist/esm/apigroups/ResourcesAPIGroup_2_0.js +9 -0
  46. package/dist/esm/authentication/AuthenticationAPI.js +6 -1
  47. package/dist/esm/authentication/JWT/IJwtTokenAuthentication.js +2 -0
  48. package/dist/esm/authentication/JWT/JwtTokenAuthentication.js +21 -0
  49. package/dist/esm/shared/charts/descriptors/allFields.js +6 -0
  50. package/dist/esm/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +4 -1
  51. package/dist/esm/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAICompatibleProviderConnection.js +8 -0
  52. package/dist/esm/shared/charts/descriptors/connectionNodes/speechProviders/deepgramSpeechProviderConnection.js +8 -0
  53. package/dist/esm/shared/charts/descriptors/connectionNodes/speechProviders/index.js +2 -0
  54. package/dist/esm/shared/charts/descriptors/index.js +7 -1
  55. package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +5 -1
  56. package/dist/esm/shared/charts/descriptors/message/question/question.js +21 -13
  57. package/dist/esm/shared/charts/descriptors/message/say.js +25 -2
  58. package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +1 -1
  59. package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +40 -28
  60. package/dist/esm/shared/charts/descriptors/service/checkAgentAvailability.js +63 -3
  61. package/dist/esm/shared/charts/descriptors/service/handoverConnections.js +48 -0
  62. package/dist/esm/shared/charts/descriptors/service/handoverV2.js +124 -64
  63. package/dist/esm/shared/charts/descriptors/service/index.js +1 -0
  64. package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +2 -0
  65. package/dist/esm/shared/interfaces/handover.js +73 -9
  66. package/dist/esm/shared/interfaces/handoverProviders.js +20 -0
  67. package/dist/esm/shared/interfaces/messageAPI/handover.js +22 -2
  68. package/dist/esm/shared/interfaces/resources/IExternalModel.js +2 -0
  69. package/dist/esm/shared/interfaces/resources/IHandoverProvider.js +2 -0
  70. package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +12 -1
  71. package/dist/esm/shared/interfaces/resources/INodeDescriptorSet.js +9 -5
  72. package/dist/esm/shared/interfaces/resources/TResourceType.js +6 -0
  73. package/dist/esm/shared/interfaces/resources/settings/IAudioPreviewSettings.js +8 -2
  74. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/ICreateHandoverProviderRest_2_0.js +2 -0
  75. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IDeleteHandoverProviderRest_2_0.js +2 -0
  76. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverProvider_2_0.js +2 -0
  77. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IHandoverService_2_0.js +2 -0
  78. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverProvidersRest_2_0.js +2 -0
  79. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IIndexHandoverServicesRest_2_0.js +2 -0
  80. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IReadHandoverProviderRest_2_0.js +2 -0
  81. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/IUpdateHandoverProviderRest_2_0.js +2 -0
  82. package/dist/esm/shared/interfaces/restAPI/resources/handoverProvider/v2.0/index.js +2 -0
  83. package/dist/esm/shared/interfaces/security/IPermission.js +2 -0
  84. package/dist/esm/shared/interfaces/security/IRole.js +2 -0
  85. package/dist/esm/shared/interfaces/security/index.js +1 -1
  86. package/package.json +1 -1
  87. package/types/index.d.ts +546 -19
@@ -8,6 +8,7 @@ import { ANTHROPIC_PROVIDER_CONNECTION } from "./anthropicProviderConnection";
8
8
  import { GOOGLE_VERTEXAI_PROVIDER_CONNECTION } from "./googleVertexAIProviderConnection";
9
9
  import { ALEPH_ALPHA_PROVIDER_CONNECTION } from "./alephAlphaProviderConnection";
10
10
  import { AWS_BEDROCK_PROVIDER_CONNECTION } from "./awsBedrockProviderConnection";
11
+ import { OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION } from "./openAICompatibleProviderConnection";
11
12
  export { OPEN_AI_PROVIDER_CONNECTION } from "./openAIProviderConnection";
12
13
  export { AZURE_OPEN_AI_PROVIDER_CONNECTION } from "./azureOpenAIProviderConnection";
13
14
  export { AZURE_OPEN_AI_V2_PROVIDER_CONNECTION } from "./azureOpenAIProviderConnectionV2";
@@ -16,6 +17,7 @@ export { ANTHROPIC_PROVIDER_CONNECTION } from "./anthropicProviderConnection";
16
17
  export { GOOGLE_VERTEXAI_PROVIDER_CONNECTION } from "./googleVertexAIProviderConnection";
17
18
  export { ALEPH_ALPHA_PROVIDER_CONNECTION } from "./alephAlphaProviderConnection";
18
19
  export { AWS_BEDROCK_PROVIDER_CONNECTION } from "./awsBedrockProviderConnection";
20
+ export { OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION } from "./openAICompatibleProviderConnection";
19
21
  export const cognigyGenerativeAIProviderModule = createExtension({
20
22
  nodes: [],
21
23
  connections: [
@@ -26,7 +28,8 @@ export const cognigyGenerativeAIProviderModule = createExtension({
26
28
  ANTHROPIC_PROVIDER_CONNECTION,
27
29
  GOOGLE_VERTEXAI_PROVIDER_CONNECTION,
28
30
  ALEPH_ALPHA_PROVIDER_CONNECTION,
29
- AWS_BEDROCK_PROVIDER_CONNECTION
31
+ AWS_BEDROCK_PROVIDER_CONNECTION,
32
+ OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION
30
33
  ]
31
34
  });
32
35
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,8 @@
1
+ export const OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION = {
2
+ type: "OpenAICompatibleProvider",
3
+ label: "UI__NODE_EDITOR__OPEN_AI_COMPATIBLE_PROVIDER_CONNECTION__LABEL",
4
+ fields: [
5
+ { fieldName: "apiKey", label: "UI__CONNECTION_EDITOR__FIELD_API_KEY" },
6
+ ]
7
+ };
8
+ //# sourceMappingURL=openAICompatibleProviderConnection.js.map
@@ -0,0 +1,8 @@
1
+ export const DEEPGRAM_SPEECH_PROVIDER_CONNECTION = {
2
+ type: "DeepgramSpeechProvider",
3
+ label: "UI__NODE_EDITOR__DEEPGRAM_SPEECH_PROVIDER__LABEL",
4
+ fields: [
5
+ { fieldName: "apiKey", label: "UI__CONNECTION_EDITOR__FIELD_API_KEY" },
6
+ ]
7
+ };
8
+ //# sourceMappingURL=deepgramSpeechProviderConnection.js.map
@@ -3,6 +3,7 @@ import { createExtension } from "../../../createNodeDescriptor";
3
3
  import { AWS_SPEECH_PROVIDER_CONNECTION } from "./awsSpeechProviderConnection";
4
4
  import { MICROSOFT_SPEECH_PROVIDER_CONNECTION } from "./microsoftSpeechProviderConnection";
5
5
  import { GOOGLE_SPEECH_PROVIDER_CONNECTION } from "./googleSpeechProviderConnection";
6
+ import { DEEPGRAM_SPEECH_PROVIDER_CONNECTION } from "./deepgramSpeechProviderConnection";
6
7
  export { AWS_SPEECH_PROVIDER_CONNECTION } from "./awsSpeechProviderConnection";
7
8
  export { MICROSOFT_SPEECH_PROVIDER_CONNECTION } from "./microsoftSpeechProviderConnection";
8
9
  export { GOOGLE_SPEECH_PROVIDER_CONNECTION } from "./googleSpeechProviderConnection";
@@ -12,6 +13,7 @@ export const cognigySpeechProviderModule = createExtension({
12
13
  AWS_SPEECH_PROVIDER_CONNECTION,
13
14
  MICROSOFT_SPEECH_PROVIDER_CONNECTION,
14
15
  GOOGLE_SPEECH_PROVIDER_CONNECTION,
16
+ DEEPGRAM_SPEECH_PROVIDER_CONNECTION,
15
17
  ]
16
18
  });
17
19
  //# sourceMappingURL=index.js.map
@@ -11,7 +11,7 @@ import { REGEX_SLOT_FILLER, EXECUTE_COGNIGY_NLU, ADD_LEXICON_KEYPHRASE, FUZZY_SE
11
11
  import { KNOWLEDGE_SEARCH, KNOWLEDGE_SEARCH_V2, SEARCH_EXTRACT_OUTPUT } from "./knowledgeSearch";
12
12
  import { CONTINUOUS_ASR, DTMF, HANG_UP, PLAY, TRANSFER_VOICE, SESSION_SPEECH_PARAMETERS, USER_INPUT_TIMEOUT, SEND_METADATA, BARGE_IN, MUTE_SPEECH_INPUT, } from "./voice";
13
13
  import { ACTIVATE_PROFILE, COMPLETE_GOAL, DEACTIVATE_PROFILE, DELETE_PROFILE, MERGE_PROFILE, UPDATE_PROFILE, ADD_MEMORY, BLIND_MODE, OVERWRITE_ANALYTICS, SET_RATING, REQUEST_RATING, TRACK_GOAL, } from "./analytics";
14
- import { HANDOVER, HANDOVER_V2, CHECK_AGENT_AVAILABILITY, HTTP_REQUEST, HTTP_CONNECTION_BASIC, HTTP_CONNECTION_APIKEYAUTHKEY, HTTP_CONNECTION_APIKEYXKEY, HTTP_CONNECTION_OAUTH2, JWT_SECRET_CONNECTION, TRIGGER_FUNCTION, ON_SCHEDULING_ERROR, ON_SCHEDULED, GPT_PROMPT, CLOSE_HANDOVER, HANDOVER_INACTIVITY_TIMER, GPT_CONVERSATION, GPT_CONVERSATION_SUMMARY, LLM_ENTITY_EXTRACT, AI_AGENT_JOB, AI_AGENT_JOB_DEFAULT, AI_AGENT_JOB_TOOL, AI_AGENT_TOOL_ANSWER, AI_AGENT_HANDOVER, } from "./service";
14
+ import { HANDOVER, HANDOVER_V2, CHECK_AGENT_AVAILABILITY, HTTP_REQUEST, HTTP_CONNECTION_BASIC, HTTP_CONNECTION_APIKEYAUTHKEY, HTTP_CONNECTION_APIKEYXKEY, HTTP_CONNECTION_OAUTH2, JWT_SECRET_CONNECTION, TRIGGER_FUNCTION, ON_SCHEDULING_ERROR, ON_SCHEDULED, GPT_PROMPT, CLOSE_HANDOVER, HANDOVER_INACTIVITY_TIMER, GPT_CONVERSATION, GPT_CONVERSATION_SUMMARY, LLM_ENTITY_EXTRACT, AI_AGENT_JOB, AI_AGENT_JOB_DEFAULT, AI_AGENT_JOB_TOOL, AI_AGENT_TOOL_ANSWER, AI_AGENT_HANDOVER, LIVE_AGENT_CONNECTION, RINGCENTRAL_ENGAGE_CONNECTION, CHATWOOT_CONNECTION, EIGHT_BY_EIGHT_CONNECTION, GENESYS_CLOUD_CONNECTION, GENESYS_CLOUD_CONNECTION_OM } from "./service";
15
15
  import { INIT_APP_SESSION, GET_APP_SESSION_PIN, SET_HTML_APP_STATE, SET_ADAPTIVE_CARD_APP_STATE, } from "./apps";
16
16
  import { SET_IFRAME_TILE, SET_HTML_TILE, SEND_TILE_DATA, SET_SECURE_FORMS_TILE, SET_ADAPTIVE_CARD_TILE, SET_AGENT_ASSIST_GRID, NEXT_ACTION_ASSIST, SENTIMENT_ASSIST, TRANSCRIPT_ASSIST, IDENTITY_ASSIST, KNOWLEDGE_ASSIST, } from "./agentAssist";
17
17
  import { ASSIST_INFO } from "./liveAgent";
@@ -153,6 +153,12 @@ export const cognigyBasicModule = createExtension({
153
153
  HTTP_CONNECTION_APIKEYXKEY,
154
154
  HTTP_CONNECTION_OAUTH2,
155
155
  JWT_SECRET_CONNECTION,
156
+ LIVE_AGENT_CONNECTION,
157
+ RINGCENTRAL_ENGAGE_CONNECTION,
158
+ CHATWOOT_CONNECTION,
159
+ EIGHT_BY_EIGHT_CONNECTION,
160
+ GENESYS_CLOUD_CONNECTION,
161
+ GENESYS_CLOUD_CONNECTION_OM
156
162
  ],
157
163
  });
158
164
  export { cognigyMongoDBModule } from "./connectionNodes/mongoDB";
@@ -637,6 +637,10 @@ New: `;
637
637
  message: (error === null || error === void 0 ? void 0 : error.message) || error,
638
638
  };
639
639
  api.logDebugError(JSON.stringify(compactError, undefined, 2), "Search Extract Output: Error");
640
+ api.emitToOpsCenter({
641
+ subComponent: "KnowledgeAIQueries",
642
+ title: error === null || error === void 0 ? void 0 : error.message
643
+ });
640
644
  if ((_l = error === null || error === void 0 ? void 0 : error.originalErrorDetails) === null || _l === void 0 ? void 0 : _l.code) {
641
645
  compactError["code"] = error.originalErrorDetails.code;
642
646
  }
@@ -760,7 +764,7 @@ New: `;
760
764
  if (documents && (mode !== "s")) {
761
765
  // check if we received streamed output at all
762
766
  let streamedOutput = false;
763
- const isStreamingChannel = input.channel === "webchat3";
767
+ const isStreamingChannel = input.channel === "webchat3" || input.channel === "adminconsole";
764
768
  const _messageId = randomUUID();
765
769
  const promptData = {
766
770
  prompt,
@@ -538,6 +538,13 @@ DO NOT talk about other topics. Do not offer general assistance.`,
538
538
  description: "UI__NODE_EDITOR__MESSAGE__QUESTION__QUESTION__FIELDS__MAX_EXECUTION_DIFF__DESCRIPTION",
539
539
  defaultValue: 1
540
540
  },
541
+ {
542
+ key: "preventTranscript",
543
+ type: "toggle",
544
+ defaultValue: false,
545
+ label: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__LABEL",
546
+ description: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__DESCRIPTION",
547
+ },
541
548
  {
542
549
  key: "escalateAnswersAction",
543
550
  type: "select",
@@ -1738,7 +1745,8 @@ DO NOT talk about other topics. Do not offer general assistance.`,
1738
1745
  "onlyAcceptEscalationIntents",
1739
1746
  "additionalValidation",
1740
1747
  "resultLocation",
1741
- "maxExecutionDiff"
1748
+ "maxExecutionDiff",
1749
+ "preventTranscript"
1742
1750
  ]
1743
1751
  },
1744
1752
  {
@@ -1830,7 +1838,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
1830
1838
  //#endregion DescriptorFields
1831
1839
  function: ({ cognigy, nodeId, organisationId, config, inputOptions }) => __awaiter(void 0, void 0, void 0, function* () {
1832
1840
  var _a, _b, _c;
1833
- const { say, type, validationMessage, repromptLLMProvider, repromptType = "text", repromptLLMPrompt, repromptLLMTurns, repromptLLMStream, repromptLLMStreamStopTokens, repromptSay, repromptFlowNode, repromptParseIntents, repromptParseKeyphrases, repromptAbsorbContext, validationRepeat, storeResultInContext, contextKey, storeInContactProfile, profileKey, storeDetailedResults, parseResultOnEntry, repromptCondition, maxExecutionDiff, resultLocation, skipRepromptOnIntent, onlyAcceptEscalationIntents, escalateAnswersAction, escalateAnswersThreshold, escalateAnswersGotoTarget, escalateAnswersExecuteTarget, escalateAnswersGotoExecutionMode, escalateAnswersInjectedText, escalateAnswersInjectedData, escalateAnswersMessage, escalateAnswersRepromptPrevention, escalateAnswersOnce, escalateAnswersHandoverText, escalateAnswersRepeatHandoverMessage, escalateAnswersHandoverCancelIntent, escalateAnswersHandoverQuickReply, escalateAnswersHandoverChatwootInboxId, escalateAnswersHandoverLiveAgentInboxId, escalateAnswersHandoverAdditionalCategoryIds, escalateAnswersHandoverSendTranscriptAsFirstMessage, escalateAnswersHandoverSalesforcePrechatEntities, escalateAnswersHandoverSalesforcePrechatDetails, escalateAnswersHandoverGenesysLanguage, escalateAnswersHandoverGenesysSkills, escalateAnswersHandoverGenesysPriority, escalateAnswersHandoverGenesysCustomAttributes, escalateAnswersHandoverEightByEightChannelId, escalateAnswersHandoverEightByEightQueueId, escalateAnswersHandoverEightByEightJSONProps, escalateAnswersHandoverSendResolveEvent, escalateAnswersHandoverResolveBehavior, escalateAnswersAgentAssistInitMessage, escalateAnswersAllowAgentInject, escalateAnswersSendOnActiveEvent, escalateAnswersSendOnQueueEvent, escalateIntentsAction, escalateIntentsValidIntents, escalateIntentsThreshold, escalateIntentsGotoTarget, escalateIntentsExecuteTarget, escalateIntentsGotoExecutionMode, escalateIntentsInjectedText, escalateIntentsInjectedData, escalateIntentsMessage, escalateIntentsHandoverText, escalateIntentsRepeatHandoverMessage, escalateIntentsHandoverCancelIntent, escalateIntentsHandoverQuickReply, escalateIntentsHandoverChatwootInboxId, escalateIntentsHandoverLiveAgentInboxId, escalateIntentsHandoverAdditionalCategoryIds, escalateIntentHandoverSendTranscriptAsFirstMessage, escalateIntentsHandoverSalesforcePrechatEntities, escalateIntentsHandoverSalesforcePrechatDetails, escalateIntentsHandoverGenesysLanguage, escalateIntentsHandoverGenesysSkills, escalateIntentsHandoverGenesysPriority, escalateIntentsHandoverGenesysCustomAttributes, escalateIntentsHandoverEightByEightChannelId, escalateIntentsHandoverEightByEightQueueId, escalateIntentsHandoverEightByEightJSONProps, escalateIntentsRepromptPrevention, escalateIntentsHandoverSendResolveEvent, escalateIntentsHandoverResolveBehavior, escalateIntentsAgentAssistInitMessage, escalateIntentsAllowAgentInject, escalateIntentsSendOnActiveEvent, escalateIntentsSendOnQueueEvent, reconfirmationBehaviour, reconfirmationQuestion, reconfirmationQuestionReprompt, handoverOutput, cleanTextLocale, cleanDisallowedSymbols, additionalAllowedCharacters, additionalSpecialPhrases, resolveSpelledOutNumbers, resolvePhoneticAlphabet, additionalPhoneticAlphabet, replaceSpecialWords, additionalMappedSymbols, resolveSpelledOutAlphabet, resolvePhoneticCounters, contractSingleCharacters, contractNumberGroups, trimResult, runNLUAfterCleaning, overwrittenBaseAnswer } = config;
1841
+ const { say, type, validationMessage, repromptLLMProvider, repromptType = "text", repromptLLMPrompt, repromptLLMTurns, repromptLLMStream, repromptLLMStreamStopTokens, repromptSay, repromptFlowNode, repromptParseIntents, repromptParseKeyphrases, repromptAbsorbContext, validationRepeat, storeResultInContext, contextKey, storeInContactProfile, profileKey, storeDetailedResults, parseResultOnEntry, repromptCondition, maxExecutionDiff, resultLocation, skipRepromptOnIntent, onlyAcceptEscalationIntents, preventTranscript, escalateAnswersAction, escalateAnswersThreshold, escalateAnswersGotoTarget, escalateAnswersExecuteTarget, escalateAnswersGotoExecutionMode, escalateAnswersInjectedText, escalateAnswersInjectedData, escalateAnswersMessage, escalateAnswersRepromptPrevention, escalateAnswersOnce, escalateAnswersHandoverText, escalateAnswersRepeatHandoverMessage, escalateAnswersHandoverCancelIntent, escalateAnswersHandoverQuickReply, escalateAnswersHandoverChatwootInboxId, escalateAnswersHandoverLiveAgentInboxId, escalateAnswersHandoverAdditionalCategoryIds, escalateAnswersHandoverSendTranscriptAsFirstMessage, escalateAnswersHandoverSalesforcePrechatEntities, escalateAnswersHandoverSalesforcePrechatDetails, escalateAnswersHandoverGenesysLanguage, escalateAnswersHandoverGenesysSkills, escalateAnswersHandoverGenesysPriority, escalateAnswersHandoverGenesysCustomAttributes, escalateAnswersHandoverEightByEightChannelId, escalateAnswersHandoverEightByEightQueueId, escalateAnswersHandoverEightByEightJSONProps, escalateAnswersHandoverSendResolveEvent, escalateAnswersHandoverResolveBehavior, escalateAnswersAgentAssistInitMessage, escalateAnswersAllowAgentInject, escalateAnswersSendOnActiveEvent, escalateAnswersSendOnQueueEvent, escalateIntentsAction, escalateIntentsValidIntents, escalateIntentsThreshold, escalateIntentsGotoTarget, escalateIntentsExecuteTarget, escalateIntentsGotoExecutionMode, escalateIntentsInjectedText, escalateIntentsInjectedData, escalateIntentsMessage, escalateIntentsHandoverText, escalateIntentsRepeatHandoverMessage, escalateIntentsHandoverCancelIntent, escalateIntentsHandoverQuickReply, escalateIntentsHandoverChatwootInboxId, escalateIntentsHandoverLiveAgentInboxId, escalateIntentsHandoverAdditionalCategoryIds, escalateIntentHandoverSendTranscriptAsFirstMessage, escalateIntentsHandoverSalesforcePrechatEntities, escalateIntentsHandoverSalesforcePrechatDetails, escalateIntentsHandoverGenesysLanguage, escalateIntentsHandoverGenesysSkills, escalateIntentsHandoverGenesysPriority, escalateIntentsHandoverGenesysCustomAttributes, escalateIntentsHandoverEightByEightChannelId, escalateIntentsHandoverEightByEightQueueId, escalateIntentsHandoverEightByEightJSONProps, escalateIntentsRepromptPrevention, escalateIntentsHandoverSendResolveEvent, escalateIntentsHandoverResolveBehavior, escalateIntentsAgentAssistInitMessage, escalateIntentsAllowAgentInject, escalateIntentsSendOnActiveEvent, escalateIntentsSendOnQueueEvent, reconfirmationBehaviour, reconfirmationQuestion, reconfirmationQuestionReprompt, handoverOutput, cleanTextLocale, cleanDisallowedSymbols, additionalAllowedCharacters, additionalSpecialPhrases, resolveSpelledOutNumbers, resolvePhoneticAlphabet, additionalPhoneticAlphabet, replaceSpecialWords, additionalMappedSymbols, resolveSpelledOutAlphabet, resolvePhoneticCounters, contractSingleCharacters, contractNumberGroups, trimResult, runNLUAfterCleaning, overwrittenBaseAnswer } = config;
1834
1842
  const { input, context, profile, api } = cognigy;
1835
1843
  const rephraseWithAIParams = {
1836
1844
  generativeAI_rephraseOutputMode: config.generativeAI_rephraseOutputMode,
@@ -1973,11 +1981,11 @@ DO NOT talk about other topics. Do not offer general assistance.`,
1973
1981
  }
1974
1982
  // output reconfirmation reprompt
1975
1983
  if (reconfirmationQuestionReprompt) {
1976
- yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, say: { type: "text", text: [reconfirmationQuestionReprompt] } } });
1984
+ yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, preventTranscript, say: { type: "text", text: [reconfirmationQuestionReprompt] } } });
1977
1985
  }
1978
1986
  // output reconfirmationQuestion
1979
1987
  const tentativeAnswerShortform = (activeQuestion === null || activeQuestion === void 0 ? void 0 : activeQuestion.tentativeAnswerShortform) || "";
1980
- yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", tentativeAnswerShortform)] } } });
1988
+ yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, preventTranscript, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", tentativeAnswerShortform)] } } });
1981
1989
  // set myself as next node and stop
1982
1990
  api.setNextNode(nodeId);
1983
1991
  api.stopExecution();
@@ -2043,7 +2051,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2043
2051
  if (isFirstExecution && !parseResultOnEntry) {
2044
2052
  rephraseWithAIParams.promptType = "question";
2045
2053
  rephraseWithAIParams.questionType = config.type;
2046
- yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ say }, rephraseWithAIParams) });
2054
+ yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, say }, rephraseWithAIParams) });
2047
2055
  if (config.type === "date" && !config.datepicker_hidePicker) {
2048
2056
  showDatePicker(cognigy, config);
2049
2057
  }
@@ -2081,7 +2089,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2081
2089
  // remember a shortform of the given answer in the activeQuestion object
2082
2090
  activeQuestion.tentativeAnswerShortform = generateAnswerShortForm(type, result, cognigy.input.text);
2083
2091
  // Output reconfirmationQuestion
2084
- yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", activeQuestion.tentativeAnswerShortform)] } } });
2092
+ yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: { handoverOutput, preventTranscript, say: { type: "text", text: [reconfirmationQuestion.replace("[ANSWER]", activeQuestion.tentativeAnswerShortform)] } } });
2085
2093
  // remember that we are in reconfirmation mode and stop
2086
2094
  api.setSystemContext("reconfirmationQuestionInProgress", true);
2087
2095
  // we need to store the input, to be able to restore it afterwards
@@ -2206,7 +2214,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2206
2214
  childConfigs: [],
2207
2215
  nodeId,
2208
2216
  organisationId,
2209
- config: { handoverOutput, say: escalateIntentsMessage }
2217
+ config: { handoverOutput, preventTranscript, say: escalateIntentsMessage }
2210
2218
  });
2211
2219
  if (escalateIntentsRepromptPrevention) {
2212
2220
  sayReprompt = false;
@@ -2355,7 +2363,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2355
2363
  childConfigs: [],
2356
2364
  nodeId,
2357
2365
  organisationId,
2358
- config: { handoverOutput, say: escalateAnswersMessage }
2366
+ config: { handoverOutput, preventTranscript, say: escalateAnswersMessage }
2359
2367
  });
2360
2368
  if (escalateAnswersRepromptPrevention) {
2361
2369
  sayReprompt = false;
@@ -2433,7 +2441,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2433
2441
  if (sayReprompt) {
2434
2442
  switch (repromptType) {
2435
2443
  case "say":
2436
- yield SAY.function(Object.assign({ cognigy, childConfigs: [], nodeId, organisationId, config: { say: repromptSay } }, rephraseWithAIParams));
2444
+ yield SAY.function(Object.assign({ cognigy, childConfigs: [], nodeId, organisationId, config: { preventTranscript, say: repromptSay } }, rephraseWithAIParams));
2437
2445
  break;
2438
2446
  case "execute":
2439
2447
  // if a question reprompt is set to execute flow and we have just executed
@@ -2482,11 +2490,11 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2482
2490
  }
2483
2491
  const repromptMessage = yield api.runGenerativeAIPrompt(data, "gptPromptNode");
2484
2492
  if (!repromptLLMStream) {
2485
- yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ handoverOutput, say: { type: "text", text: [repromptMessage] } }, rephraseWithAIParams) });
2493
+ yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [repromptMessage] } }, rephraseWithAIParams) });
2486
2494
  }
2487
2495
  break;
2488
2496
  default: // this is also "text"
2489
- yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ handoverOutput, say: { type: "text", text: [validationMessage] } }, rephraseWithAIParams) });
2497
+ yield SAY.function({ cognigy, childConfigs: [], nodeId, organisationId, config: Object.assign({ preventTranscript, handoverOutput, say: { type: "text", text: [validationMessage] } }, rephraseWithAIParams) });
2490
2498
  }
2491
2499
  }
2492
2500
  /* If repeat toggle is on, also output question (and maybe datepicker) again */
@@ -2498,7 +2506,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2498
2506
  childConfigs: [],
2499
2507
  nodeId,
2500
2508
  organisationId,
2501
- config: Object.assign({ say }, rephraseWithAIParams)
2509
+ config: Object.assign({ preventTranscript, say }, rephraseWithAIParams)
2502
2510
  });
2503
2511
  if (config.type === "date" && !config.datepicker_hidePicker) {
2504
2512
  showDatePicker(cognigy, config);
@@ -2514,7 +2522,7 @@ DO NOT talk about other topics. Do not offer general assistance.`,
2514
2522
  childConfigs: [],
2515
2523
  nodeId,
2516
2524
  organisationId,
2517
- config: Object.assign({ say }, rephraseWithAIParams)
2525
+ config: Object.assign({ preventTranscript, say }, rephraseWithAIParams)
2518
2526
  });
2519
2527
  if (config.type === "date" && !config.datepicker_hidePicker) {
2520
2528
  showDatePicker(cognigy, config);
@@ -47,6 +47,13 @@ export const SAY = createNodeDescriptor({
47
47
  ],
48
48
  },
49
49
  },
50
+ {
51
+ key: "preventTranscript",
52
+ type: "toggle",
53
+ defaultValue: false,
54
+ label: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__LABEL",
55
+ description: "UI__NODE_EDITOR__MESSAGE__SAY__FIELDS__PREVENT_TRANSCRIPT__DESCRIPTION",
56
+ },
50
57
  ...getRephraseWithAIFields(),
51
58
  ].filter(field => !!field),
52
59
  sections: [
@@ -58,12 +65,21 @@ export const SAY = createNodeDescriptor({
58
65
  fields: [
59
66
  "handoverOutput",
60
67
  ]
61
- }
68
+ },
69
+ {
70
+ key: "advanced",
71
+ label: "UI__NODE_EDITOR__MESSAGE__SAY__SECTIONS__ADVANCED__LABEL",
72
+ defaultCollapsed: true,
73
+ fields: [
74
+ "preventTranscript",
75
+ ],
76
+ },
62
77
  ].filter(section => !!section),
63
78
  form: [
64
79
  { type: "field", key: "say" },
65
80
  { type: "section", key: "aiEnhancedOutput" },
66
81
  { type: "section", key: "handoverSettings" },
82
+ { type: "section", key: "advanced" }
67
83
  ],
68
84
  preview: {
69
85
  key: "say",
@@ -121,6 +137,9 @@ export const SAY = createNodeDescriptor({
121
137
  if ((_a = _data === null || _data === void 0 ? void 0 : _data._cognigy) === null || _a === void 0 ? void 0 : _a._default) {
122
138
  delete _data._cognigy._default;
123
139
  }
140
+ if (config.preventTranscript) {
141
+ _data._cognigy = Object.assign(Object.assign({}, _data._cognigy), { _preventTranscript: true });
142
+ }
124
143
  outputText = yield rephraseSentenceWithAI(outputText, config, api, organisationId);
125
144
  yield api.say(outputText, _data, settings);
126
145
  }
@@ -145,11 +164,15 @@ export const SAY = createNodeDescriptor({
145
164
  else if ((_f = _cognigyDefault === null || _cognigyDefault === void 0 ? void 0 : _cognigyDefault[typeKey]) === null || _f === void 0 ? void 0 : _f.fallbackText) {
146
165
  _cognigyDefault[typeKey].fallbackText = yield rephraseSentenceWithAI(_cognigyDefault[typeKey].fallbackText, config, api, organisationId);
147
166
  }
167
+ const data = config.say;
168
+ if (config.preventTranscript) {
169
+ data._cognigy = Object.assign(Object.assign({}, data._cognigy), { _preventTranscript: true });
170
+ }
148
171
  /**
149
172
  * This is a say node which is set to a type other than 'text' -
150
173
  * so we have one of the new rich-media types such as 'gallery'
151
174
  */
152
- yield api.say(null, config.say, settings);
175
+ yield api.say(null, data, settings);
153
176
  }
154
177
  }),
155
178
  });
@@ -625,7 +625,7 @@ export const GPT_PROMPT = createNodeDescriptor({
625
625
  }
626
626
  });
627
627
  try {
628
- const isStreamingChannel = input.channel === "webchat3";
628
+ const isStreamingChannel = input.channel === "webchat3" || input.channel === "adminconsole";
629
629
  const _messageId = randomUUID();
630
630
  const data = {
631
631
  prompt,
@@ -74,7 +74,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
74
74
  {
75
75
  key: "description",
76
76
  label: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__FIELDS__JOB_DESCRIPTION__LABEL",
77
- type: "cognigyText",
77
+ type: "cognigyLLMText",
78
78
  defaultValue: "You resolve customer issues, ensure a positive experience, troubleshoot problems, and escalate complex cases as needed. You provide product guidance, communicate effectively, and stay calm under pressure.",
79
79
  params: {
80
80
  required: false,
@@ -88,7 +88,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
88
88
  description: "UI__NODE_EDITOR__SERVICE__AI_AGENT_JOB__FIELDS__INSCTRUCTIONS__DESCRIPTION",
89
89
  defaultValue: `- Pretend to be an expert in your area.
90
90
  - Never answer questions that are outside your job.`,
91
- type: "cognigyText",
91
+ type: "cognigyLLMText",
92
92
  params: {
93
93
  required: false,
94
94
  rows: 5,
@@ -790,7 +790,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
790
790
  ],
791
791
  tags: ["ai", "aiAgent"],
792
792
  function: ({ cognigy, config, childConfigs, nodeId }) => __awaiter(void 0, void 0, void 0, function* () {
793
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
793
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
794
794
  const { api, context, input, profile, flowReferenceId } = cognigy;
795
795
  const { aiAgent, llmProviderReferenceId, name: jobName, description: jobDescription, instructions: jobInstructions, outputImmediately, toolChoice, useStrict, memoryType, selectedProfileFields, memoryContextInjection, knowledgeSearchBehavior, knowledgeSearchTags, knowledgeSearchTagsFilterOp, knowledgeSearchAiAgentKnowledge, knowledgeSearchJobKnowledge, knowledgeSearchJobStore, knowledgeSearchGenerateSearchPrompt, knowledgeSearchTopK, timeoutInMs, maxTokens, temperature, logErrorToSystem, storeErrorInInput, errorHandling, errorHandlingGotoTarget, errorMessage, debugConfig, debugLogTokenCount, debugResult, storeLocation, contextKey, inputKey, streamStoreCopyInInput, streamStopTokens, processImages, transcriptImageHandling, sessionParams } = config;
796
796
  try {
@@ -836,7 +836,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
836
836
  throw new Error(`[VG2] Error on AI Agent Job node. Error message: ${error.message}`);
837
837
  }
838
838
  }
839
- const _11 = profile, { profileId, accepted_gdpr, prevent_data_collection, privacy_policy } = _11, cleanedProfile = __rest(_11, ["profileId", "accepted_gdpr", "prevent_data_collection", "privacy_policy"]);
839
+ const _13 = profile, { profileId, accepted_gdpr, prevent_data_collection, privacy_policy } = _13, cleanedProfile = __rest(_13, ["profileId", "accepted_gdpr", "prevent_data_collection", "privacy_policy"]);
840
840
  const userMemory = getUserMemory(memoryType, selectedProfileFields, aiAgent, cleanedProfile);
841
841
  /**
842
842
  * ----- Knowledge Search Section -----
@@ -952,26 +952,35 @@ export const AI_AGENT_JOB = createNodeDescriptor({
952
952
  }
953
953
  }
954
954
  // ----- End of Knowledge Search Section ----- //
955
+ const isOnDemandKnowledgeStoreConfigured = knowledgeSearchBehavior === "onDemand" && ((knowledgeSearchAiAgentKnowledge && aiAgent.knowledgeReferenceId) || (knowledgeSearchJobKnowledge && knowledgeSearchJobStore));
955
956
  // create the system Message from the AI Agent resource and this Node's config storage
956
- const systemMessage = createSystemMessage(aiAgent, input, jobName, jobDescription, jobInstructions, userMemory, memoryContextInjection, knowledgeSearchBehavior);
957
+ const systemMessage = createSystemMessage(aiAgent, input, jobName, jobDescription, jobInstructions, userMemory, memoryContextInjection, isOnDemandKnowledgeStoreConfigured ? "onDemand" : "none");
957
958
  // Create Tools JSON
958
959
  const tools = [];
959
960
  const toolIds = [];
960
961
  childConfigs.forEach(child => {
962
+ if (child.type === "aiAgentJobDefault") {
963
+ return;
964
+ }
965
+ ;
961
966
  const toolId = child.config.toolId;
962
- if (!validateToolId(toolId)) {
963
- throw new Error(`Tool ID ${toolId} is not valid. Please use only alphanumeric characters, dashes and underscores.`);
967
+ if (!toolId) {
968
+ throw new Error(`Tool ID is missing in Tool Node configuration.`);
969
+ }
970
+ const parsedToolId = api.parseCognigyScriptText(toolId);
971
+ if (!validateToolId(parsedToolId)) {
972
+ throw new Error(`Tool ID ${parsedToolId} is not valid. Please use only alphanumeric characters, dashes and underscores.`);
964
973
  }
965
- if (toolIds.includes(toolId)) {
966
- throw new Error(`Tool ID ${toolId} is not unique. Please ensure each tool has a unique id.`);
974
+ if (toolIds.includes(parsedToolId)) {
975
+ throw new Error(`Tool ID ${parsedToolId} is not unique. Please ensure each tool has a unique id.`);
967
976
  }
968
- toolIds.push(toolId);
977
+ toolIds.push(parsedToolId);
969
978
  if (child.type === "aiAgentJobTool" && (!child.config.condition || !!api.parseCognigyScriptCondition(child.config.condition))) {
970
979
  const tool = {
971
980
  type: "function",
972
981
  function: {
973
- name: toolId,
974
- description: child.config.description,
982
+ name: parsedToolId,
983
+ description: api.parseCognigyScriptText(child.config.description),
975
984
  }
976
985
  };
977
986
  if (useStrict) {
@@ -1051,7 +1060,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1051
1060
  }
1052
1061
  // keep this after the debug message since the "retrieve_knowledge" tool is implicit
1053
1062
  // we only add this tool if at least one knowledge source is enabled
1054
- if (knowledgeSearchBehavior === "onDemand" && ((knowledgeSearchAiAgentKnowledge && aiAgent.knowledgeReferenceId) || (knowledgeSearchJobKnowledge && knowledgeSearchJobStore))) {
1063
+ if (isOnDemandKnowledgeStoreConfigured) {
1055
1064
  const knowledgeTool = {
1056
1065
  type: "function",
1057
1066
  function: {
@@ -1094,7 +1103,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1094
1103
  const enhancedInput = `## Knowledge Source Context\nAdditional Context from the knowledge source: \n${JSON.stringify(knowledgeSearchResponseData)}\n\n\n${((_u = userInput === null || userInput === void 0 ? void 0 : userInput.payload) === null || _u === void 0 ? void 0 : _u.text) || input.text}`;
1095
1104
  transcript[transcript.length - 1].payload.text = enhancedInput;
1096
1105
  }
1097
- const isStreamingChannel = input.channel === "webchat3";
1106
+ const isStreamingChannel = input.channel === "webchat3" || input.channel === "adminconsole";
1098
1107
  const _messageId = randomUUID();
1099
1108
  const llmPromptOptions = Object.assign(Object.assign({ prompt: "", chat: systemMessage,
1100
1109
  // Temp fix to override the transcript if needed
@@ -1137,7 +1146,10 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1137
1146
  if (llmResult.finishReason === "tool_calls" && llmResult.toolCalls.length > 0) {
1138
1147
  const mainToolCall = llmResult.toolCalls[0];
1139
1148
  // Find the child node with the toolId of the tool call
1140
- const toolChild = childConfigs.find(child => { var _a; return child.type === "aiAgentJobTool" && ((_a = child.config) === null || _a === void 0 ? void 0 : _a.toolId) === mainToolCall.function.name; });
1149
+ const toolChild = childConfigs.find(child => { var _a, _b; return child.type === "aiAgentJobTool" && ((_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; });
1150
+ if (toolChild === undefined) {
1151
+ (_z = api.logDebugError) === null || _z === void 0 ? void 0 : _z.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");
1152
+ }
1141
1153
  // Add last tool call to session state for loading it from Tool Answer Node
1142
1154
  api.updateSessionStateValues({
1143
1155
  lastToolCall: {
@@ -1151,13 +1163,13 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1151
1163
  });
1152
1164
  // if there are any parameters/arguments, add them to the input slots
1153
1165
  if (mainToolCall.function.arguments) {
1154
- input.aiAgent = Object.assign(Object.assign({}, input.aiAgent), { toolArgs: Object.assign(Object.assign({}, (_0 = (_z = input.aiAgent) === null || _z === void 0 ? void 0 : _z.toolArgs) !== null && _0 !== void 0 ? _0 : {}), mainToolCall.function.arguments) });
1166
+ input.aiAgent = Object.assign(Object.assign({}, input.aiAgent), { toolArgs: Object.assign(Object.assign({}, (_1 = (_0 = input.aiAgent) === null || _0 === void 0 ? void 0 : _0.toolArgs) !== null && _1 !== void 0 ? _1 : {}), mainToolCall.function.arguments) });
1155
1167
  }
1156
1168
  // Debug Message for Tool Calls, configured in the Tool Node
1157
- if (toolChild === null || toolChild === void 0 ? void 0 : toolChild.config.debugMessage) {
1158
- const messageLines = [`<b>UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER:</b> ${toolChild.config.toolId}`];
1169
+ if ((_2 = toolChild === null || toolChild === void 0 ? void 0 : toolChild.config) === null || _2 === void 0 ? void 0 : _2.debugMessage) {
1170
+ const messageLines = [`<b>UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER:</b> ${api.parseCognigyScriptText(toolChild.config.toolId)}`];
1159
1171
  // Arguments / Parameters Slots
1160
- const slots = ((_1 = mainToolCall === null || mainToolCall === void 0 ? void 0 : mainToolCall.function) === null || _1 === void 0 ? void 0 : _1.arguments) && Object.keys(mainToolCall.function.arguments);
1172
+ const slots = ((_3 = mainToolCall === null || mainToolCall === void 0 ? void 0 : mainToolCall.function) === null || _3 === void 0 ? void 0 : _3.arguments) && Object.keys(mainToolCall.function.arguments);
1161
1173
  const hasSlots = slots && slots.length > 0;
1162
1174
  messageLines.push(`<b>UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__SLOTS</b>${hasSlots ? "" : " -"}`);
1163
1175
  if (hasSlots) {
@@ -1172,7 +1184,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1172
1184
  messageLines.push(`- ${slot}: ${slotValueAsString}`);
1173
1185
  });
1174
1186
  }
1175
- (_2 = api.logDebugMessage) === null || _2 === void 0 ? void 0 : _2.call(api, messageLines.join("\n"), "UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER");
1187
+ (_4 = api.logDebugMessage) === null || _4 === void 0 ? void 0 : _4.call(api, messageLines.join("\n"), "UI__DEBUG_MODE__AI_AGENT_JOB__TOOL_CALL__DEBUG_MESSAGE__HEADER");
1176
1188
  }
1177
1189
  if (toolChild) {
1178
1190
  api.setNextNode(toolChild.id);
@@ -1197,7 +1209,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1197
1209
  }
1198
1210
  // Optionally output the result immediately
1199
1211
  if (llmResult.result && outputImmediately && !llmPromptOptions.stream) {
1200
- yield ((_3 = api.output) === null || _3 === void 0 ? void 0 : _3.call(api, llmResult.result, {}));
1212
+ yield ((_5 = api.output) === null || _5 === void 0 ? void 0 : _5.call(api, llmResult.result, {}));
1201
1213
  }
1202
1214
  // If we are streaming and we got a result, also store it into the transcript, since streamed chunks are not stored there
1203
1215
  if (llmResult.result && llmPromptOptions.stream) {
@@ -1214,7 +1226,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1214
1226
  }
1215
1227
  // Add response to Cognigy Input/Context for further usage
1216
1228
  if (storeLocation === "context") {
1217
- (_4 = api.addToContext) === null || _4 === void 0 ? void 0 : _4.call(api, contextKey, llmResult, "simple");
1229
+ (_6 = api.addToContext) === null || _6 === void 0 ? void 0 : _6.call(api, contextKey, llmResult, "simple");
1218
1230
  }
1219
1231
  else if (storeLocation === "input") {
1220
1232
  api.addToInput(inputKey, llmResult);
@@ -1227,14 +1239,14 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1227
1239
  const errorDetails = {
1228
1240
  name: (error === null || error === void 0 ? void 0 : error.name) || "Error",
1229
1241
  code: (error === null || error === void 0 ? void 0 : error.code) || (error === null || error === void 0 ? void 0 : error.httpStatusCode),
1230
- message: (error === null || error === void 0 ? void 0 : error.message) || ((_5 = error.originalErrorDetails) === null || _5 === void 0 ? void 0 : _5.message),
1242
+ message: (error === null || error === void 0 ? void 0 : error.message) || ((_7 = error.originalErrorDetails) === null || _7 === void 0 ? void 0 : _7.message),
1231
1243
  };
1232
- (_6 = api.emitEvent) === null || _6 === void 0 ? void 0 : _6.call(api, "nodeError", { nodeId, flowId: flowReferenceId, errorMessage: error });
1244
+ (_8 = api.emitEvent) === null || _8 === void 0 ? void 0 : _8.call(api, "nodeError", { nodeId, flowId: flowReferenceId, errorMessage: error });
1233
1245
  if (logErrorToSystem) {
1234
- (_7 = api.log) === null || _7 === void 0 ? void 0 : _7.call(api, "error", JSON.stringify(errorDetails));
1246
+ (_9 = api.log) === null || _9 === void 0 ? void 0 : _9.call(api, "error", JSON.stringify(errorDetails));
1235
1247
  }
1236
1248
  if (errorHandling !== "stop") {
1237
- (_8 = api.logDebugError) === null || _8 === void 0 ? void 0 : _8.call(api, errorDetails.message + (errorDetails.code ? ` (error code: ${errorDetails.code})` : ""), errorDetails.name);
1249
+ (_10 = api.logDebugError) === null || _10 === void 0 ? void 0 : _10.call(api, errorDetails.message + (errorDetails.code ? ` (error code: ${errorDetails.code})` : ""), errorDetails.name);
1238
1250
  }
1239
1251
  if (storeErrorInInput) {
1240
1252
  input.aiAgent = input.aiAgent || {};
@@ -1243,7 +1255,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1243
1255
  if (errorHandling === "continue") {
1244
1256
  // output the timeout message
1245
1257
  if (errorMessage) {
1246
- yield ((_9 = api.output) === null || _9 === void 0 ? void 0 : _9.call(api, errorMessage, null));
1258
+ yield ((_11 = api.output) === null || _11 === void 0 ? void 0 : _11.call(api, errorMessage, null));
1247
1259
  }
1248
1260
  // Set default node as next node
1249
1261
  const defaultChild = childConfigs.find(child => child.type === "aiAgentJobDefault");
@@ -1255,7 +1267,7 @@ export const AI_AGENT_JOB = createNodeDescriptor({
1255
1267
  if (!errorHandlingGotoTarget) {
1256
1268
  throw new Error("GoTo Target is required");
1257
1269
  }
1258
- if (!((_10 = api.checkThink) === null || _10 === void 0 ? void 0 : _10.call(api, nodeId))) {
1270
+ if (!((_12 = api.checkThink) === null || _12 === void 0 ? void 0 : _12.call(api, nodeId))) {
1259
1271
  api.resetNextNodes();
1260
1272
  yield api.executeFlow({
1261
1273
  flowNode: {
@@ -17,6 +17,26 @@ export const CHECK_AGENT_AVAILABILITY = createNodeDescriptor({
17
17
  },
18
18
  tags: ["service"],
19
19
  fields: [
20
+ {
21
+ key: "checkAgentAvailabilityProvider",
22
+ label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__HANDOVER_PROVIDER__LABEL",
23
+ type: "checkAgentAvailabilityProvider",
24
+ description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__HANDOVER_PROVIDER__DESCRIPTION",
25
+ defaultValue: "legacyEndpoint",
26
+ params: {
27
+ required: true,
28
+ },
29
+ },
30
+ {
31
+ key: "checkAgentAvailabilityConfig",
32
+ label: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__HANDOVER_PROVIDER__LABEL",
33
+ type: "json",
34
+ description: "UI__NODE_EDITOR__SERVICE__HANDOVER_TO_AGENT__FIELDS__HANDOVER_PROVIDER__DESCRIPTION",
35
+ defaultValue: {},
36
+ params: {
37
+ required: true,
38
+ },
39
+ },
20
40
  {
21
41
  key: "chatwootInboxId",
22
42
  type: "cognigyText",
@@ -151,7 +171,20 @@ export const CHECK_AGENT_AVAILABILITY = createNodeDescriptor({
151
171
  defaultCollapsed: true,
152
172
  fields: [
153
173
  "chatwootInboxId",
154
- ]
174
+ ],
175
+ condition: {
176
+ or: [
177
+ {
178
+ key: "checkAgentAvailabilityProvider",
179
+ value: "legacyEndpoint"
180
+ },
181
+ {
182
+ key: "checkAgentAvailabilityProvider",
183
+ // @ts-ignore
184
+ value: null
185
+ }
186
+ ]
187
+ }
155
188
  },
156
189
  {
157
190
  key: "liveAgentSettings",
@@ -161,7 +194,20 @@ export const CHECK_AGENT_AVAILABILITY = createNodeDescriptor({
161
194
  COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.LIVE_AGENT_INBOX_ID,
162
195
  COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.LIVE_AGENT_SKILLS,
163
196
  COGNIGY_LIVE_AGENT_DESCRIPTOR_FIELDS.LIVE_AGENT_LANGUAGES,
164
- ]
197
+ ],
198
+ condition: {
199
+ or: [
200
+ {
201
+ key: "checkAgentAvailabilityProvider",
202
+ value: "legacyEndpoint"
203
+ },
204
+ {
205
+ key: "checkAgentAvailabilityProvider",
206
+ // @ts-ignore
207
+ value: null
208
+ }
209
+ ]
210
+ }
165
211
  },
166
212
  {
167
213
  key: "genesysCloudSettings",
@@ -171,7 +217,20 @@ export const CHECK_AGENT_AVAILABILITY = createNodeDescriptor({
171
217
  "genesysCloudSkills",
172
218
  "genesysCloudProfileSkills",
173
219
  "genesysCloudLanguageSkills"
174
- ]
220
+ ],
221
+ condition: {
222
+ or: [
223
+ {
224
+ key: "checkAgentAvailabilityProvider",
225
+ value: "legacyEndpoint"
226
+ },
227
+ {
228
+ key: "checkAgentAvailabilityProvider",
229
+ // @ts-ignore
230
+ value: null
231
+ }
232
+ ]
233
+ }
175
234
  },
176
235
  {
177
236
  key: "storage",
@@ -195,6 +254,7 @@ export const CHECK_AGENT_AVAILABILITY = createNodeDescriptor({
195
254
  }
196
255
  ],
197
256
  form: [
257
+ { type: "field", key: "checkAgentAvailabilityProvider" },
198
258
  { type: "section", key: "genesysCloudSettings" },
199
259
  // only render this field if "live agent" is enabled
200
260
  process.env.FEATURE_USE_COGNIGY_LIVE_AGENT === "true" && {