@hivegpt/hiveai-angular 0.0.385 → 0.0.387
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.
- package/bundles/hivegpt-hiveai-angular.umd.js +46 -33
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +47 -34
- package/fesm2015/hivegpt-hiveai-angular.js +46 -33
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/hivegpt-hiveai-angular.metadata.json +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts +1 -0
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1082,7 +1082,7 @@
|
|
|
1082
1082
|
this.recognizedText = '';
|
|
1083
1083
|
this.authorizationToken = '';
|
|
1084
1084
|
this.region = 'westeurope'; // Set your Azure region here
|
|
1085
|
-
this.domainAuthorityValue =
|
|
1085
|
+
this.domainAuthorityValue = 'prod-lite';
|
|
1086
1086
|
this.isChatingWithAi = false;
|
|
1087
1087
|
this.readAllChunks = function (stream) {
|
|
1088
1088
|
var reader = stream.getReader();
|
|
@@ -1215,7 +1215,9 @@
|
|
|
1215
1215
|
// this.fetchEditorContent();
|
|
1216
1216
|
this.cdr.markForCheck();
|
|
1217
1217
|
// this.initializeSocket();
|
|
1218
|
-
this.botService
|
|
1218
|
+
this.botService
|
|
1219
|
+
.fetchSpeechAuthorizationToken(this.botId, this.apiKey, this.domainAuthorityValue)
|
|
1220
|
+
.subscribe(function (token) {
|
|
1219
1221
|
_this.authorizationToken = token;
|
|
1220
1222
|
_this.initializeSpeechRecognizer(token);
|
|
1221
1223
|
});
|
|
@@ -1257,15 +1259,18 @@
|
|
|
1257
1259
|
_this.currentWorkflowAction = action_name;
|
|
1258
1260
|
var actionIndex = _this.workflowExecutionDetails.Actions.findIndex(function (a) { return a.Name == current_action_name_1; });
|
|
1259
1261
|
if (actionIndex !== -1) {
|
|
1260
|
-
_this.workflowExecutionDetails.Actions[actionIndex]['Output'] =
|
|
1262
|
+
_this.workflowExecutionDetails.Actions[actionIndex]['Output'] =
|
|
1263
|
+
output;
|
|
1261
1264
|
_this.workflowExecutionDetails.Actions[actionIndex]['InsertTimeStamp'] = formatTimeStamps(_this.timezone, time_stamp);
|
|
1262
1265
|
}
|
|
1263
1266
|
else {
|
|
1264
1267
|
console.error("Action with name " + action_name + " not found");
|
|
1265
1268
|
}
|
|
1266
|
-
_this.currentWorkflowExecutionDetails =
|
|
1269
|
+
_this.currentWorkflowExecutionDetails =
|
|
1270
|
+
_this.workflowExecutionDetails;
|
|
1267
1271
|
if (_this.currentWorkflowActionProgress == 100) {
|
|
1268
|
-
_this.chatLog[_this.chatLog.length - 1]['WorkflowExecutionId'] =
|
|
1272
|
+
_this.chatLog[_this.chatLog.length - 1]['WorkflowExecutionId'] =
|
|
1273
|
+
workflow_execution_id;
|
|
1269
1274
|
_this.isChatingWithAi = false;
|
|
1270
1275
|
_this.executingWorkflow = false;
|
|
1271
1276
|
}
|
|
@@ -1307,7 +1312,8 @@
|
|
|
1307
1312
|
if (answer) {
|
|
1308
1313
|
_this.isChatingWithAi = false;
|
|
1309
1314
|
console.log('Answer:', answer);
|
|
1310
|
-
currentChatMessage.message =
|
|
1315
|
+
currentChatMessage.message =
|
|
1316
|
+
_this.processMessageForDisplay(answer);
|
|
1311
1317
|
_this.cdr.detectChanges();
|
|
1312
1318
|
_this.scrollToBottom();
|
|
1313
1319
|
}
|
|
@@ -1395,7 +1401,7 @@
|
|
|
1395
1401
|
'Content-Type': 'application/json',
|
|
1396
1402
|
'x-api-key': this.apiKey,
|
|
1397
1403
|
'hive-bot-id': this.botId,
|
|
1398
|
-
'domain-authority': this.domainAuthorityValue
|
|
1404
|
+
'domain-authority': this.domainAuthorityValue,
|
|
1399
1405
|
});
|
|
1400
1406
|
var url = this.environment.BASE_URL + "/bot/clear-history/" + this.botId + "/" + this.userId;
|
|
1401
1407
|
return this.http.post(url, { headers: headers }).pipe(operators.switchMap(function (res) {
|
|
@@ -1413,7 +1419,7 @@
|
|
|
1413
1419
|
var headers = new i1.HttpHeaders({
|
|
1414
1420
|
'x-api-key': this.apiKey,
|
|
1415
1421
|
'hive-bot-id': this.botId,
|
|
1416
|
-
'domain-authority': this.domainAuthorityValue
|
|
1422
|
+
'domain-authority': this.domainAuthorityValue,
|
|
1417
1423
|
});
|
|
1418
1424
|
var url = this.environment.BASE_URL + "/bots?bot_id=" + this.botId;
|
|
1419
1425
|
return this.http.get(url, { headers: headers }).pipe(operators.switchMap(function (res) {
|
|
@@ -1446,7 +1452,7 @@
|
|
|
1446
1452
|
accept: 'application/json',
|
|
1447
1453
|
'x-api-key': this.apiKey,
|
|
1448
1454
|
'hive-bot-id': this.botId,
|
|
1449
|
-
'domain-authority': this.domainAuthorityValue
|
|
1455
|
+
'domain-authority': this.domainAuthorityValue,
|
|
1450
1456
|
});
|
|
1451
1457
|
return this.http
|
|
1452
1458
|
.get(url, { headers: headers })
|
|
@@ -1497,7 +1503,7 @@
|
|
|
1497
1503
|
copied: false,
|
|
1498
1504
|
isCollapsedTrue: false,
|
|
1499
1505
|
WorkflowExecutionId: chat.WorkflowExecutionId,
|
|
1500
|
-
_id: chat._id
|
|
1506
|
+
_id: chat._id,
|
|
1501
1507
|
});
|
|
1502
1508
|
}
|
|
1503
1509
|
if (chat.Type == 'ai') {
|
|
@@ -1516,7 +1522,7 @@
|
|
|
1516
1522
|
time: formatTimeStamps(_this.timezone, chat.InsertTimestamp),
|
|
1517
1523
|
copied: false,
|
|
1518
1524
|
isCollapsedTrue: false,
|
|
1519
|
-
_id: chat._id
|
|
1525
|
+
_id: chat._id,
|
|
1520
1526
|
});
|
|
1521
1527
|
_this.showFeedBackIconsIndex = _this.chatLog.length - 1;
|
|
1522
1528
|
}
|
|
@@ -1642,7 +1648,7 @@
|
|
|
1642
1648
|
headers: {
|
|
1643
1649
|
'x-api-key': this.apiKey,
|
|
1644
1650
|
'hive-bot-id': this.botId,
|
|
1645
|
-
'domain-authority': this.domainAuthorityValue
|
|
1651
|
+
'domain-authority': this.domainAuthorityValue,
|
|
1646
1652
|
},
|
|
1647
1653
|
})
|
|
1648
1654
|
.pipe(operators.catchError(function (error) {
|
|
@@ -1809,9 +1815,9 @@
|
|
|
1809
1815
|
method: 'POST',
|
|
1810
1816
|
headers: {
|
|
1811
1817
|
'Content-Type': 'application/json',
|
|
1812
|
-
|
|
1818
|
+
apiKey: 'Conversation_WIz/qAm+EEmfOkFaUA/weA==',
|
|
1813
1819
|
'hive-bot-id': this.botId,
|
|
1814
|
-
'domain-authority': this.domainAuthorityValue
|
|
1820
|
+
'domain-authority': this.domainAuthorityValue,
|
|
1815
1821
|
},
|
|
1816
1822
|
body: JSON.stringify({ messageId: message._id, isHelpful: flag }),
|
|
1817
1823
|
}).then(function () {
|
|
@@ -1984,7 +1990,8 @@
|
|
|
1984
1990
|
var _this = this;
|
|
1985
1991
|
var counter = 0;
|
|
1986
1992
|
var interval = setInterval(function () {
|
|
1987
|
-
_this.chatMain.nativeElement.scrollTop =
|
|
1993
|
+
_this.chatMain.nativeElement.scrollTop =
|
|
1994
|
+
_this.chatMain.nativeElement.scrollHeight;
|
|
1988
1995
|
if (counter++ > 5)
|
|
1989
1996
|
clearInterval(interval);
|
|
1990
1997
|
}, 5);
|
|
@@ -2208,7 +2215,7 @@
|
|
|
2208
2215
|
var headers = new i1.HttpHeaders({
|
|
2209
2216
|
'Content-Type': 'application/json',
|
|
2210
2217
|
apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',
|
|
2211
|
-
'domain-authority': this.domainAuthorityValue
|
|
2218
|
+
'domain-authority': this.domainAuthorityValue,
|
|
2212
2219
|
});
|
|
2213
2220
|
return this.http.get(url, { headers: headers }).pipe(operators.switchMap(function (res) {
|
|
2214
2221
|
if (res) {
|
|
@@ -2407,8 +2414,7 @@
|
|
|
2407
2414
|
event.preventDefault();
|
|
2408
2415
|
}
|
|
2409
2416
|
}
|
|
2410
|
-
catch (error) {
|
|
2411
|
-
}
|
|
2417
|
+
catch (error) { }
|
|
2412
2418
|
var textarea = event.target;
|
|
2413
2419
|
textarea.style.height = 'auto'; // Reset the height
|
|
2414
2420
|
textarea.style.height = textarea.scrollHeight + "px"; // Adjust height to match content
|
|
@@ -2464,8 +2470,10 @@
|
|
|
2464
2470
|
var input = this.prepareHtml(this.generateMarkdown(this.selectedWorkflow.Name, this.workflowForm.value));
|
|
2465
2471
|
// update last two chatLog entries, set showWorkflowExecutionLoader = false
|
|
2466
2472
|
try {
|
|
2467
|
-
this.chatLog[this.chatLog.length - 1]['showWorkflowExecutionLoader'] =
|
|
2468
|
-
|
|
2473
|
+
this.chatLog[this.chatLog.length - 1]['showWorkflowExecutionLoader'] =
|
|
2474
|
+
false;
|
|
2475
|
+
this.chatLog[this.chatLog.length - 2]['showWorkflowExecutionLoader'] =
|
|
2476
|
+
false;
|
|
2469
2477
|
}
|
|
2470
2478
|
catch (error) { }
|
|
2471
2479
|
this.chatLog.push({
|
|
@@ -2508,23 +2516,27 @@
|
|
|
2508
2516
|
agents: (_a = agents === null || agents === void 0 ? void 0 : agents.filter(function (p) { return p.selected; }).map(function (p) { return p.id; })) !== null && _a !== void 0 ? _a : [],
|
|
2509
2517
|
conversation_id: conversationId,
|
|
2510
2518
|
first_name: this.firstName,
|
|
2511
|
-
last_name: this.lastName
|
|
2519
|
+
last_name: this.lastName,
|
|
2512
2520
|
};
|
|
2513
2521
|
if (workflowId) {
|
|
2514
2522
|
body['workflow_id'] = workflowId;
|
|
2515
2523
|
body['workflow_inputs'] = workflow_inputs;
|
|
2516
2524
|
}
|
|
2525
|
+
var headers = {
|
|
2526
|
+
'Content-Type': 'application/json',
|
|
2527
|
+
Authorization: 'Bearer ' + this.s27Token,
|
|
2528
|
+
'x-api-key': this.apiKey,
|
|
2529
|
+
'hive-bot-id': this.botId,
|
|
2530
|
+
'domain-authority': this.domainAuthorityValue,
|
|
2531
|
+
event_url: this.eventUrl,
|
|
2532
|
+
event_token: this.eventToken,
|
|
2533
|
+
};
|
|
2534
|
+
if (this.workspaceToken) {
|
|
2535
|
+
headers['workspaceToken'] = this.workspaceToken;
|
|
2536
|
+
}
|
|
2517
2537
|
fetch(url, {
|
|
2518
2538
|
method: 'POST',
|
|
2519
|
-
headers:
|
|
2520
|
-
'Content-Type': 'application/json',
|
|
2521
|
-
Authorization: 'Bearer ' + this.s27Token,
|
|
2522
|
-
'x-api-key': this.apiKey,
|
|
2523
|
-
'hive-bot-id': this.botId,
|
|
2524
|
-
'domain-authority': this.domainAuthorityValue,
|
|
2525
|
-
'event_url': this.eventUrl,
|
|
2526
|
-
'event_token': this.eventToken
|
|
2527
|
-
},
|
|
2539
|
+
headers: headers,
|
|
2528
2540
|
body: JSON.stringify(body),
|
|
2529
2541
|
})
|
|
2530
2542
|
.then(function (response) {
|
|
@@ -2582,8 +2594,7 @@
|
|
|
2582
2594
|
'hive-bot-id': this.botId,
|
|
2583
2595
|
'domain-authority': this.domainAuthorityValue,
|
|
2584
2596
|
});
|
|
2585
|
-
this.http.post(url, body, { headers: headers })
|
|
2586
|
-
.subscribe({
|
|
2597
|
+
this.http.post(url, body, { headers: headers }).subscribe({
|
|
2587
2598
|
next: function (data) {
|
|
2588
2599
|
console.log(data);
|
|
2589
2600
|
// Additional response handling if needed
|
|
@@ -2711,7 +2722,8 @@
|
|
|
2711
2722
|
this.recognizer.stopContinuousRecognitionAsync();
|
|
2712
2723
|
};
|
|
2713
2724
|
ChatDrawerComponent.prototype.checkForCop29BotId = function () {
|
|
2714
|
-
return this.botId == '66fa3f276c5d71e2717bfea8' ||
|
|
2725
|
+
return (this.botId == '66fa3f276c5d71e2717bfea8' ||
|
|
2726
|
+
this.botId == '671633545652dd78efec848d');
|
|
2715
2727
|
};
|
|
2716
2728
|
ChatDrawerComponent.prototype.getLatestTime = function (time) {
|
|
2717
2729
|
if (time) {
|
|
@@ -2771,6 +2783,7 @@
|
|
|
2771
2783
|
eventId: [{ type: i0.Input }],
|
|
2772
2784
|
eventUrl: [{ type: i0.Input }],
|
|
2773
2785
|
eventToken: [{ type: i0.Input }],
|
|
2786
|
+
workspaceToken: [{ type: i0.Input }],
|
|
2774
2787
|
s27Token: [{ type: i0.Input }],
|
|
2775
2788
|
eventName: [{ type: i0.Input }],
|
|
2776
2789
|
botIcon: [{ type: i0.Input }],
|