@hivegpt/hiveai-angular 0.0.327 → 0.0.329
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 +31 -10
- 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/bot.service.js +4 -3
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +29 -9
- package/fesm2015/hivegpt-hiveai-angular.js +31 -10
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/lib/components/bot.service.d.ts +1 -1
- package/lib/components/bot.service.d.ts.map +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
|
@@ -670,11 +670,12 @@
|
|
|
670
670
|
this.eventDescription = new rxjs.Subject();
|
|
671
671
|
this.bot_api = 'https://agent-api.hivegpt.ai/';
|
|
672
672
|
}
|
|
673
|
-
BotsService.prototype.fetchSpeechAuthorizationToken = function (botId, apiKey) {
|
|
673
|
+
BotsService.prototype.fetchSpeechAuthorizationToken = function (botId, apiKey, domain) {
|
|
674
674
|
var headers = new i1.HttpHeaders({
|
|
675
675
|
'Content-Type': 'application/json',
|
|
676
676
|
'x-api-key': apiKey,
|
|
677
|
-
'hive-bot-id': botId
|
|
677
|
+
'hive-bot-id': botId,
|
|
678
|
+
'domain-authority': domain
|
|
678
679
|
});
|
|
679
680
|
var apiUrl = this.bot_api + "speech/issue_token";
|
|
680
681
|
var url = "" + apiUrl;
|
|
@@ -849,6 +850,17 @@
|
|
|
849
850
|
ChatDrawerComponent.prototype.ngOnInit = function () {
|
|
850
851
|
var _this = this;
|
|
851
852
|
this.environment = this.isDev ? dev_environment : prod_environment;
|
|
853
|
+
var domain = window.location.hostname;
|
|
854
|
+
// Determine the header value based on the domain
|
|
855
|
+
if (domain.includes('pre-app.social27.com')) {
|
|
856
|
+
this.domainAuthorityValue = 'pre-prod-lite';
|
|
857
|
+
}
|
|
858
|
+
else if (domain.includes('app.social27.com')) {
|
|
859
|
+
this.domainAuthorityValue = 'prod-lite';
|
|
860
|
+
}
|
|
861
|
+
else if (domain.includes('hivegpt.io')) {
|
|
862
|
+
this.domainAuthorityValue = 'hivegpt';
|
|
863
|
+
}
|
|
852
864
|
// this.fetchMyConnections().subscribe();
|
|
853
865
|
// this.fetchPendingRequests().subscribe();
|
|
854
866
|
this.changeTemperature(this.temperature);
|
|
@@ -868,7 +880,7 @@
|
|
|
868
880
|
// this.fetchEditorContent();
|
|
869
881
|
this.cdr.markForCheck();
|
|
870
882
|
// this.initializeSocket();
|
|
871
|
-
this.botService.fetchSpeechAuthorizationToken(this.botId, this.apiKey).subscribe(function (token) {
|
|
883
|
+
this.botService.fetchSpeechAuthorizationToken(this.botId, this.apiKey, this.domainAuthorityValue).subscribe(function (token) {
|
|
872
884
|
_this.authorizationToken = token;
|
|
873
885
|
_this.initializeSpeechRecognizer(token);
|
|
874
886
|
});
|
|
@@ -1047,7 +1059,8 @@
|
|
|
1047
1059
|
var headers = new i1.HttpHeaders({
|
|
1048
1060
|
'Content-Type': 'application/json',
|
|
1049
1061
|
'x-api-key': this.apiKey,
|
|
1050
|
-
'hive-bot-id': this.botId
|
|
1062
|
+
'hive-bot-id': this.botId,
|
|
1063
|
+
'domain-authority': this.domainAuthorityValue
|
|
1051
1064
|
});
|
|
1052
1065
|
var url = this.environment.BASE_URL + "/bot/clear-history/" + this.botId + "/" + this.userId;
|
|
1053
1066
|
return this.http.post(url, { headers: headers }).pipe(operators.switchMap(function (res) {
|
|
@@ -1061,7 +1074,8 @@
|
|
|
1061
1074
|
this.loading = true;
|
|
1062
1075
|
var headers = new i1.HttpHeaders({
|
|
1063
1076
|
'x-api-key': this.apiKey,
|
|
1064
|
-
'hive-bot-id': this.botId
|
|
1077
|
+
'hive-bot-id': this.botId,
|
|
1078
|
+
'domain-authority': this.domainAuthorityValue
|
|
1065
1079
|
});
|
|
1066
1080
|
var url = this.environment.BASE_URL + "/bots?bot_id=" + this.botId;
|
|
1067
1081
|
return this.http.get(url, { headers: headers }).pipe(operators.switchMap(function (res) {
|
|
@@ -1091,7 +1105,8 @@
|
|
|
1091
1105
|
var headers = new i1.HttpHeaders({
|
|
1092
1106
|
accept: 'application/json',
|
|
1093
1107
|
'x-api-key': this.apiKey,
|
|
1094
|
-
'hive-bot-id': this.botId
|
|
1108
|
+
'hive-bot-id': this.botId,
|
|
1109
|
+
'domain-authority': this.domainAuthorityValue
|
|
1095
1110
|
});
|
|
1096
1111
|
return this.http
|
|
1097
1112
|
.get(url, { headers: headers })
|
|
@@ -1286,7 +1301,8 @@
|
|
|
1286
1301
|
.get(url, {
|
|
1287
1302
|
headers: {
|
|
1288
1303
|
'x-api-key': this.apiKey,
|
|
1289
|
-
'hive-bot-id': this.botId
|
|
1304
|
+
'hive-bot-id': this.botId,
|
|
1305
|
+
'domain-authority': this.domainAuthorityValue
|
|
1290
1306
|
},
|
|
1291
1307
|
})
|
|
1292
1308
|
.pipe(operators.catchError(function (error) {
|
|
@@ -1454,7 +1470,8 @@
|
|
|
1454
1470
|
headers: {
|
|
1455
1471
|
'Content-Type': 'application/json',
|
|
1456
1472
|
'apiKey': 'Conversation_WIz/qAm+EEmfOkFaUA/weA==',
|
|
1457
|
-
'hive-bot-id': this.botId
|
|
1473
|
+
'hive-bot-id': this.botId,
|
|
1474
|
+
'domain-authority': this.domainAuthorityValue
|
|
1458
1475
|
},
|
|
1459
1476
|
body: JSON.stringify({ messageId: message._id, isHelpful: flag }),
|
|
1460
1477
|
}).then(function () {
|
|
@@ -1845,6 +1862,7 @@
|
|
|
1845
1862
|
var headers = new i1.HttpHeaders({
|
|
1846
1863
|
'Content-Type': 'application/json',
|
|
1847
1864
|
apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',
|
|
1865
|
+
'domain-authority': this.domainAuthorityValue
|
|
1848
1866
|
});
|
|
1849
1867
|
return this.http.get(url, { headers: headers }).pipe(operators.switchMap(function (res) {
|
|
1850
1868
|
if (res) {
|
|
@@ -2134,7 +2152,7 @@
|
|
|
2134
2152
|
ChatDrawerComponent.prototype.makeAskRequest = function (inputMsg, agents, conversationId, msg, chat, workflowId, workflow_inputs) {
|
|
2135
2153
|
var _this = this;
|
|
2136
2154
|
var _a;
|
|
2137
|
-
var url = this.environment.BASE_URL + "/ai/ask
|
|
2155
|
+
var url = this.environment.BASE_URL + "/ai/ask";
|
|
2138
2156
|
var body = {
|
|
2139
2157
|
user_question: inputMsg,
|
|
2140
2158
|
user_id: this.userId,
|
|
@@ -2142,6 +2160,8 @@
|
|
|
2142
2160
|
message_id: this.conversationService.generateKey(),
|
|
2143
2161
|
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 : [],
|
|
2144
2162
|
conversation_id: conversationId,
|
|
2163
|
+
first_name: this.firstName,
|
|
2164
|
+
last_name: this.lastName
|
|
2145
2165
|
};
|
|
2146
2166
|
if (workflowId) {
|
|
2147
2167
|
body['workflow_id'] = workflowId;
|
|
@@ -2153,7 +2173,8 @@
|
|
|
2153
2173
|
'Content-Type': 'application/json',
|
|
2154
2174
|
Authorization: 'Bearer ' + this.s27Token,
|
|
2155
2175
|
'x-api-key': this.apiKey,
|
|
2156
|
-
'hive-bot-id': this.botId
|
|
2176
|
+
'hive-bot-id': this.botId,
|
|
2177
|
+
'domain-authority': this.domainAuthorityValue
|
|
2157
2178
|
},
|
|
2158
2179
|
body: JSON.stringify(body),
|
|
2159
2180
|
})
|