mario-education 2.4.518-feedback → 2.4.519-feedback

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.
@@ -31,6 +31,7 @@ export interface IChat {
31
31
  text?: string;
32
32
  time: string;
33
33
  isUser: boolean;
34
+ isSystem?: boolean;
34
35
  options?: string[];
35
36
  }
36
37
  export interface IPrompt {
package/dist/index.js CHANGED
@@ -6163,19 +6163,14 @@ var useCSVImport = function useCSVImport() {
6163
6163
 
6164
6164
  var formData = new FormData();
6165
6165
  formData.append("file", file, file.name);
6166
- console.log("run");
6167
- console.log("📌 Type run:", type.toString());
6168
6166
 
6169
6167
  var _temp8 = function () {
6170
6168
  if (type == CSVType.AllUser) {
6171
- console.log("📌 Type 1:", type.toString());
6172
6169
  return Promise.resolve(file.text()).then(function (fileTextRaw) {
6173
- console.log("📌 fileTextRaw:", fileTextRaw);
6174
6170
  var fileText = fileTextRaw.trim();
6175
6171
  var rows = fileText.split("\n").map(function (row) {
6176
6172
  return row.trim();
6177
6173
  });
6178
- console.log("📌 rows:", rows);
6179
6174
  var headerIndex = rows.findIndex(function (row) {
6180
6175
  return row.split(",").includes("FirstName");
6181
6176
  });
@@ -6185,14 +6180,12 @@ var useCSVImport = function useCSVImport() {
6185
6180
  }
6186
6181
 
6187
6182
  fileText = rows.slice(headerIndex).join("\n");
6188
- console.log("📌 fileText:", fileText);
6189
6183
  var parsedData = Papa.parse(fileText, {
6190
6184
  header: true,
6191
6185
  skipEmptyLines: true
6192
6186
  });
6193
6187
  var header = parsedData.meta.fields;
6194
6188
  var dataRows = parsedData.data;
6195
- console.log("📌 dataRows:", dataRows);
6196
6189
  var chunkSize = 20;
6197
6190
  var chunks = [];
6198
6191
 
@@ -6219,8 +6212,6 @@ var useCSVImport = function useCSVImport() {
6219
6212
  } else {
6220
6213
  var _temp14 = function () {
6221
6214
  if (isCheckDomainIBS) {
6222
- console.log("📌 Type if:", type.toString());
6223
-
6224
6215
  var _temp15 = function () {
6225
6216
  if (type == CSVType.ClassReflection) {
6226
6217
  return Promise.resolve(importClassReflectionCSV(formData)).then(function () {});
@@ -6229,7 +6220,6 @@ var useCSVImport = function useCSVImport() {
6229
6220
 
6230
6221
  if (_temp15 && _temp15.then) return _temp15.then(function () {});
6231
6222
  } else {
6232
- console.log("📌 Type else:", type.toString());
6233
6223
  return Promise.resolve(importCSV(formData, type.toString())).then(function () {});
6234
6224
  }
6235
6225
  }();
@@ -78698,6 +78688,7 @@ var useAIChat = function useAIChat() {
78698
78688
  text: r.message.replace(/\$\{\{/g, ""),
78699
78689
  time: "",
78700
78690
  isUser: ((_r$role = r.role) === null || _r$role === void 0 ? void 0 : _r$role.toString()) == "User",
78691
+ isSystem: false,
78701
78692
  options: (_r$message = r.message) === null || _r$message === void 0 ? void 0 : (_r$message$match = _r$message.match(regex)) === null || _r$message$match === void 0 ? void 0 : (_r$message$match$ = _r$message$match[1]) === null || _r$message$match$ === void 0 ? void 0 : (_r$message$match$$spl = _r$message$match$.split(" || ")) === null || _r$message$match$$spl === void 0 ? void 0 : (_r$message$match$$spl2 = _r$message$match$$spl[1]) === null || _r$message$match$$spl2 === void 0 ? void 0 : _r$message$match$$spl2.split("/")
78702
78693
  };
78703
78694
  })) || []);
@@ -78721,11 +78712,13 @@ var useAIChat = function useAIChat() {
78721
78712
  var responses = chats.concat([{
78722
78713
  isUser: true,
78723
78714
  message: option,
78724
- time: ""
78715
+ time: "",
78716
+ isSystem: false
78725
78717
  }, {
78726
78718
  time: "",
78727
78719
  isUser: false,
78728
- message: ""
78720
+ message: "",
78721
+ isSystem: false
78729
78722
  }]);
78730
78723
  setChats(responses);
78731
78724
  var startDate;
@@ -78936,21 +78929,31 @@ var useAIChat = function useAIChat() {
78936
78929
  isUser: false,
78937
78930
  message: messageText,
78938
78931
  time: "",
78939
- text: ""
78932
+ text: "",
78933
+ isSystem: false
78940
78934
  }], match ? [{
78941
78935
  isUser: false,
78942
78936
  message: match[1],
78943
78937
  time: "",
78944
78938
  text: "",
78945
- options: (_match$1$split$ = match[1].split(" || ")[1]) === null || _match$1$split$ === void 0 ? void 0 : _match$1$split$.split("/")
78939
+ options: (_match$1$split$ = match[1].split(" || ")[1]) === null || _match$1$split$ === void 0 ? void 0 : _match$1$split$.split("/"),
78940
+ isSystem: false
78946
78941
  }] : []).filter(function (r) {
78947
78942
  return r.message;
78948
78943
  });
78949
78944
  aiChats = updatedChats;
78950
78945
  return updatedChats;
78951
78946
  });
78947
+ var formattedSystemMessages = systemMessages.map(function (msg) {
78948
+ return {
78949
+ message: msg.text,
78950
+ time: "",
78951
+ isUser: false,
78952
+ isSystem: true
78953
+ };
78954
+ });
78952
78955
  saveHistoryPrompt(_extends({}, prompt, {
78953
- messages: aiChats,
78956
+ messages: aiChats.concat(formattedSystemMessages),
78954
78957
  output: "",
78955
78958
  promptId: prompt.id,
78956
78959
  grade: "",