@cognigy/rest-api-client 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/build/GenericTusFn.js +64 -0
- package/build/RestAPIClient.js +3 -0
- package/build/apigroups/AdministrationAPIGroup_2_0.js +7 -2
- package/build/apigroups/ResourcesAPIGroup_2_0.js +28 -23
- package/build/{shared/interfaces/agentAssist/ISendTileUpdateReferenceParams.js → apigroups/TTusAPIOperation.js} +1 -1
- package/build/apigroups/index.js +2 -0
- package/build/connector/AxiosAdapter.js +5 -4
- package/build/shared/charts/descriptors/agentAssist/constants/constants.js +7 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/sentiment.helper.js +41 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/identityAssistTemplate.js +54 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/knowledgeAssistTemplate.js +203 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/nextActionWidgetTemplate.js +93 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage0.js +81 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage1.js +84 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stage2.js +97 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/secureForms/stageError.js +85 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/sentimentAnalysisTemplate.js +41 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/stylesPartial.js +15 -0
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/transcriptAssistTemplate.js +53 -0
- package/build/shared/charts/descriptors/agentAssist/identityAssist.js +135 -0
- package/build/shared/charts/descriptors/agentAssist/index.js +15 -1
- package/build/shared/charts/descriptors/agentAssist/knowledgeAssist.js +625 -0
- package/build/shared/charts/descriptors/agentAssist/nextActionAssist.js +77 -0
- package/build/shared/charts/descriptors/agentAssist/sentimentAssist.js +86 -0
- package/build/shared/charts/descriptors/agentAssist/setAdaptiveCardTile.js +2 -2
- package/build/shared/charts/descriptors/agentAssist/setAgentAssistGrid.js +120 -0
- package/build/shared/charts/descriptors/agentAssist/setHtmlTile.js +2 -2
- package/build/shared/charts/descriptors/agentAssist/setIframeTile.js +2 -2
- package/build/shared/charts/descriptors/agentAssist/setSecureFormsTile.js +171 -0
- package/build/shared/charts/descriptors/agentAssist/transcriptAssist.js +72 -0
- package/build/shared/charts/descriptors/allFields.js +12 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/TGenerativeAIConnectionFields.js +3 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/alephAlphaProviderConnection.js +11 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/anthropicProviderConnection.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnectionV2.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +6 -2
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAIProviderConnection.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/amazonStorageProviderConnection.js +4 -4
- package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/azureBlobStorageProviderConnection.js +3 -3
- package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/googleCloudStorageProviderConnection.js +3 -3
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/mongoDBConnection.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/smtp/oAuth2Connection.js +8 -8
- package/build/shared/charts/descriptors/connectionNodes/smtp/serviceConnection.js +2 -2
- package/build/shared/charts/descriptors/connectionNodes/smtp/smtpConnection.js +5 -5
- package/build/shared/charts/descriptors/connectionNodes/speechProviders/awsSpeechProviderConnection.js +4 -4
- package/build/shared/charts/descriptors/connectionNodes/speechProviders/microsoftSpeechProviderConnection.js +2 -2
- package/build/shared/charts/descriptors/connectionNodes/sql/sqlConnection.js +5 -5
- package/build/shared/charts/descriptors/connectionNodes/translationProviders/deeplTranslationProviderConnection.js +15 -0
- package/build/shared/charts/descriptors/connectionNodes/translationProviders/googleTranslationProviderConnection.js +15 -0
- package/build/shared/charts/descriptors/connectionNodes/translationProviders/index.js +23 -0
- package/build/shared/charts/descriptors/connectionNodes/translationProviders/microsoftTranslationProviderConnection.js +21 -0
- package/build/shared/charts/descriptors/index.js +13 -2
- package/build/shared/charts/descriptors/knowledgeSearch/constants/constants.js +6 -0
- package/build/shared/charts/descriptors/knowledgeSearch/index.js +5 -1
- package/build/shared/charts/descriptors/knowledgeSearch/knowledgeSearch.js +7 -2
- package/build/shared/charts/descriptors/knowledgeSearch/knowledgeSearchV2.js +151 -0
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +985 -0
- package/build/shared/charts/descriptors/logic/goTo.js +2 -0
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +2 -2
- package/build/shared/charts/descriptors/message/question/question.js +215 -8
- package/build/shared/charts/descriptors/nlu/cleanText.js +1 -0
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/prompt.js +107 -5
- package/build/shared/charts/descriptors/service/GPTConversation.js +125 -23
- package/build/shared/charts/descriptors/service/GPTPrompt.js +148 -12
- package/build/shared/charts/descriptors/service/checkAgentAvailability.js +15 -1
- package/build/shared/charts/descriptors/service/handoverV2.js +45 -0
- package/build/shared/{interfaces/twilioInterface.js → charts/descriptors/voice/interface/IBandwidth.js} +1 -1
- package/build/shared/charts/descriptors/voice/mappers/base.mapper.js +14 -0
- package/build/shared/charts/descriptors/voice/mappers/hangup.mapper.js +26 -0
- package/build/shared/charts/descriptors/voice/mappers/muteSpeechInput.mapper.js +17 -2
- package/build/shared/charts/descriptors/voice/mappers/play.mapper.js +54 -0
- package/build/shared/charts/descriptors/voice/mappers/record.mapper.js +7 -0
- package/build/shared/charts/descriptors/voice/mappers/sendMetadata.mapper.js +15 -0
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +56 -20
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +39 -13
- package/build/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/play.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +120 -29
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +11 -3
- package/build/shared/charts/descriptors/voice/utils/vgConstants.js +14 -0
- package/build/shared/charts/descriptors/voicegateway/index.js +14 -11
- package/build/shared/charts/descriptors/voicegateway/utils/paramUtils.js +1 -5
- package/build/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +12 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +6 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +159 -36
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +296 -43
- package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +30 -4
- package/build/shared/charts/helpers/generativeAI/rephraseSentenceWithAi.js +1 -1
- package/build/shared/constants.js +5 -1
- package/build/shared/handoverClients/interfaces/THandoverEventType.js +3 -1
- package/build/shared/helper/BaseContext.js +33 -15
- package/build/shared/helper/nlu/textCleaner.js +25 -3
- package/build/shared/interfaces/IEndpointTranslationSettings.js +9 -0
- package/build/shared/interfaces/IOrganisation.js +2 -1
- package/build/shared/interfaces/agentAssist/ISendConfigUpdateParams.js +3 -0
- package/build/shared/interfaces/agentAssist/ISendUpdateReferenceParams.js +3 -0
- package/build/shared/interfaces/amqpInterface.js +18 -22
- package/build/shared/interfaces/channels/genesysBotConnector.js +21 -0
- package/build/shared/interfaces/channels/niceCXOne.js +8 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +17 -7
- package/build/shared/interfaces/handover.js +57 -3
- package/build/shared/interfaces/journeys/IJourney.js +6 -0
- package/build/shared/interfaces/journeys/IJourneyTrackEvent.js +2 -0
- package/build/shared/interfaces/messageAPI/endpoints.js +93 -8
- package/build/shared/interfaces/messageAPI/handover.js +4 -4
- package/build/shared/interfaces/resources/IAuditEvent.js +1 -0
- package/build/shared/interfaces/resources/IConnectionSchema.js +3 -0
- package/build/shared/interfaces/resources/IEndpoint.js +1 -0
- package/build/shared/interfaces/resources/IExtension.js +3 -0
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +24 -5
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +24 -1
- package/build/shared/interfaces/resources/TNLUConnectorType.js +0 -1
- package/build/shared/interfaces/resources/TRestChannelType.js +16 -11
- package/build/shared/interfaces/resources/TSocketChannelType.js +5 -1
- package/build/shared/interfaces/resources/TWebhookChannelType.js +6 -1
- package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeChunk.js +21 -3
- package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +13 -2
- package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeStore.js +1 -1
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +3 -23
- package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +4 -0
- package/build/shared/interfaces/resources/settings/ITranslationSettings.js +63 -0
- package/build/shared/interfaces/resources/settings/index.js +4 -1
- package/build/shared/interfaces/restAPI/administration/voiceGateway/v2.0/IReadVoiceGatewayAccountRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/voiceGateway/v2.0/ISetupVoiceGatewayAccountRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/voiceGateway/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/ICallCounterAggregatedValue_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/IGetCallCounterOrganisationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/IGetCallCounterRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/callCounter/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/IGetKnowledgeQueryCounterOrganisationRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/IGetKnowledgeQueryCounterRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/IKnowlegeQueryCounterAggregatedValue_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/metrics/knowledgeQueryCounter/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/nluconnector/v2.0/TNLUConnectorType_2_0.js +0 -2
- package/build/shared/interfaces/restAPI/resources/uploadResumable/v2.0/IUploadResumableRest_2_0.js +17 -0
- package/build/shared/interfaces/restAPI/resources/uploadResumable/v2.0/index.js +3 -0
- package/build/shared/interfaces/security/ICallCounterAggregatedValue.js +3 -0
- package/build/shared/interfaces/security/IKnowledgeQueryCounterAggregatedValue.js +3 -0
- package/build/shared/interfaces/security/IPermission.js +3 -0
- package/build/shared/interfaces/security/IRole.js +9 -1
- package/build/shared/interfaces/security/index.js +2 -1
- package/build/shared/interfaces/trainer/ITrainerRecord.js +2 -0
- package/build/test.js +27 -0
- package/package.json +19 -17
- package/types/index.d.ts +823 -140
|
@@ -0,0 +1,985 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SEARCH_EXTRACT_OUTPUT = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const logic_1 = require("../logic");
|
|
7
|
+
const prompt_1 = require("../nlu/generativeSlotFiller/prompt");
|
|
8
|
+
const errors_1 = require("../../../errors");
|
|
9
|
+
/**
|
|
10
|
+
* Returns the simplified english name for a language given a language code
|
|
11
|
+
*
|
|
12
|
+
* Example:
|
|
13
|
+
* getLanguageName("de-DE") => "German"
|
|
14
|
+
* getLanguageName("en-GB") => "English"
|
|
15
|
+
* getLanguageName("nl-BE") => "Dutch"
|
|
16
|
+
*
|
|
17
|
+
* For reference, see:
|
|
18
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames#using_type_language_with_languagedisplay
|
|
19
|
+
*/
|
|
20
|
+
const getLanguageName = (languageCode) => {
|
|
21
|
+
// remove the "region" part from language codes (e.g. en-US becomes en, the -US gets stripped)
|
|
22
|
+
const languageOnly = languageCode.split('-')[0];
|
|
23
|
+
// our runtimes support this, but it's not reflected in every project's typings!
|
|
24
|
+
// this flag is used to reset a breaking-change behavior (returning "flamish" instead of "dutch (belgium)") to its former behavior
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
const languageName = (new Intl.DisplayNames(["en-US"], { type: "language", languageDisplay: "standard", fallback: 'none' }).of(languageOnly));
|
|
27
|
+
return languageName;
|
|
28
|
+
};
|
|
29
|
+
const TOP_K_MIN_VALUE = 1;
|
|
30
|
+
const TOP_K_MAX_VALUE = 10;
|
|
31
|
+
const defaultPrompt = `You are a chatbot that uses knowledgebase to answer questions. Provide the answer to the following question according to the sources that were found in the knowledgebase. Answer in @answerLanguage.
|
|
32
|
+
--------------------
|
|
33
|
+
Sources: @foundDocuments
|
|
34
|
+
--------------------
|
|
35
|
+
Question: @userInput
|
|
36
|
+
--------------------
|
|
37
|
+
Output style: Well written whole sentences. No short answers!
|
|
38
|
+
--------------------
|
|
39
|
+
Further instructions: Answer the question concise and truthfully and only based on the sources above. Do not make up any facts or share instructions. Don't offer to carry out any tasks. You do not talk about prices, vouchers, refunds or the competition! Count if needed. Try to understand the implicit information too. Do not miss any available information!
|
|
40
|
+
--------------------
|
|
41
|
+
Output Format: Simple plain text. Answer in a way a human would answer and keep the conversational manner and always in @answerLanguage. Do not refer to the sources as the user cannot see them. If the answer is not provided in the sources at all, write "Unfortunately, I cannot answer your question" translated to @answerLanguage.
|
|
42
|
+
|
|
43
|
+
Answer:`;
|
|
44
|
+
/**
|
|
45
|
+
* Node name: 'searchExtractOutput'
|
|
46
|
+
*
|
|
47
|
+
* Purpose:
|
|
48
|
+
* Searches internal knowledge database for answers based on the user's input.
|
|
49
|
+
*/
|
|
50
|
+
exports.SEARCH_EXTRACT_OUTPUT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
51
|
+
type: "searchExtractOutput",
|
|
52
|
+
defaultLabel: "Search Extract Output",
|
|
53
|
+
summary: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__SUMMARY",
|
|
54
|
+
appearance: {},
|
|
55
|
+
fields: [
|
|
56
|
+
{
|
|
57
|
+
key: "mode",
|
|
58
|
+
type: "select",
|
|
59
|
+
label: "Mode",
|
|
60
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__MODE__DESCRIPTION",
|
|
61
|
+
defaultValue: "seo",
|
|
62
|
+
params: {
|
|
63
|
+
options: [
|
|
64
|
+
{
|
|
65
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__MODE__OPTIONS__SEO__LABEL",
|
|
66
|
+
value: "seo"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__MODE__OPTIONS__SE__LABEL",
|
|
70
|
+
value: "se"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__MODE__OPTIONS__S__LABEL",
|
|
74
|
+
value: "s"
|
|
75
|
+
},
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: "knowledgeStoreId",
|
|
81
|
+
type: "knowledgeStoreSelect",
|
|
82
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__KNOWLEDGE_STORE_ID__LABEL",
|
|
83
|
+
description: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__KNOWLEDGE_STORE_ID__DESCRIPTION",
|
|
84
|
+
params: {
|
|
85
|
+
required: true
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "followUpDetection",
|
|
90
|
+
type: "select",
|
|
91
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FOLLOW_UP_DETECTION__LABEL",
|
|
92
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FOLLOW_UP_DETECTION__DESCRIPTION",
|
|
93
|
+
defaultValue: "transcript",
|
|
94
|
+
params: {
|
|
95
|
+
options: [
|
|
96
|
+
{
|
|
97
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FOLLOW_UP_DETECTION__OPTIONS__NONE__LABEL",
|
|
98
|
+
value: "none"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FOLLOW_UP_DETECTION__OPTIONS__TRANSCRIPT__LABEL",
|
|
102
|
+
value: "transcript"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
key: "followUpDetectionSteps",
|
|
109
|
+
type: "slider",
|
|
110
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FOLLOW_UP_DETECTION_STEPS__LABEL",
|
|
111
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FOLLOW_UP_DETECTION_STEPS__DESCRIPTION",
|
|
112
|
+
defaultValue: 2,
|
|
113
|
+
params: {
|
|
114
|
+
min: 1,
|
|
115
|
+
max: 6,
|
|
116
|
+
step: 1
|
|
117
|
+
},
|
|
118
|
+
condition: {
|
|
119
|
+
key: "followUpDetection",
|
|
120
|
+
value: "transcript"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: "topK",
|
|
125
|
+
type: "slider",
|
|
126
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__TOP_K__LABEL",
|
|
127
|
+
description: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__TOP_K__DESCRIPTION",
|
|
128
|
+
defaultValue: 5,
|
|
129
|
+
params: {
|
|
130
|
+
required: true,
|
|
131
|
+
min: TOP_K_MIN_VALUE,
|
|
132
|
+
max: TOP_K_MAX_VALUE
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
key: "searchString",
|
|
137
|
+
type: "cognigyText",
|
|
138
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__SEARCH_STRING__LABEL",
|
|
139
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__SEARCH_STRING__DESCRIPTION",
|
|
140
|
+
defaultValue: "{{input.text}}",
|
|
141
|
+
params: {
|
|
142
|
+
required: true
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
key: "searchStoreLocation",
|
|
147
|
+
type: "select",
|
|
148
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__STORE_LOCATION__LABEL",
|
|
149
|
+
params: {
|
|
150
|
+
options: [
|
|
151
|
+
{
|
|
152
|
+
label: "default (input.knowledgeSearch)",
|
|
153
|
+
value: "default"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__STORE_LOCATION__INPUT__LABEL",
|
|
157
|
+
value: "input"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__STORE_LOCATION__CONTEXT__LABEL",
|
|
161
|
+
value: "context"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
required: true
|
|
165
|
+
},
|
|
166
|
+
defaultValue: "default"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
key: "searchStoreLocationInputKey",
|
|
170
|
+
type: "cognigyText",
|
|
171
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__INPUT_KEY__LABEL",
|
|
172
|
+
description: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__INPUT_KEY__DESCRIPTION",
|
|
173
|
+
defaultValue: "knowledgeSearch",
|
|
174
|
+
condition: {
|
|
175
|
+
key: "searchStoreLocation",
|
|
176
|
+
value: "input"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: "searchStoreLocationContextKey",
|
|
181
|
+
type: "cognigyText",
|
|
182
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__CONTEXT_KEY__LABEL",
|
|
183
|
+
description: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__CONTEXT_KEY__DESCRIPTION",
|
|
184
|
+
defaultValue: "knowledgeSearch",
|
|
185
|
+
condition: {
|
|
186
|
+
key: "searchStoreLocation",
|
|
187
|
+
value: "context"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
key: "searchSourceTags",
|
|
192
|
+
type: "knowledgeSourceTags",
|
|
193
|
+
label: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__SOURCE_TAGS__LABEL",
|
|
194
|
+
description: "UI__NODE_EDITOR__KNOWLEDGE_SEARCH__SOURCE_TAGS__DESCRIPTION",
|
|
195
|
+
params: {
|
|
196
|
+
tagLimit: 5
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
key: "prompt",
|
|
201
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__PROMPT__LABEL",
|
|
202
|
+
type: "cognigyText",
|
|
203
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__PROMPT__DESCRIPTION",
|
|
204
|
+
params: {
|
|
205
|
+
required: true,
|
|
206
|
+
multiline: true,
|
|
207
|
+
rows: 5
|
|
208
|
+
},
|
|
209
|
+
defaultValue: defaultPrompt
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
key: "temperature",
|
|
213
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__TEMPERATURE__LABEL",
|
|
214
|
+
type: "slider",
|
|
215
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__TEMPERATURE__DESCRIPTION",
|
|
216
|
+
defaultValue: 0.7,
|
|
217
|
+
params: {
|
|
218
|
+
min: 0,
|
|
219
|
+
max: 1,
|
|
220
|
+
step: 0.1
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
key: "maxTokens",
|
|
225
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__MAX_TOKENS__LABEL",
|
|
226
|
+
type: "slider",
|
|
227
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__MAX_TOKENS__DESCRIPTION",
|
|
228
|
+
defaultValue: 1000,
|
|
229
|
+
params: {
|
|
230
|
+
min: 100,
|
|
231
|
+
max: 4000,
|
|
232
|
+
step: 1
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
key: "frequencyPenalty",
|
|
237
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__FREQUENCY_PENALTY__LABEL",
|
|
238
|
+
type: "slider",
|
|
239
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__FREQUENCY_PENALTY__DESCRIPTION",
|
|
240
|
+
defaultValue: 0,
|
|
241
|
+
params: {
|
|
242
|
+
min: -2,
|
|
243
|
+
max: 2,
|
|
244
|
+
step: 0.1
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: "presencePenalty",
|
|
249
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__PRESENCE_PENALTY__LABEL",
|
|
250
|
+
type: "slider",
|
|
251
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__PRESENCE_PENALTY__DESCRIPTION",
|
|
252
|
+
defaultValue: 0,
|
|
253
|
+
params: {
|
|
254
|
+
min: -2,
|
|
255
|
+
max: 2,
|
|
256
|
+
step: 0.1
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
key: "useStop",
|
|
261
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__USE_STOP__LABEL",
|
|
262
|
+
type: "toggle",
|
|
263
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__USE_STOP__DESCRIPTION",
|
|
264
|
+
defaultValue: false
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
key: "stop",
|
|
268
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STOP__LABEL",
|
|
269
|
+
type: "textArray",
|
|
270
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STOP__DESCRIPTION",
|
|
271
|
+
condition: {
|
|
272
|
+
key: "useStop",
|
|
273
|
+
value: true
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
key: "timeout",
|
|
278
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__TIMEOUT__LABEL",
|
|
279
|
+
defaultValue: 5000,
|
|
280
|
+
type: "number",
|
|
281
|
+
description: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__TIMEOUT__DESCRIPTION",
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
key: "storeLocation",
|
|
285
|
+
type: "select",
|
|
286
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STORE_LOCATION__LABEL",
|
|
287
|
+
defaultValue: "input",
|
|
288
|
+
params: {
|
|
289
|
+
options: [
|
|
290
|
+
{
|
|
291
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STORE_LOCATION__OPTIONS__INPUT__LABEL",
|
|
292
|
+
value: "input"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__STORE_LOCATION__OPTIONS__CONTEXT__LABEL",
|
|
296
|
+
value: "context"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
required: true
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
key: "inputKey",
|
|
304
|
+
type: "cognigyText",
|
|
305
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__INPUT_KEY__LABEL",
|
|
306
|
+
defaultValue: "promptResult",
|
|
307
|
+
condition: {
|
|
308
|
+
key: "storeLocation",
|
|
309
|
+
value: "input",
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
key: "contextKey",
|
|
314
|
+
type: "cognigyText",
|
|
315
|
+
label: "UI__NODE_EDITOR__SERVICE__GPT_PROMPT__FIELDS__CONTEXT_KEY__LABEL",
|
|
316
|
+
defaultValue: "promptResult",
|
|
317
|
+
condition: {
|
|
318
|
+
key: "storeLocation",
|
|
319
|
+
value: "context",
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
key: "outputMode",
|
|
324
|
+
type: "select",
|
|
325
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__OUTPUT_MODE__LABEL",
|
|
326
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__OUTPUT_MODE__DESCRIPTION",
|
|
327
|
+
defaultValue: "text",
|
|
328
|
+
params: {
|
|
329
|
+
options: [
|
|
330
|
+
{
|
|
331
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__OUTPUT_MODE__OPTIONS__TEXT__LABEL",
|
|
332
|
+
value: "text"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__OUTPUT_MODE__OPTIONS__STREAM__LABEL",
|
|
336
|
+
value: "stream"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__OUTPUT_MODE__OPTIONS__ADAPTIVE_CARD__LABEL",
|
|
340
|
+
value: "adaptiveCard"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
key: "outputFallback",
|
|
347
|
+
type: "cognigyText",
|
|
348
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__OUTPUT_FALLBACK__LABEL",
|
|
349
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__OUTPUT_FALLBACK__DESCRIPTION",
|
|
350
|
+
defaultValue: "Sorry, I could not find an answer to your question."
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
key: "errorHandling",
|
|
354
|
+
type: "select",
|
|
355
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__HANDLE_SERVICE_ERROR__LABEL",
|
|
356
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__HANDLE_SERVICE_ERROR__DESCRIPTION",
|
|
357
|
+
defaultValue: "stop",
|
|
358
|
+
params: {
|
|
359
|
+
options: [
|
|
360
|
+
{
|
|
361
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__HANDLE_SERVICE_ERROR__OPTIONS__STOP__LABEL",
|
|
362
|
+
value: "stop"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__HANDLE_SERVICE_ERROR__OPTIONS__CONTINUE__LABEL",
|
|
366
|
+
value: "continue"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__HANDLE_SERVICE_ERROR__OPTIONS__GOTO__LABEL",
|
|
370
|
+
value: "goto"
|
|
371
|
+
},
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
key: "timeoutMessage",
|
|
377
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__ERROR_MESSAGE__LABEL",
|
|
378
|
+
type: "cognigyText",
|
|
379
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__ERROR_MESSAGE__DESCRIPTION",
|
|
380
|
+
defaultValue: "I'm very sorry, but I am having some technical difficulties right now. Please try again.",
|
|
381
|
+
condition: {
|
|
382
|
+
key: "errorHandling",
|
|
383
|
+
value: "continue"
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
key: "errorHandlingGotoTarget",
|
|
388
|
+
type: "flowNode",
|
|
389
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__ERROR__GOTO_NODE__LABEL",
|
|
390
|
+
condition: {
|
|
391
|
+
key: "errorHandling",
|
|
392
|
+
value: "goto"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
key: "streamStopTokens",
|
|
397
|
+
type: "textArray",
|
|
398
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__STREAM_STOP_TOKENS__LABEL",
|
|
399
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__STREAM_STOP_TOKENS__DESCRIPTION",
|
|
400
|
+
defaultValue: [".", "!", "?"],
|
|
401
|
+
condition: {
|
|
402
|
+
key: "outputMode",
|
|
403
|
+
value: "stream",
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
key: "streamDescription",
|
|
408
|
+
type: "description",
|
|
409
|
+
label: " ",
|
|
410
|
+
params: {
|
|
411
|
+
text: "Please note streaming may not be supported by all LLM providers. If streaming is not supported, the result is written to the Input object."
|
|
412
|
+
},
|
|
413
|
+
condition: {
|
|
414
|
+
key: "outputMode",
|
|
415
|
+
value: "stream",
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
key: "debugLogTokenCount",
|
|
420
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__DEBUGLOGTOKENCOUNT__LABEL",
|
|
421
|
+
type: "toggle",
|
|
422
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__DEBUGLOGTOKENCOUNT__DESCRIPTION",
|
|
423
|
+
defaultValue: false
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
key: "debugLogRequestAndCompletion",
|
|
427
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__DEBUGLOGREQUESTANDCOMPLETION__LABEL",
|
|
428
|
+
type: "toggle",
|
|
429
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__FIELDS__DEBUGLOGREQUESTANDCOMPLETION__DESCRIPTION",
|
|
430
|
+
defaultValue: false
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
key: "debugDescription",
|
|
434
|
+
type: "description",
|
|
435
|
+
label: " ",
|
|
436
|
+
params: {
|
|
437
|
+
text: "For performance reasons, debug logging will only be active when testing from Interaction Panel."
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
key: "searchStringDescription",
|
|
442
|
+
type: "description",
|
|
443
|
+
label: " ",
|
|
444
|
+
params: {
|
|
445
|
+
text: "Please note that manipulating this may impact the extraction prompt as well."
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
sections: [
|
|
450
|
+
{
|
|
451
|
+
key: "searchSettings",
|
|
452
|
+
label: "Search Settings",
|
|
453
|
+
defaultCollapsed: true,
|
|
454
|
+
fields: ["followUpDetection", "followUpDetectionSteps", "searchString", "searchStringDescription", "topK", "searchStoreLocation", "searchStoreWarning", "searchStoreLocationInputKey", "searchStoreLocationContextKey", "searchSourceTags"]
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
key: "extractSettings",
|
|
458
|
+
label: "Extract Settings",
|
|
459
|
+
description: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__SECTIONS__EXTRACT_SETTINGS__DESCRIPTION",
|
|
460
|
+
defaultCollapsed: true,
|
|
461
|
+
fields: [
|
|
462
|
+
"prompt",
|
|
463
|
+
"model",
|
|
464
|
+
"temperature",
|
|
465
|
+
"topP",
|
|
466
|
+
"maxTokens",
|
|
467
|
+
"presencePenalty",
|
|
468
|
+
"frequencyPenalty",
|
|
469
|
+
"useStop",
|
|
470
|
+
"stop",
|
|
471
|
+
"timeout",
|
|
472
|
+
],
|
|
473
|
+
condition: {
|
|
474
|
+
or: [
|
|
475
|
+
{
|
|
476
|
+
key: "mode",
|
|
477
|
+
value: "seo"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
key: "mode",
|
|
481
|
+
value: "se"
|
|
482
|
+
}
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
key: "outputSettings",
|
|
488
|
+
label: "Output Settings",
|
|
489
|
+
defaultCollapsed: true,
|
|
490
|
+
fields: ["outputMode", "streamDescription", "streamStopTokens", "outputFallback"],
|
|
491
|
+
condition: {
|
|
492
|
+
key: "mode",
|
|
493
|
+
value: "seo"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
key: "errorHandling",
|
|
498
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__SECTIONS__ERROR_HANDLING__LABEL",
|
|
499
|
+
defaultCollapsed: true,
|
|
500
|
+
fields: [
|
|
501
|
+
"errorHandling",
|
|
502
|
+
"timeoutMessage",
|
|
503
|
+
"errorHandlingGotoTarget",
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
key: "debugging",
|
|
508
|
+
label: "UI__NODE_EDITOR__SEARCH_EXTRACT_OUTPUT__SECTIONS__DEBUGGING__LABEL",
|
|
509
|
+
defaultCollapsed: true,
|
|
510
|
+
fields: [
|
|
511
|
+
"debugDescription",
|
|
512
|
+
"debugLogTokenCount",
|
|
513
|
+
"debugLogRequestAndCompletion"
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
],
|
|
517
|
+
form: [
|
|
518
|
+
{ type: "field", key: "mode" },
|
|
519
|
+
{ type: "field", key: "knowledgeStoreId" },
|
|
520
|
+
{ type: "section", key: "searchSettings" },
|
|
521
|
+
{ type: "section", key: "extractSettings" },
|
|
522
|
+
{ type: "section", key: "outputSettings" },
|
|
523
|
+
{ type: "section", key: "errorHandling" },
|
|
524
|
+
{ type: "section", key: "debugging" }
|
|
525
|
+
],
|
|
526
|
+
preview: {
|
|
527
|
+
key: "text",
|
|
528
|
+
type: "text"
|
|
529
|
+
},
|
|
530
|
+
tags: ["knowledgeSearch", "knowledge", "search"],
|
|
531
|
+
function: async (knowledgeSearchParams) => {
|
|
532
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
533
|
+
const { cognigy, config, nodeId } = knowledgeSearchParams;
|
|
534
|
+
const { input, api } = cognigy;
|
|
535
|
+
const { topK, searchString, searchStoreLocation, searchStoreLocationContextKey, searchStoreLocationInputKey, searchSourceTags, temperature, maxTokens, topP, presencePenalty, frequencyPenalty, useStop, stop, storeLocation, contextKey, inputKey, timeout, timeoutMessage, outputFallback, outputMode, mode, errorHandling, errorHandlingGotoTarget, streamStopTokens, followUpDetection, debugLogTokenCount, debugLogRequestAndCompletion } = config;
|
|
536
|
+
let { followUpDetectionSteps } = config;
|
|
537
|
+
let { prompt } = config;
|
|
538
|
+
// timeout message name not changed because of legacy compatibility
|
|
539
|
+
const errorMessage = timeoutMessage;
|
|
540
|
+
// #region 1 Perform Search
|
|
541
|
+
const knowledgeStoreId = (_a = config === null || config === void 0 ? void 0 : config.knowledgeStoreId) === null || _a === void 0 ? void 0 : _a.trim();
|
|
542
|
+
const { language, traceId } = input;
|
|
543
|
+
if (!knowledgeStoreId) {
|
|
544
|
+
throw new Error("Unable to perform knowledge search. No knowledge store was provided.");
|
|
545
|
+
}
|
|
546
|
+
if (!topK || topK < TOP_K_MIN_VALUE || topK > TOP_K_MAX_VALUE) {
|
|
547
|
+
throw new Error(`Unable to perform knowledge search. topK value of "${topK}" is invalid. Must be between or equal to ${TOP_K_MIN_VALUE} and ${TOP_K_MAX_VALUE}.`);
|
|
548
|
+
}
|
|
549
|
+
if (searchStoreLocation === "context" && !searchStoreLocationContextKey) {
|
|
550
|
+
throw new Error("Unable to perform knowledge search. Context Key is missing.");
|
|
551
|
+
}
|
|
552
|
+
if (searchStoreLocation === "input" && !searchStoreLocationInputKey) {
|
|
553
|
+
throw new Error("Unable to perform knowledge search. Input Key is missing.");
|
|
554
|
+
}
|
|
555
|
+
let actualSearchString = searchString;
|
|
556
|
+
// check if follow up detection is active and if yes, handle accordingly
|
|
557
|
+
if (followUpDetection === "transcript") {
|
|
558
|
+
let prompt;
|
|
559
|
+
let lastRoundTrip;
|
|
560
|
+
// this is a fallback in case the node was created before this function was added and followUpDetectionSteps is undefined
|
|
561
|
+
followUpDetectionSteps = followUpDetectionSteps || 2;
|
|
562
|
+
// check whether we're in an flow execution that's not the first
|
|
563
|
+
// as it doesn't make sense to check for follow ups in the first execution
|
|
564
|
+
if (input.execution > 1) {
|
|
565
|
+
// always remember the last thing the user said (needed later)
|
|
566
|
+
lastRoundTrip = (_b = cognigy.lastConversationEntries) === null || _b === void 0 ? void 0 : _b.slice(1, 3).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
|
|
567
|
+
// if follow up detection is set to 2 or more, we use the conversation transcript
|
|
568
|
+
// as reference. Start at the second entry, because the first one is the current
|
|
569
|
+
const recentConversation = (_c = cognigy.lastConversationEntries) === null || _c === void 0 ? void 0 : _c.slice(1, followUpDetectionSteps + 1).reverse().map(entry => "- " + (entry.source === "user" ? "USER: " : "BOT: ") + entry.text).join("\n");
|
|
570
|
+
prompt = `Below is the transcript of a conversation:
|
|
571
|
+
${recentConversation}
|
|
572
|
+
USER: ${searchString}
|
|
573
|
+
Does the last USER input refer to the conversation before?
|
|
574
|
+
Answer with "true" or "false". Answer:`;
|
|
575
|
+
let promptResponse;
|
|
576
|
+
try {
|
|
577
|
+
promptResponse = await api.runGenerativeAIPrompt({ prompt }, "gptPromptNode");
|
|
578
|
+
// if we're in adminconsole, process debugging options
|
|
579
|
+
input.channel === "adminconsole" && (0, prompt_1.writeLLMDebugLogs)("Search Extract Output Follow Up Detection", prompt, promptResponse, debugLogTokenCount, false, cognigy);
|
|
580
|
+
// check if LLM thinks the input was a follow up
|
|
581
|
+
if (promptResponse === null || promptResponse === void 0 ? void 0 : promptResponse.toLowerCase().includes("true")) {
|
|
582
|
+
prompt = `You are tasked to rewrite a question based on a context, so that the question is clearer.
|
|
583
|
+
|
|
584
|
+
Example:
|
|
585
|
+
Context:
|
|
586
|
+
USER: Where is Germany?
|
|
587
|
+
BOT: Germany is in Europe.
|
|
588
|
+
Question: Is that a continent?
|
|
589
|
+
New: Is Europe a continent?
|
|
590
|
+
|
|
591
|
+
Task:
|
|
592
|
+
Context:
|
|
593
|
+
${lastRoundTrip}
|
|
594
|
+
Question: ${searchString}
|
|
595
|
+
New: `;
|
|
596
|
+
promptResponse = await api.runGenerativeAIPrompt({ prompt }, "gptPromptNode");
|
|
597
|
+
// if we're in adminconsole, process debugging options
|
|
598
|
+
input.channel === "adminconsole" && (0, prompt_1.writeLLMDebugLogs)("Search Extract Output Follow Up Detection 2", prompt, promptResponse, debugLogTokenCount, false, cognigy);
|
|
599
|
+
// the actual search string to now use is the rewritten question
|
|
600
|
+
actualSearchString = promptResponse;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
catch (err) {
|
|
604
|
+
api.log("error", "Search Extract Output. Error when trying to process follow up input: " + err.message);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
let knowledgeSearchResponseData;
|
|
609
|
+
// handle errors from external services, depending on the settings
|
|
610
|
+
const handleServiceError = async (error) => {
|
|
611
|
+
var _a;
|
|
612
|
+
const compactError = {
|
|
613
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || error,
|
|
614
|
+
};
|
|
615
|
+
if ((_a = error === null || error === void 0 ? void 0 : error.originalErrorDetails) === null || _a === void 0 ? void 0 : _a.code) {
|
|
616
|
+
compactError["code"] = error.originalErrorDetails.code;
|
|
617
|
+
}
|
|
618
|
+
let searchStoreDataWithError = {
|
|
619
|
+
error: compactError,
|
|
620
|
+
};
|
|
621
|
+
if (knowledgeSearchResponseData) {
|
|
622
|
+
searchStoreDataWithError = Object.assign({ error: compactError }, knowledgeSearchResponseData);
|
|
623
|
+
}
|
|
624
|
+
// add error to context or input
|
|
625
|
+
switch (searchStoreLocation) {
|
|
626
|
+
case "context":
|
|
627
|
+
// @ts-ignore
|
|
628
|
+
api.addToContext(searchStoreLocationContextKey, searchStoreDataWithError, "simple");
|
|
629
|
+
break;
|
|
630
|
+
default:
|
|
631
|
+
api.addToInput(searchStoreLocationInputKey, searchStoreDataWithError);
|
|
632
|
+
}
|
|
633
|
+
if (errorHandling === "continue") {
|
|
634
|
+
// output the timeout message
|
|
635
|
+
if (errorMessage) {
|
|
636
|
+
api.output(errorMessage, null);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
else if (errorHandling === "goto") {
|
|
640
|
+
if (!errorHandlingGotoTarget) {
|
|
641
|
+
throw new Error("GoTo Target is required");
|
|
642
|
+
}
|
|
643
|
+
const gotoParams = {
|
|
644
|
+
cognigy,
|
|
645
|
+
childConfigs: [],
|
|
646
|
+
nodeId,
|
|
647
|
+
config: {
|
|
648
|
+
flowNode: {
|
|
649
|
+
flow: errorHandlingGotoTarget.flow,
|
|
650
|
+
node: errorHandlingGotoTarget.node,
|
|
651
|
+
},
|
|
652
|
+
injectedText: undefined,
|
|
653
|
+
injectedData: undefined,
|
|
654
|
+
executionMode: "continue",
|
|
655
|
+
absorbContext: false
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
await logic_1.GO_TO.function(gotoParams);
|
|
659
|
+
}
|
|
660
|
+
else {
|
|
661
|
+
throw new errors_1.InternalServerError(error === null || error === void 0 ? void 0 : error.message, { traceId });
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
const data = {
|
|
665
|
+
language: language,
|
|
666
|
+
query: actualSearchString,
|
|
667
|
+
topK: topK,
|
|
668
|
+
traceId: traceId,
|
|
669
|
+
disableSensitiveLogging: false
|
|
670
|
+
};
|
|
671
|
+
if (searchSourceTags && searchSourceTags.length > 0) {
|
|
672
|
+
// convert each knowledgeSourceTag to a string
|
|
673
|
+
searchSourceTags.forEach((tag, index) => {
|
|
674
|
+
searchSourceTags[index] = tag.toString();
|
|
675
|
+
});
|
|
676
|
+
data.tags = searchSourceTags;
|
|
677
|
+
}
|
|
678
|
+
// Add knowledgeStoreIds to data
|
|
679
|
+
if (knowledgeStoreId) {
|
|
680
|
+
data.knowledgeStoreIds = [knowledgeStoreId];
|
|
681
|
+
}
|
|
682
|
+
// Perform knowledge search
|
|
683
|
+
try {
|
|
684
|
+
const knowledgeSearchResponse = await api.knowledgeSearch(data);
|
|
685
|
+
input.channel === "adminconsole" && (0, prompt_1.writeLLMDebugLogs)("Search Extract Output Embeddings Call", data.query, undefined, debugLogTokenCount, false, cognigy);
|
|
686
|
+
// Handle possible response errors
|
|
687
|
+
if ((knowledgeSearchResponse === null || knowledgeSearchResponse === void 0 ? void 0 : knowledgeSearchResponse.status) !== "success") {
|
|
688
|
+
const errorMessage = (knowledgeSearchResponse === null || knowledgeSearchResponse === void 0 ? void 0 : knowledgeSearchResponse.error) || "empty";
|
|
689
|
+
throw new Error(`Error while performing knowledge search. Remote returned error: ${errorMessage}`);
|
|
690
|
+
}
|
|
691
|
+
if (!(knowledgeSearchResponse === null || knowledgeSearchResponse === void 0 ? void 0 : knowledgeSearchResponse.data)) {
|
|
692
|
+
throw new Error("Error while performing knowledge search. Remote returned empty response.");
|
|
693
|
+
}
|
|
694
|
+
knowledgeSearchResponseData = knowledgeSearchResponse.data;
|
|
695
|
+
}
|
|
696
|
+
catch (error) {
|
|
697
|
+
await handleServiceError(error);
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
// Save result
|
|
701
|
+
switch (searchStoreLocation) {
|
|
702
|
+
case "context":
|
|
703
|
+
// @ts-ignore
|
|
704
|
+
api.addToContext(searchStoreLocationContextKey, knowledgeSearchResponseData, "simple");
|
|
705
|
+
break;
|
|
706
|
+
case "default":
|
|
707
|
+
case "input":
|
|
708
|
+
api.addToInput(searchStoreLocationInputKey, knowledgeSearchResponseData);
|
|
709
|
+
break;
|
|
710
|
+
default:
|
|
711
|
+
throw new errors_1.InternalServerError(`Error while performing knowledge search. Store location was invalid. Value was: ${searchStoreLocation}`, { traceId, disableSensitiveLogging: data === null || data === void 0 ? void 0 : data.disableSensitiveLogging });
|
|
712
|
+
}
|
|
713
|
+
// #endregion 1 Perform Search
|
|
714
|
+
// #region 2 Perform Answer Extraction
|
|
715
|
+
let documents = (_d = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _d === void 0 ? void 0 : _d.map(result => result === null || result === void 0 ? void 0 : result.text).join(' ');
|
|
716
|
+
const replacedUserInput = input.text + (actualSearchString !== input.text ? ` possibly meaning "${actualSearchString}"` : "");
|
|
717
|
+
prompt = prompt.replace(/@userInput/, replacedUserInput);
|
|
718
|
+
prompt = prompt.replace(/@foundDocuments/, documents);
|
|
719
|
+
const answerLanguage = (() => {
|
|
720
|
+
const answerLanguage = getLanguageName(language);
|
|
721
|
+
// generic (ge-GE) and any other unknown languages result in "undefined"
|
|
722
|
+
if (!answerLanguage) {
|
|
723
|
+
return "the same language the question was asked";
|
|
724
|
+
}
|
|
725
|
+
return answerLanguage;
|
|
726
|
+
})();
|
|
727
|
+
prompt = prompt.replace(/@answerLanguage/, answerLanguage);
|
|
728
|
+
// check if we have found documents and if we are not just in "Search" only mode
|
|
729
|
+
if (documents && (mode !== "s")) {
|
|
730
|
+
// check if we received streamed output at all
|
|
731
|
+
let streamedOutput = false;
|
|
732
|
+
const promptData = {
|
|
733
|
+
prompt,
|
|
734
|
+
temperature,
|
|
735
|
+
maxTokens,
|
|
736
|
+
topP,
|
|
737
|
+
presencePenalty,
|
|
738
|
+
frequencyPenalty,
|
|
739
|
+
timeoutInMs: timeout,
|
|
740
|
+
useCase: "promptNode",
|
|
741
|
+
stream: outputMode === "stream",
|
|
742
|
+
streamOnDataHandler: (text) => {
|
|
743
|
+
streamedOutput = true;
|
|
744
|
+
api.output(text, null);
|
|
745
|
+
},
|
|
746
|
+
streamStopTokens
|
|
747
|
+
};
|
|
748
|
+
if (useStop) {
|
|
749
|
+
promptData["stop"] = stop;
|
|
750
|
+
}
|
|
751
|
+
let promptResponse;
|
|
752
|
+
try {
|
|
753
|
+
promptResponse = await api.runGenerativeAIPrompt(promptData, "gptPromptNode");
|
|
754
|
+
// if we're in adminconsole, process debugging options
|
|
755
|
+
input.channel === "adminconsole" && (0, prompt_1.writeLLMDebugLogs)("Search Extract Output Main Prompt", prompt, promptResponse, debugLogTokenCount, debugLogRequestAndCompletion, cognigy);
|
|
756
|
+
if (storeLocation === "context") {
|
|
757
|
+
api.addToContext(contextKey, promptResponse, "simple");
|
|
758
|
+
}
|
|
759
|
+
else {
|
|
760
|
+
api.addToInput(inputKey, promptResponse);
|
|
761
|
+
}
|
|
762
|
+
// #region 3 Output Answer
|
|
763
|
+
const ADAPTIVE_CARD_RESULT = {
|
|
764
|
+
"type": "AdaptiveCard",
|
|
765
|
+
"body": [
|
|
766
|
+
{
|
|
767
|
+
"type": "Container",
|
|
768
|
+
"items": [
|
|
769
|
+
{
|
|
770
|
+
"type": "ColumnSet",
|
|
771
|
+
"columns": [
|
|
772
|
+
{
|
|
773
|
+
"type": "Column",
|
|
774
|
+
"width": "100px",
|
|
775
|
+
"items": [
|
|
776
|
+
{
|
|
777
|
+
"type": "Image",
|
|
778
|
+
"url": "https://www.cognigy.com/hubfs/AI%20Copy%205.svg",
|
|
779
|
+
"width": "50px",
|
|
780
|
+
"size": "Medium",
|
|
781
|
+
"height": "50px"
|
|
782
|
+
}
|
|
783
|
+
],
|
|
784
|
+
"spacing": "Large"
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"type": "Column",
|
|
788
|
+
"width": "stretch",
|
|
789
|
+
"verticalContentAlignment": "Center"
|
|
790
|
+
}
|
|
791
|
+
]
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"type": "ColumnSet",
|
|
795
|
+
"columns": [
|
|
796
|
+
{
|
|
797
|
+
"type": "Column",
|
|
798
|
+
"width": "15px",
|
|
799
|
+
"items": [
|
|
800
|
+
{
|
|
801
|
+
"type": "Image",
|
|
802
|
+
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMNSURBVHhe7dpJyE1hHMfxx5whkqkMERuRxMZUWBBJoQwlG2WjrJQhU1J2FNkISWQoOysklIjIVMpcFGWIjczT93963zc9/d9zzz3n/u8/9fzqs7mL5/d0z7nnnvOcJ6SkpKSkpKSkNCndMR3bsFQ+aHJc+rthLvbjGf60+IhesI5b/2BsxkO0lra6j+2wnEBe/x1shUl/b2zBW8TF57EAXWCVvP5zmI9OMIn8rh4jLr4GOQ2tk9c/B2aRb/0I4uKvWI+OsExe/0aYHXHJONxDXC5HYiqs49ovp/V7xOUXMAjWce1fgm+Iy0+jK6zj2r8QPxGXn0FnWEf+Sdz6p+Ez4vLr6AHrTMEnuPQPxSvE5W8wDNZx7ZdT6wricjEP1vHuDzuhle9DM+LaL7+7X4jLX0BuQqzj2i+n3i3E5WIFrOPdH9ZAK7+BDrCOa38fvIY2gcWwjnd/2ACt/BGacbfn2i83FXKR0SYgE7NOXr884ZlnObRyecQcAeu01/8Fo2Ces9AmcAnNSHv9F2Ge4ZBvWpvAOlgnr78pp/8qaOVCbkqs490fTkIrf4e+sI5rv/y9PIE2gauwjnd/GI0f0CZwAD0xGSuxCbK+vhqz0R9V492frbZo5eIlnkef/Uuey0+hyhK0d39YC23wesna3BDUG+/+sAvagGU8hZzS9cS7PxyENlhZckGr58rd6H75EgagcE5AG6iKQygai/6jKByLCfzGBBSJRb+YiEKRo6UNUNUeFIl3f9gNbYCq7qLICo53f/awow1Q1QcMRK1492dLTdoAVcnd3RjUind/GAttCboRxqNWvPtzH0aqkPeJI1Er3v1Z5G2LNkgVcg8vO7aKxLs/TII2SBXHUDTe/VkuQxuorHqf0Lz7w0xoA5VxE/W+xfHuz3IY2oD1moEy8e7PXk3dhjZoUTtQNt79WWTLqbYNrYi9qBrv/iz9cBxaiUa2qco6XaPi3d+WWZClJll7i0u/4wFkE3SppagC8e5vixwReUGxCMsge3Rk6cl8i1pLvPtTUlJSUlL+/4TwF7nOber14ZhwAAAAAElFTkSuQmCC"
|
|
803
|
+
}
|
|
804
|
+
]
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"type": "Column",
|
|
808
|
+
"width": "stretch",
|
|
809
|
+
"items": [
|
|
810
|
+
{
|
|
811
|
+
"type": "TextBlock",
|
|
812
|
+
"size": "Medium",
|
|
813
|
+
"weight": "Lighter",
|
|
814
|
+
"text": promptResponse,
|
|
815
|
+
"isSubtle": true,
|
|
816
|
+
"color": "Default",
|
|
817
|
+
"fontType": "Default",
|
|
818
|
+
"horizontalAlignment": "Left",
|
|
819
|
+
"spacing": "Medium",
|
|
820
|
+
"maxLines": 0,
|
|
821
|
+
"wrap": true
|
|
822
|
+
}
|
|
823
|
+
]
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
"separator": true,
|
|
827
|
+
"spacing": "Large"
|
|
828
|
+
}
|
|
829
|
+
],
|
|
830
|
+
"style": "emphasis"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"type": "Container",
|
|
834
|
+
"separator": true,
|
|
835
|
+
"selectAction": {
|
|
836
|
+
"type": "Action.ToggleVisibility",
|
|
837
|
+
"title": "q1",
|
|
838
|
+
"targetElements": [
|
|
839
|
+
"a1",
|
|
840
|
+
"chevron_up1",
|
|
841
|
+
"chevron_down1"
|
|
842
|
+
]
|
|
843
|
+
},
|
|
844
|
+
"items": [
|
|
845
|
+
{
|
|
846
|
+
"type": "ColumnSet",
|
|
847
|
+
"columns": [
|
|
848
|
+
{
|
|
849
|
+
"type": "Column",
|
|
850
|
+
"width": "stretch",
|
|
851
|
+
"items": [
|
|
852
|
+
{
|
|
853
|
+
"type": "TextBlock",
|
|
854
|
+
"wrap": true,
|
|
855
|
+
"text": "Note: This answer is AI generated. Please click here to see the source article.",
|
|
856
|
+
"weight": "Bolder",
|
|
857
|
+
"spacing": "Large",
|
|
858
|
+
"separator": true
|
|
859
|
+
}
|
|
860
|
+
]
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
"type": "Column",
|
|
864
|
+
"width": "28px",
|
|
865
|
+
"verticalContentAlignment": "Center",
|
|
866
|
+
"items": [
|
|
867
|
+
{
|
|
868
|
+
"type": "Image",
|
|
869
|
+
"url": "https://raw.githubusercontent.com/pnp/AdaptiveCards-Templates/main/samples/faq-accordion/assets/ico-up.png",
|
|
870
|
+
"width": "20px",
|
|
871
|
+
"height": "20px",
|
|
872
|
+
"id": "chevron_up1"
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
"type": "Image",
|
|
876
|
+
"url": "https://raw.githubusercontent.com/pnp/AdaptiveCards-Templates/main/samples/faq-accordion/assets/ico-down.png",
|
|
877
|
+
"id": "chevron_down1",
|
|
878
|
+
"width": "20px",
|
|
879
|
+
"height": "20px",
|
|
880
|
+
"isVisible": false
|
|
881
|
+
}
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
]
|
|
885
|
+
}
|
|
886
|
+
],
|
|
887
|
+
"verticalContentAlignment": "Center",
|
|
888
|
+
"minHeight": "30px",
|
|
889
|
+
"spacing": "Large",
|
|
890
|
+
"style": "emphasis"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
"type": "Container",
|
|
894
|
+
"id": "a1",
|
|
895
|
+
"items": [
|
|
896
|
+
{
|
|
897
|
+
"type": "ColumnSet",
|
|
898
|
+
"columns": [
|
|
899
|
+
{
|
|
900
|
+
"type": "Column",
|
|
901
|
+
"width": "40px"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"type": "Column",
|
|
905
|
+
"width": "stretch",
|
|
906
|
+
"items": [
|
|
907
|
+
{
|
|
908
|
+
"separator": true,
|
|
909
|
+
"type": "TextBlock",
|
|
910
|
+
"text": (_e = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _e === void 0 ? void 0 : _e[0].text,
|
|
911
|
+
"wrap": true,
|
|
912
|
+
"spacing": "Padding"
|
|
913
|
+
}
|
|
914
|
+
],
|
|
915
|
+
}
|
|
916
|
+
]
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"type": "Container",
|
|
920
|
+
"spacing": "None",
|
|
921
|
+
"minHeight": "24px"
|
|
922
|
+
}
|
|
923
|
+
],
|
|
924
|
+
"isVisible": false
|
|
925
|
+
}
|
|
926
|
+
],
|
|
927
|
+
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
|
|
928
|
+
"version": "1.6"
|
|
929
|
+
};
|
|
930
|
+
// @ts-ignore
|
|
931
|
+
if ((_h = (_g = (_f = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.chunkMetaData) === null || _h === void 0 ? void 0 : _h.url) {
|
|
932
|
+
ADAPTIVE_CARD_RESULT.body[2].items[0].columns[1].items.push({
|
|
933
|
+
"type": "ActionSet",
|
|
934
|
+
"actions": [
|
|
935
|
+
{
|
|
936
|
+
"type": "Action.OpenUrl",
|
|
937
|
+
"title": "Open Source",
|
|
938
|
+
// @ts-ignore
|
|
939
|
+
"url": (_j = knowledgeSearchResponseData === null || knowledgeSearchResponseData === void 0 ? void 0 : knowledgeSearchResponseData.topK) === null || _j === void 0 ? void 0 : _j[0].chunkMetaData.url
|
|
940
|
+
}
|
|
941
|
+
],
|
|
942
|
+
"separator": true
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
if (mode === "seo") {
|
|
946
|
+
switch (outputMode) {
|
|
947
|
+
case "adaptiveCard":
|
|
948
|
+
api.output(null, {
|
|
949
|
+
"_cognigy": {
|
|
950
|
+
"_default": {
|
|
951
|
+
"_adaptiveCard": {
|
|
952
|
+
"type": "adaptiveCard",
|
|
953
|
+
"adaptiveCard": ADAPTIVE_CARD_RESULT,
|
|
954
|
+
"fallbackText": promptResponse
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
break;
|
|
960
|
+
case "text":
|
|
961
|
+
api.output(promptResponse, null);
|
|
962
|
+
break;
|
|
963
|
+
case "stream":
|
|
964
|
+
// fallback in case the stream for some reason didn't stream anything
|
|
965
|
+
if (!streamedOutput) {
|
|
966
|
+
api.output(promptResponse, null);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
// #endregion 3 Output Answer
|
|
971
|
+
}
|
|
972
|
+
catch (error) {
|
|
973
|
+
await handleServiceError(error);
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
// #endregion 2 Perform Answer Extraction
|
|
977
|
+
}
|
|
978
|
+
else {
|
|
979
|
+
if (mode === "seo") {
|
|
980
|
+
api.output(outputFallback, null);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
//# sourceMappingURL=searchExtractOutput.js.map
|