bibot 1.0.52 → 1.0.54

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.
@@ -3534,6 +3534,20 @@ var getRemoteClientChatBubbleConfig = function getRemoteClientChatBubbleConfig(p
3534
3534
  return Promise.reject(e);
3535
3535
  }
3536
3536
  };
3537
+ var recordPredefinedQ = function recordPredefinedQ(pluginAxiosInstance, data) {
3538
+ try {
3539
+ return Promise.resolve(_catch(function () {
3540
+ var path = "" + domain.inference + resources.predefinedQstatistics;
3541
+ return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
3542
+ return response.data;
3543
+ });
3544
+ }, function (error) {
3545
+ return error.message;
3546
+ }));
3547
+ } catch (e) {
3548
+ return Promise.reject(e);
3549
+ }
3550
+ };
3537
3551
  var handleRetries = function handleRetries(pluginAxiosInstance, data, attempt) {
3538
3552
  try {
3539
3553
  var maxAttempts = 30;
@@ -3571,28 +3585,20 @@ var askBiBot = function askBiBot(pluginAxiosInstance, data) {
3571
3585
  return Promise.resolve(_catch(function () {
3572
3586
  var path = "" + domain.inference + resources.q;
3573
3587
  return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
3574
- if (response.data.message === defaultSlacker) {
3588
+ if (response.data.message === defaultSlacker || response.status === 504) {
3575
3589
  return Promise.resolve(handleRetries(pluginAxiosInstance, data, 1));
3576
3590
  } else {
3577
3591
  return response.data;
3578
3592
  }
3579
3593
  });
3580
- }, function (error1) {
3581
- return error1.message;
3582
- }));
3583
- } catch (e) {
3584
- return Promise.reject(e);
3585
- }
3586
- };
3587
- var recordPredefinedQ = function recordPredefinedQ(pluginAxiosInstance, data) {
3588
- try {
3589
- return Promise.resolve(_catch(function () {
3590
- var path = "" + domain.inference + resources.predefinedQstatistics;
3591
- return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
3592
- return response.data;
3593
- });
3594
3594
  }, function (error) {
3595
- return error.message;
3595
+ if (error.response && error.response.status === 504) {
3596
+ return Promise.resolve(handleRetries(pluginAxiosInstance, data, 1));
3597
+ } else {
3598
+ return {
3599
+ message: error.message
3600
+ };
3601
+ }
3596
3602
  }));
3597
3603
  } catch (e) {
3598
3604
  return Promise.reject(e);
@@ -3606,9 +3612,15 @@ var askTimedOutBiBot = function askTimedOutBiBot(pluginAxiosInstance, data) {
3606
3612
  return response.data;
3607
3613
  });
3608
3614
  }, function (error) {
3609
- return {
3610
- message: error.message
3611
- };
3615
+ if (error.response && error.response.status === 504) {
3616
+ return {
3617
+ message: defaultSlacker
3618
+ };
3619
+ } else {
3620
+ return {
3621
+ message: error.message
3622
+ };
3623
+ }
3612
3624
  }));
3613
3625
  } catch (e) {
3614
3626
  return Promise.reject(e);
@@ -3707,7 +3719,6 @@ var useBiBotChatBot = function useBiBotChatBot(bibotProps) {
3707
3719
  var _useContext = useContext(AppContext),
3708
3720
  state = _useContext.state,
3709
3721
  dispatch = _useContext.dispatch;
3710
- console.log('This is the value of test and bibotProps', bibotProps.test, bibotProps);
3711
3722
  var baseURL = bibotProps !== null && bibotProps !== void 0 && bibotProps.test ? endpoints.getInferenceURL(bibotProps === null || bibotProps === void 0 ? void 0 : bibotProps.test) : endpoints.getInferenceURL(false);
3712
3723
  var pluginAxiosInstance = createPluginAxiosInstance(baseURL, {}, {
3713
3724
  Authorization: bibotProps.jwt