@iblai/web-utils 1.2.13 → 1.3.1
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.d.ts +12 -2
- package/dist/index.esm.js +28 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/web-utils/src/features/chat/slice.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3588,6 +3588,10 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
|
|
|
3588
3588
|
}
|
|
3589
3589
|
else {
|
|
3590
3590
|
removeVisitingTenant === null || removeVisitingTenant === void 0 ? void 0 : removeVisitingTenant();
|
|
3591
|
+
const userTenantRecord = enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((t) => t.key === currentTenant);
|
|
3592
|
+
if (userTenantRecord) {
|
|
3593
|
+
saveCurrentTenant(userTenantRecord);
|
|
3594
|
+
}
|
|
3591
3595
|
const rbacPermissions = await loadPlatformPermissions(currentTenant);
|
|
3592
3596
|
onLoadPlatformPermissions === null || onLoadPlatformPermissions === void 0 ? void 0 : onLoadPlatformPermissions(rbacPermissions);
|
|
3593
3597
|
}
|
|
@@ -5957,6 +5961,10 @@ const initialState$3 = {
|
|
|
5957
5961
|
// Buffering state initialized
|
|
5958
5962
|
streamingArtifactContentBuffer: "",
|
|
5959
5963
|
lastArtifactContentFlushTime: 0,
|
|
5964
|
+
metadata: {
|
|
5965
|
+
edxCourseId: "",
|
|
5966
|
+
edxUsageId: "",
|
|
5967
|
+
},
|
|
5960
5968
|
};
|
|
5961
5969
|
const chatSlice = createSlice$1({
|
|
5962
5970
|
name: "chatSliceShared",
|
|
@@ -6043,6 +6051,12 @@ const chatSlice = createSlice$1({
|
|
|
6043
6051
|
setIframeContext: (state, action) => {
|
|
6044
6052
|
state.iframeContext = action.payload;
|
|
6045
6053
|
},
|
|
6054
|
+
setMetadata: (state, action) => {
|
|
6055
|
+
state.metadata = {
|
|
6056
|
+
...state.metadata,
|
|
6057
|
+
...action.payload,
|
|
6058
|
+
};
|
|
6059
|
+
},
|
|
6046
6060
|
setDocumentFilter: (state, action) => {
|
|
6047
6061
|
state.documentFilter = action.payload;
|
|
6048
6062
|
},
|
|
@@ -6345,6 +6359,7 @@ const selectActiveTab = (state) => state.chatSliceShared.activeTab;
|
|
|
6345
6359
|
const selectSessionId = (state) => state.chatSliceShared.sessionIds[state.chatSliceShared.activeTab];
|
|
6346
6360
|
const selectSessionIds = (state) => state.chatSliceShared.sessionIds;
|
|
6347
6361
|
const selectIframeContext = (state) => state.chatSliceShared.iframeContext;
|
|
6362
|
+
const selectMetadata = (state) => state.chatSliceShared.metadata;
|
|
6348
6363
|
const selectDocumentFilter = (state) => state.chatSliceShared.documentFilter;
|
|
6349
6364
|
const selectTools = (state) => state.chatSliceShared.tools;
|
|
6350
6365
|
const selectToken = (state) => state.chatSliceShared.token;
|
|
@@ -7104,6 +7119,7 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
|
|
|
7104
7119
|
const connectionAttempts = React.useRef(0);
|
|
7105
7120
|
const { userIsAccessingPublicRoute } = useAuthContext();
|
|
7106
7121
|
const iframeContext = useSelector(selectIframeContext);
|
|
7122
|
+
const chatMetadata = useSelector(selectMetadata);
|
|
7107
7123
|
const documentFilter = useSelector(selectDocumentFilter);
|
|
7108
7124
|
const linkToken = useSelector(selectToken);
|
|
7109
7125
|
// Ollama/offline mode state
|
|
@@ -8093,6 +8109,17 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
|
|
|
8093
8109
|
metadata: iframeContext.metadata,
|
|
8094
8110
|
};
|
|
8095
8111
|
}
|
|
8112
|
+
if (chatMetadata &&
|
|
8113
|
+
(chatMetadata.edxCourseId || chatMetadata.edxUsageId)) {
|
|
8114
|
+
messageData = {
|
|
8115
|
+
...messageData,
|
|
8116
|
+
grading_context: {
|
|
8117
|
+
type: "edx",
|
|
8118
|
+
course_id: chatMetadata.edxCourseId,
|
|
8119
|
+
usage_id: chatMetadata.edxUsageId,
|
|
8120
|
+
},
|
|
8121
|
+
};
|
|
8122
|
+
}
|
|
8096
8123
|
if (documentFilter) {
|
|
8097
8124
|
messageData = {
|
|
8098
8125
|
...messageData,
|
|
@@ -23670,6 +23697,7 @@ exports.selectIsPending = selectIsPending;
|
|
|
23670
23697
|
exports.selectIsStopped = selectIsStopped;
|
|
23671
23698
|
exports.selectIsTyping = selectIsTyping;
|
|
23672
23699
|
exports.selectLastArtifactContentFlushTime = selectLastArtifactContentFlushTime;
|
|
23700
|
+
exports.selectMetadata = selectMetadata;
|
|
23673
23701
|
exports.selectNumberOfActiveChatMessages = selectNumberOfActiveChatMessages;
|
|
23674
23702
|
exports.selectSessionId = selectSessionId;
|
|
23675
23703
|
exports.selectSessionIds = selectSessionIds;
|