@hivegpt/hiveai-angular 0.0.331 → 0.0.332

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.
@@ -1661,7 +1661,7 @@ class ChatDrawerComponent {
1661
1661
  this.makeAskRequest(input, this.agents, this.conversationKey, '', null, this.selectedWorkflow['_id'], this.workflowForm.value);
1662
1662
  }
1663
1663
  }
1664
- makeAskRequest(inputMsg, agents, conversationId, msg, chat, workflowId, workflow_inputs) {
1664
+ makeAskRequest_fetch(inputMsg, agents, conversationId, msg, chat, workflowId, workflow_inputs) {
1665
1665
  var _a;
1666
1666
  var url = `${this.environment.BASE_URL}/ai/ask`;
1667
1667
  var body = {
@@ -1720,6 +1720,47 @@ class ChatDrawerComponent {
1720
1720
  this.scrollToBottom();
1721
1721
  this.cdr.markForCheck();
1722
1722
  }
1723
+ makeAskRequest(inputMsg, agents, conversationId, msg, chat, workflowId, workflow_inputs) {
1724
+ var _a;
1725
+ const url = `${this.environment.BASE_URL}/ai/ask`;
1726
+ const body = {
1727
+ user_question: inputMsg,
1728
+ user_id: this.userId,
1729
+ bot_id: this.botId,
1730
+ message_id: this.conversationService.generateKey(),
1731
+ agents: (_a = agents === null || agents === void 0 ? void 0 : agents.filter((p) => p.selected).map((p) => p.id)) !== null && _a !== void 0 ? _a : [],
1732
+ conversation_id: conversationId,
1733
+ first_name: this.firstName,
1734
+ last_name: this.lastName,
1735
+ };
1736
+ if (workflowId) {
1737
+ body['workflow_id'] = workflowId;
1738
+ body['workflow_inputs'] = workflow_inputs;
1739
+ }
1740
+ const headers = new HttpHeaders({
1741
+ 'Content-Type': 'application/json',
1742
+ 'x-api-key': this.apiKey,
1743
+ 'hive-bot-id': this.botId,
1744
+ 'domain-authority': this.domainAuthorityValue,
1745
+ });
1746
+ this.http.post(url, body, { headers })
1747
+ .subscribe({
1748
+ next: (data) => {
1749
+ console.log(data);
1750
+ // Additional response handling if needed
1751
+ },
1752
+ error: (err) => {
1753
+ console.error('Error: ', err);
1754
+ this.isChatingWithAi = false;
1755
+ },
1756
+ });
1757
+ this.input = '';
1758
+ this.selectedWorkflow = null;
1759
+ this.openWorkflowInput = false;
1760
+ this.isWorkflowOpen = false;
1761
+ this.scrollToBottom();
1762
+ this.cdr.markForCheck();
1763
+ }
1723
1764
  generateMarkdown(title, obj) {
1724
1765
  var _a;
1725
1766
  // Initialize markdown with the title