@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.
@@ -960,10 +960,11 @@ class ChatDrawerComponent {
960
960
  this.pump(controller, reader, allSuggestions);
961
961
  });
962
962
  }
963
- submitFeedback(flag) {
963
+ submitFeedback(flag, message) {
964
964
  this.feedbackDone = true;
965
965
  this.showFeedBackIconsIndex = null;
966
- const url = `${this.environment.BASE_URL}/bot/feedback`;
966
+ const conversation_id = this.conversationService.getKey(this.botId);
967
+ const url = `${this.environment.AGENTS_API}/Conversation/coPilot/${this.botId}/conversation/${conversation_id}/helpful-response`;
967
968
  fetch(url, {
968
969
  method: 'POST',
969
970
  headers: {
@@ -971,7 +972,7 @@ class ChatDrawerComponent {
971
972
  'x-api-key': this.apiKey,
972
973
  'hive-bot-id': this.botId
973
974
  },
974
- body: JSON.stringify({ flag, user_id: this.userId, bot_id: this.botId }),
975
+ body: JSON.stringify({ isHelpful: flag, messageId: message.message_id }),
975
976
  }).then(() => {
976
977
  if (flag) {
977
978
  this.chatLog.push({
@@ -1017,7 +1018,7 @@ class ChatDrawerComponent {
1017
1018
  if (this.feedbackDone) {
1018
1019
  return;
1019
1020
  }
1020
- this.submitFeedback(true);
1021
+ this.submitFeedback(true, this.chatLog[idx]);
1021
1022
  this.chatLog[idx].liked = !this.chatLog[idx].liked;
1022
1023
  if (this.chatLog[idx].unliked) {
1023
1024
  this.chatLog[idx].unliked = !this.chatLog[idx].unliked;
@@ -1027,7 +1028,7 @@ class ChatDrawerComponent {
1027
1028
  handleDownClick(idx) {
1028
1029
  if (this.feedbackDone)
1029
1030
  return;
1030
- this.submitFeedback(false);
1031
+ this.submitFeedback(false, this.chatLog[idx]);
1031
1032
  this.chatLog[idx].unliked = !this.chatLog[idx].unliked;
1032
1033
  if (this.chatLog[idx].liked)
1033
1034
  this.chatLog[idx].liked = !this.chatLog[idx].liked;