@websolutespa/bom-llm 0.2.4 → 0.2.5
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 +6 -0
- package/dist/esm/index.js +27 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/index.js +27 -7
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -19863,6 +19863,12 @@ const IconX = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
19863
19863
|
});
|
|
19864
19864
|
IconX.displayName = 'IconX';
|
|
19865
19865
|
|
|
19866
|
+
function pushDataLayer(record) {
|
|
19867
|
+
if (isBrowser$1) {
|
|
19868
|
+
window.dataLayer?.push(record);
|
|
19869
|
+
}
|
|
19870
|
+
}
|
|
19871
|
+
|
|
19866
19872
|
const createLlmViewStore = _ref => {
|
|
19867
19873
|
let {
|
|
19868
19874
|
threadId,
|
|
@@ -20036,9 +20042,15 @@ const createLlmViewStore = _ref => {
|
|
|
20036
20042
|
},
|
|
20037
20043
|
open: () => {
|
|
20038
20044
|
setIdleTimeout();
|
|
20039
|
-
set(state =>
|
|
20040
|
-
opened
|
|
20041
|
-
|
|
20045
|
+
set(state => {
|
|
20046
|
+
const opened = !state.opened;
|
|
20047
|
+
pushDataLayer({
|
|
20048
|
+
event: opened ? 'llm_open' : 'llm_close'
|
|
20049
|
+
});
|
|
20050
|
+
return {
|
|
20051
|
+
opened
|
|
20052
|
+
};
|
|
20053
|
+
});
|
|
20042
20054
|
},
|
|
20043
20055
|
isOpened: () => {
|
|
20044
20056
|
const {
|
|
@@ -20048,9 +20060,14 @@ const createLlmViewStore = _ref => {
|
|
|
20048
20060
|
},
|
|
20049
20061
|
setOpened: opened => {
|
|
20050
20062
|
setIdleTimeout();
|
|
20051
|
-
set(state =>
|
|
20052
|
-
|
|
20053
|
-
|
|
20063
|
+
set(state => {
|
|
20064
|
+
pushDataLayer({
|
|
20065
|
+
event: opened ? 'llm_open' : 'llm_close'
|
|
20066
|
+
});
|
|
20067
|
+
return {
|
|
20068
|
+
opened
|
|
20069
|
+
};
|
|
20070
|
+
});
|
|
20054
20071
|
},
|
|
20055
20072
|
setIntroed: introed => {
|
|
20056
20073
|
const state = get();
|
|
@@ -45435,6 +45452,9 @@ const createLlmStore = config => {
|
|
|
45435
45452
|
return;
|
|
45436
45453
|
}
|
|
45437
45454
|
}
|
|
45455
|
+
pushDataLayer({
|
|
45456
|
+
event: state.messages.length > 0 ? 'llm_message' : 'llm_start'
|
|
45457
|
+
});
|
|
45438
45458
|
const messages = await messageService.addUserMessage(state.messages, prompt, uploaded);
|
|
45439
45459
|
set(state => ({
|
|
45440
45460
|
chunks: [],
|
|
@@ -45841,7 +45861,7 @@ function messagesToHistory(messages) {
|
|
|
45841
45861
|
}
|
|
45842
45862
|
return p;
|
|
45843
45863
|
}, []);
|
|
45844
|
-
console.log('useLlm.messagesToHistory', history);
|
|
45864
|
+
// console.log('useLlm.messagesToHistory', history);
|
|
45845
45865
|
return history.filter(x => x.threadId && x.messageId);
|
|
45846
45866
|
}
|
|
45847
45867
|
function historyToStoredHistory(history) {
|