impact-chatbot 2.3.74 → 2.3.76
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/dist/index.cjs.js +38 -36
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +38 -36
- package/dist/index.esm.js.map +1 -1
- package/dist/services/chatbot-services.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -212,10 +212,10 @@ const triggerRefresh = async (baseUrl) => {
|
|
|
212
212
|
return null;
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
|
-
const fetchChatbotFilterConfig = async (
|
|
215
|
+
const fetchChatbotFilterConfig = async () => {
|
|
216
216
|
try {
|
|
217
217
|
return axiosInstance({
|
|
218
|
-
url: `core/filter/generic-schema-mapping?
|
|
218
|
+
url: `core/filter/generic-schema-mapping?screen_name=Chatbot`,
|
|
219
219
|
method: "GET",
|
|
220
220
|
});
|
|
221
221
|
}
|
|
@@ -5195,6 +5195,12 @@ const sseevent = (message, messageToStoreRef) => {
|
|
|
5195
5195
|
};
|
|
5196
5196
|
}
|
|
5197
5197
|
}
|
|
5198
|
+
// Strip large debugging metadata that is never used for rendering.
|
|
5199
|
+
// The meta field contains text_chunks, supplemental_chunks, image_ids
|
|
5200
|
+
// arrays that accumulate in memory and contribute to OOM crashes.
|
|
5201
|
+
if (parsedData?.meta) {
|
|
5202
|
+
delete parsedData.meta;
|
|
5203
|
+
}
|
|
5198
5204
|
if (messageToStoreRef.current.currentMode === "agent" &&
|
|
5199
5205
|
(parsedData?.chat_id || parsedData?.session_id)) {
|
|
5200
5206
|
messageToStoreRef.current.uniqueChatId = parsedData?.chat_id
|
|
@@ -9407,10 +9413,10 @@ const StreamedContent = ({ botData }) => {
|
|
|
9407
9413
|
processResponse(response, botData.inputBody, currentMode, botData.utilityObject.customChatConfig, {
|
|
9408
9414
|
newChatData: chatDataInfoRef,
|
|
9409
9415
|
isTabEnabled: true,
|
|
9410
|
-
steps:
|
|
9416
|
+
steps: stepRef.current.map(s => ({ ...s })),
|
|
9411
9417
|
currentTabValue: (stepsDone && !hasStepFormWidgets) ? "agent_response" : "steps",
|
|
9412
|
-
questions:
|
|
9413
|
-
questionsStepsMap:
|
|
9418
|
+
questions: [...questionsRef.current],
|
|
9419
|
+
questionsStepsMap: { ...questionsStepsMapRef.current },
|
|
9414
9420
|
stepFormDataMap: { ...stepFormDataMapRef.current },
|
|
9415
9421
|
}, activeConversationId);
|
|
9416
9422
|
// [
|
|
@@ -9515,10 +9521,10 @@ const StreamedContent = ({ botData }) => {
|
|
|
9515
9521
|
processResponse(response, botData.inputBody, currentMode, botData.utilityObject.customChatConfig, {
|
|
9516
9522
|
newChatData: chatDataInfoRef,
|
|
9517
9523
|
isTabEnabled: true,
|
|
9518
|
-
steps:
|
|
9524
|
+
steps: stepRef.current.map(s => ({ ...s })),
|
|
9519
9525
|
currentTabValue: stepsDone ? "agent_response" : "steps",
|
|
9520
|
-
questions:
|
|
9521
|
-
questionsStepsMap:
|
|
9526
|
+
questions: [...questionsRef.current],
|
|
9527
|
+
questionsStepsMap: { ...questionsStepsMapRef.current },
|
|
9522
9528
|
stepFormDataMap: { ...stepFormDataMapRef.current },
|
|
9523
9529
|
}, activeConversationId);
|
|
9524
9530
|
}
|
|
@@ -14845,14 +14851,11 @@ const SmartBot = (props) => {
|
|
|
14845
14851
|
},
|
|
14846
14852
|
]);
|
|
14847
14853
|
}
|
|
14848
|
-
const
|
|
14849
|
-
|
|
14850
|
-
fetchChatbotFilterConfig("store"),
|
|
14851
|
-
]);
|
|
14854
|
+
const response = await fetchChatbotFilterConfig();
|
|
14855
|
+
const responseData = response?.data?.data || {};
|
|
14852
14856
|
const combinedOptions = [
|
|
14853
|
-
...(
|
|
14854
|
-
...(
|
|
14855
|
-
...(chatbotFilterCustomConfig?.data || []), // Add custom filter config for testing
|
|
14857
|
+
...Object.values(responseData).flat(),
|
|
14858
|
+
...(chatbotFilterCustomConfig?.data || []) // Add custom filter config for testing
|
|
14856
14859
|
];
|
|
14857
14860
|
// Create hierarchy key-value pairs object
|
|
14858
14861
|
const hierarchyKeyValuePairs = {};
|
|
@@ -15300,7 +15303,7 @@ const SmartBot = (props) => {
|
|
|
15300
15303
|
let newChatData = chatDataState?.[currentMode]?.conversations?.[activeConversationId]?.messages;
|
|
15301
15304
|
let newChatDataLength = newChatData?.length - 1;
|
|
15302
15305
|
if (newChatDataLength) {
|
|
15303
|
-
chatDataInfoRef.current[currentMode].conversations[activeConversationId].messages[chatDataInfoRefLength - 1] =
|
|
15306
|
+
chatDataInfoRef.current[currentMode].conversations[activeConversationId].messages[chatDataInfoRefLength - 1] = { ...newChatData?.[newChatDataLength] };
|
|
15304
15307
|
}
|
|
15305
15308
|
}
|
|
15306
15309
|
// let chatDataForReference = JSON.stringify(
|
|
@@ -15337,15 +15340,11 @@ const SmartBot = (props) => {
|
|
|
15337
15340
|
// ;
|
|
15338
15341
|
message.isFormDisabled = index !== lastBotMessageIndex;
|
|
15339
15342
|
message.messageIndex = index;
|
|
15340
|
-
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15344
|
-
|
|
15345
|
-
}
|
|
15346
|
-
if (originalThinkingResponse) {
|
|
15347
|
-
newMessage.thinkingResponse = originalThinkingResponse;
|
|
15348
|
-
}
|
|
15343
|
+
// Shallow copy — avoids cloneDeep which causes OOM on large
|
|
15344
|
+
// bodyText (images, widget data, meta objects).
|
|
15345
|
+
// utilityObject, thinkingResponse, and bodyText are preserved
|
|
15346
|
+
// by reference since child components only read them.
|
|
15347
|
+
let newMessage = { ...message };
|
|
15349
15348
|
message.jsx = (jsx(BotMessage, { botData: newMessage, state: loadingState, handleLikeDislike: handleLikeDislike, props: properties }));
|
|
15350
15349
|
let actualProps = {
|
|
15351
15350
|
botData: newMessage,
|
|
@@ -15358,17 +15357,20 @@ const SmartBot = (props) => {
|
|
|
15358
15357
|
// message.enableLikes = true;
|
|
15359
15358
|
}
|
|
15360
15359
|
});
|
|
15361
|
-
//
|
|
15362
|
-
|
|
15363
|
-
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
|
|
15367
|
-
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15360
|
+
// Shallow-clone the conversation structure to trigger React re-render
|
|
15361
|
+
// without deep-cloning large message payloads (which caused OOM crashes).
|
|
15362
|
+
const modeData = chatDataInfoRef?.current[currentMode];
|
|
15363
|
+
const convMessages = modeData?.conversations?.[activeConversationId]?.messages || [];
|
|
15364
|
+
let newChat = {
|
|
15365
|
+
...modeData,
|
|
15366
|
+
conversations: {
|
|
15367
|
+
...modeData?.conversations,
|
|
15368
|
+
[activeConversationId]: {
|
|
15369
|
+
...modeData?.conversations?.[activeConversationId],
|
|
15370
|
+
messages: convMessages.map(msg => ({ ...msg })),
|
|
15371
|
+
},
|
|
15372
|
+
},
|
|
15373
|
+
};
|
|
15372
15374
|
setConversation(newChat);
|
|
15373
15375
|
}
|
|
15374
15376
|
else if (showModal) {
|