@hivegpt/hiveai-angular 0.0.307 → 0.0.308

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.
@@ -1437,11 +1437,12 @@
1437
1437
  _this.pump(controller, reader, allSuggestions);
1438
1438
  });
1439
1439
  };
1440
- ChatDrawerComponent.prototype.submitFeedback = function (flag) {
1440
+ ChatDrawerComponent.prototype.submitFeedback = function (flag, message) {
1441
1441
  var _this = this;
1442
1442
  this.feedbackDone = true;
1443
1443
  this.showFeedBackIconsIndex = null;
1444
- var url = this.environment.BASE_URL + "/bot/feedback";
1444
+ var conversation_id = this.conversationService.getKey(this.botId);
1445
+ var url = this.environment.AGENTS_API + "/Conversation/coPilot/" + this.botId + "/conversation/" + conversation_id + "/helpful-response";
1445
1446
  fetch(url, {
1446
1447
  method: 'POST',
1447
1448
  headers: {
@@ -1449,7 +1450,7 @@
1449
1450
  'x-api-key': this.apiKey,
1450
1451
  'hive-bot-id': this.botId
1451
1452
  },
1452
- body: JSON.stringify({ flag: flag, user_id: this.userId, bot_id: this.botId }),
1453
+ body: JSON.stringify({ isHelpful: flag, messageId: message.message_id }),
1453
1454
  }).then(function () {
1454
1455
  if (flag) {
1455
1456
  _this.chatLog.push({
@@ -1495,7 +1496,7 @@
1495
1496
  if (this.feedbackDone) {
1496
1497
  return;
1497
1498
  }
1498
- this.submitFeedback(true);
1499
+ this.submitFeedback(true, this.chatLog[idx]);
1499
1500
  this.chatLog[idx].liked = !this.chatLog[idx].liked;
1500
1501
  if (this.chatLog[idx].unliked) {
1501
1502
  this.chatLog[idx].unliked = !this.chatLog[idx].unliked;
@@ -1505,7 +1506,7 @@
1505
1506
  ChatDrawerComponent.prototype.handleDownClick = function (idx) {
1506
1507
  if (this.feedbackDone)
1507
1508
  return;
1508
- this.submitFeedback(false);
1509
+ this.submitFeedback(false, this.chatLog[idx]);
1509
1510
  this.chatLog[idx].unliked = !this.chatLog[idx].unliked;
1510
1511
  if (this.chatLog[idx].liked)
1511
1512
  this.chatLog[idx].liked = !this.chatLog[idx].liked;