@hivegpt/hiveai-angular 0.0.170 → 0.0.172

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.
@@ -815,11 +815,46 @@
815
815
  this.eventSubscription = this.conversation
816
816
  .getUserSpecificNotification()
817
817
  .subscribe(function (res) {
818
- console.log("Socket Data");
819
- console.log(res);
818
+ // Check if OtherFields exists in the response
819
+ if (res.OtherFields) {
820
+ var _e = res.OtherFields, conversation_id = _e.conversation_id, bot_id = _e.bot_id, answer = _e.answer, web_results = _e.web_results, financial_graphs = _e.financial_graphs, execution_graphs = _e.execution_graphs, online_search_terms = _e.online_search_terms;
821
+ // Handle the fields based on their presence
822
+ if (answer) {
823
+ _this.isChatingWithAi = false;
824
+ console.log('Answer:', answer);
825
+ _this.chatLog.push({
826
+ type: 'ai',
827
+ message: _this.processMessageForDisplay(answer),
828
+ time: formatNow(_this.timezone),
829
+ });
830
+ _this.showFeedBackIconsIndex = _this.chatLog.length - 1;
831
+ _this.cdr.markForCheck();
832
+ _this.scrollToBottom();
833
+ }
834
+ if (web_results && Array.isArray(web_results)) {
835
+ console.log('Web Results:', web_results);
836
+ // Process web results as needed
837
+ }
838
+ if (financial_graphs && Array.isArray(financial_graphs)) {
839
+ console.log('Financial Graphs:', financial_graphs);
840
+ // Process financial graphs as needed
841
+ }
842
+ if (execution_graphs && Array.isArray(execution_graphs)) {
843
+ console.log('Execution Graphs:', execution_graphs);
844
+ // Process execution graphs as needed
845
+ }
846
+ if (online_search_terms && Array.isArray(online_search_terms)) {
847
+ console.log('Online Search Terms:', online_search_terms);
848
+ // Process online search terms as needed
849
+ }
850
+ // Add any other fields and their processing here
851
+ }
852
+ else {
853
+ console.warn('OtherFields is missing in the response');
854
+ }
820
855
  }, function (err) {
821
856
  _this.eventSubscription.unsubscribe();
822
- console.error('Error in fetching data from socket');
857
+ console.error('Error in fetching data from socket', err);
823
858
  });
824
859
  };
825
860
  ChatDrawerComponent.prototype.initializeSocketAndListen = function () {
@@ -1050,7 +1085,7 @@
1050
1085
  }
1051
1086
  this.chatLog.push({
1052
1087
  type: 'user',
1053
- message: this.processMessage(this.input),
1088
+ message: this.processMessageForDisplay(this.input),
1054
1089
  time: formatNow(this.timezone),
1055
1090
  copied: false,
1056
1091
  isCollapsedTrue: false
@@ -1079,7 +1114,8 @@
1079
1114
  })
1080
1115
  // Retrieve its body as ReadableStream
1081
1116
  .then(function (response) {
1082
- return _this.readAllChunks(response.body);
1117
+ //return this.readAllChunks(response.body);
1118
+ return rxjs.of(null);
1083
1119
  })
1084
1120
  .catch(function (err) {
1085
1121
  console.error('Err: ', err);
@@ -1096,7 +1132,7 @@
1096
1132
  this.scrollToBottom();
1097
1133
  this.chatLog.push({
1098
1134
  type: 'user',
1099
- message: this.processMessage(inputMsg),
1135
+ message: this.processMessageForDisplay(inputMsg),
1100
1136
  time: formatNow(this.timezone),
1101
1137
  copied: false,
1102
1138
  isCollapsedTrue: false