deep-chat-dev 9.0.242 → 9.0.243

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/deepChat.js CHANGED
@@ -11045,10 +11045,10 @@ var Qo = /*#__PURE__*/function (_W11) {
11045
11045
  var yt = /*#__PURE__*/function (_W12) {
11046
11046
  // prettier-ignore
11047
11047
  function yt(e, t, i, s, r) {
11048
- var _this53$maxMessages, _m$model;
11048
+ var _this53$maxMessages, _p$model;
11049
11049
  var _this53;
11050
11050
  _classCallCheck(this, yt);
11051
- var u, h, f, m;
11051
+ var u, h, f, m, p;
11052
11052
  var o = JSON.parse(JSON.stringify(e.directConnection)),
11053
11053
  a = t || L.buildKeyVerificationDetails(),
11054
11054
  l = i || L.buildHeaders,
@@ -11057,11 +11057,10 @@ var yt = /*#__PURE__*/function (_W12) {
11057
11057
  var d = r || ((u = o.openAI) == null ? void 0 : u.chat);
11058
11058
  if (_typeof(d) == "object") {
11059
11059
  d.system_prompt && (_this53._systemMessage = yt.generateSystemMessage(d.system_prompt));
11060
- var _ref29 = (f = (h = e.directConnection) == null ? void 0 : h.openAI) == null ? void 0 : f.chat,
11061
- p = _ref29.function_handler;
11062
- p && (_this53._functionHandler = p), _this53.cleanConfig(d), Object.assign(_this53.rawBody, d);
11060
+ var g = (m = (f = (h = e.directConnection) == null ? void 0 : h.openAI) == null ? void 0 : f.chat) == null ? void 0 : m.function_handler;
11061
+ g && (_this53._functionHandler = g), _this53.cleanConfig(d), Object.assign(_this53.rawBody, d);
11063
11062
  }
11064
- (_this53$maxMessages = _this53.maxMessages) !== null && _this53$maxMessages !== void 0 ? _this53$maxMessages : _this53.maxMessages = -1, (_m$model = (m = _this53.rawBody).model) !== null && _m$model !== void 0 ? _m$model : m.model = "gpt-4o";
11063
+ (_this53$maxMessages = _this53.maxMessages) !== null && _this53$maxMessages !== void 0 ? _this53$maxMessages : _this53.maxMessages = -1, (_p$model = (p = _this53.rawBody).model) !== null && _p$model !== void 0 ? _p$model : p.model = "gpt-4o";
11065
11064
  return _this53;
11066
11065
  }
11067
11066
  _inherits(yt, _W12);
@@ -11247,8 +11246,8 @@ var yt = /*#__PURE__*/function (_W12) {
11247
11246
  tool_calls: e.tool_calls,
11248
11247
  role: "assistant",
11249
11248
  content: null
11250
- }), !a.find(function (_ref30) {
11251
- var f = _ref30.response;
11249
+ }), !a.find(function (_ref29) {
11250
+ var f = _ref29.response;
11252
11251
  return typeof f != "string";
11253
11252
  }) && r.length === a.length)) {
11254
11253
  _context116.next = 43;
@@ -11347,8 +11346,8 @@ var Ts = /*#__PURE__*/function (_yt) {
11347
11346
  s = ((a = (o = t.azure) == null ? void 0 : o.openAI) == null ? void 0 : a.urlDetails) || {},
11348
11347
  r = (c = (l = t.azure) == null ? void 0 : l.openAI) == null ? void 0 : c.chat;
11349
11348
  if (_this55 = _callSuper(this, Ts, [e, me.buildKeyVerificationDetails(s), me.buildHeaders, i, r]), _this55.permittedErrorPrefixes = [me.URL_DETAILS_ERROR_MESSAGE], _this55.isTextInputDisabled = !1, _typeof(r) == "object") {
11350
- var _ref31 = (h = (u = (d = e.directConnection) == null ? void 0 : d.azure) == null ? void 0 : u.openAI) == null ? void 0 : h.chat,
11351
- f = _ref31.function_handler;
11349
+ var _ref30 = (h = (u = (d = e.directConnection) == null ? void 0 : d.azure) == null ? void 0 : u.openAI) == null ? void 0 : h.chat,
11350
+ f = _ref30.function_handler;
11352
11351
  f && (_this55._functionHandler = f);
11353
11352
  }
11354
11353
  me.validateURLDetails(s) ? _this55.url = Ts.buildURL(s) : (_this55.isTextInputDisabled = !0, _this55.canSendMessage = function () {
@@ -11899,9 +11898,9 @@ var sa = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
11899
11898
  }, {
11900
11899
  key: "addMessages",
11901
11900
  value: function addMessages(e, t, i, s) {
11902
- Z.createMessages(e, t, i, s).forEach(function (_ref32) {
11903
- var o = _ref32.type,
11904
- a = _ref32.elements;
11901
+ Z.createMessages(e, t, i, s).forEach(function (_ref31) {
11902
+ var o = _ref31.type,
11903
+ a = _ref31.elements;
11905
11904
  V.addMessage(e, a, o, i, s);
11906
11905
  });
11907
11906
  }
@@ -11967,13 +11966,13 @@ var he = /*#__PURE__*/function () {
11967
11966
  });
11968
11967
  a && (c += 1);
11969
11968
  var d = (o == null ? void 0 : o.outerContainer) || (a == null ? void 0 : a.outerContainer.nextSibling);
11970
- r.forEach(function (_ref33, p) {
11971
- var f = _ref33.type,
11972
- m = _ref33.elements;
11969
+ r.forEach(function (_ref32, p) {
11970
+ var f = _ref32.type,
11971
+ m = _ref32.elements;
11973
11972
  var g;
11974
11973
  V.setElementProps(e, m, f, s), (g = d.parentElement) == null || g.insertBefore(m.outerContainer, d), e.messageElementRefs.splice(e.messageElementRefs.length - 1, 1), e.messageElementRefs.splice(c + p, 0, m);
11975
- }), he.removeFilesMessages(e, t), t[1].files = r.map(function (_ref34) {
11976
- var f = _ref34.elements;
11974
+ }), he.removeFilesMessages(e, t), t[1].files = r.map(function (_ref33) {
11975
+ var f = _ref33.elements;
11977
11976
  return f;
11978
11977
  }), t[0].files = i;
11979
11978
  }
@@ -12042,9 +12041,9 @@ var fe = /*#__PURE__*/function (_pe) {
12042
12041
  r = t.introPanelMarkUp,
12043
12042
  o = t.demo;
12044
12043
  _this59._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this59._onClearMessages = xi.onClearMessages.bind(_this59, e), _this59._onError = xi.onError.bind(_this59, e), _this59._isLoadingMessageAllowed = fe.getDefaultDisplayLoadingMessage(e, t), _typeof(e.displayLoadingBubble) == "object" && e.displayLoadingBubble.toggle && (e.displayLoadingBubble.toggle = _this59.setLoadingToggle.bind(_this59)), _this59._permittedErrorPrefixes = s, _this59.addSetupMessageIfNeeded(e, t) || _this59.populateIntroPanel(i, r, e.introPanelStyle), o && _this59.prepareDemo(ne.processDemo(o), e.loadHistory), _this59.addIntroductoryMessages(e, t), new ri(e, _this59, t), _this59._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
12045
- return JSON.parse(JSON.stringify(_this59.messageToElements.map(function (_ref35) {
12046
- var _ref36 = _slicedToArray(_ref35, 1),
12047
- c = _ref36[0];
12044
+ return JSON.parse(JSON.stringify(_this59.messageToElements.map(function (_ref34) {
12045
+ var _ref35 = _slicedToArray(_ref34, 1),
12046
+ c = _ref35[0];
12048
12047
  return c;
12049
12048
  })));
12050
12049
  }, e.clearMessages = _this59.clearMessages.bind(_this59, t), e.refreshMessages = _this59.refreshTextMessages.bind(_this59, e.remarkable), e.scrollToBottom = ee.scrollToBottom.bind(_this59, _this59.elementRef), e.addMessage = function (c, d) {
@@ -12307,8 +12306,8 @@ var fe = /*#__PURE__*/function (_pe) {
12307
12306
  }], [{
12308
12307
  key: "getDefaultDisplayLoadingMessage",
12309
12308
  value: function getDefaultDisplayLoadingMessage(e, t) {
12310
- var _ref37;
12311
- return t.websocket ? !!e.displayLoadingBubble : (_ref37 = _typeof(e.displayLoadingBubble) == "object" || e.displayLoadingBubble) !== null && _ref37 !== void 0 ? _ref37 : !0;
12309
+ var _ref36;
12310
+ return t.websocket ? !!e.displayLoadingBubble : (_ref36 = _typeof(e.displayLoadingBubble) == "object" || e.displayLoadingBubble) !== null && _ref36 !== void 0 ? _ref36 : !0;
12312
12311
  }
12313
12312
  }, {
12314
12313
  key: "checkPermittedErrorPrefixes",
@@ -12754,8 +12753,8 @@ var X = /*#__PURE__*/function () {
12754
12753
  }),
12755
12754
  c = t["dropup-menu"][l];
12756
12755
  c && (r.addItem(c.button), t["dropup-menu"].splice(l, 1));
12757
- }), t["dropup-menu"].forEach(function (_ref38) {
12758
- var a = _ref38.button;
12756
+ }), t["dropup-menu"].forEach(function (_ref37) {
12757
+ var a = _ref37.button;
12759
12758
  return r.addItem(a);
12760
12759
  });
12761
12760
  var o = Fi.getPosition(t, s);
@@ -14642,7 +14641,7 @@ var pi = /*#__PURE__*/function () {
14642
14641
  case 0:
14643
14642
  _context129.next = 2;
14644
14643
  return Promise.all(this._fileAttachmentsTypes.map(/*#__PURE__*/function () {
14645
- var _ref39 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee128(e) {
14644
+ var _ref38 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee128(e) {
14646
14645
  var t;
14647
14646
  return _regeneratorRuntime().wrap(function _callee128$(_context128) {
14648
14647
  while (1) switch (_context128.prev = _context128.next) {
@@ -14655,7 +14654,7 @@ var pi = /*#__PURE__*/function () {
14655
14654
  }, _callee128);
14656
14655
  }));
14657
14656
  return function (_x233) {
14658
- return _ref39.apply(this, arguments);
14657
+ return _ref38.apply(this, arguments);
14659
14658
  };
14660
14659
  }()));
14661
14660
  case 2:
@@ -15006,7 +15005,7 @@ var Xe = /*#__PURE__*/function () {
15006
15005
  value: function attach(e, t, i, s, r) {
15007
15006
  var o = e.validateInput || ne.processValidateInput(e);
15008
15007
  e._validationHandler = /*#__PURE__*/function () {
15009
- var _ref40 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee132(a) {
15008
+ var _ref39 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee132(a) {
15010
15009
  var l;
15011
15010
  return _regeneratorRuntime().wrap(function _callee132$(_context132) {
15012
15011
  while (1) switch (_context132.prev = _context132.next) {
@@ -15026,7 +15025,7 @@ var Xe = /*#__PURE__*/function () {
15026
15025
  }, _callee132);
15027
15026
  }));
15028
15027
  return function (_x241) {
15029
- return _ref40.apply(this, arguments);
15028
+ return _ref39.apply(this, arguments);
15030
15029
  };
15031
15030
  }();
15032
15031
  }
@@ -15355,12 +15354,12 @@ var I = /*#__PURE__*/function (_ct6) {
15355
15354
  }, {
15356
15355
  key: "addNewMessage",
15357
15356
  value: function () {
15358
- var _addNewMessage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee136(_ref41) {
15357
+ var _addNewMessage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee136(_ref40) {
15359
15358
  var e, t, i;
15360
15359
  return _regeneratorRuntime().wrap(function _callee136$(_context136) {
15361
15360
  while (1) switch (_context136.prev = _context136.next) {
15362
15361
  case 0:
15363
- e = _ref41.text, t = _ref41.files;
15362
+ e = _ref40.text, t = _ref40.files;
15364
15363
  i = {
15365
15364
  role: v.USER_ROLE
15366
15365
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deep-chat-dev",
3
- "version": "9.0.242",
3
+ "version": "9.0.243",
4
4
  "description": "Customizable chat component for AI APIs",
5
5
  "main": "./dist/deepChat.js",
6
6
  "module": "./dist/deepChat.js",