bibot 1.0.32 → 1.0.34
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/component/bibot.d.ts +3 -1
- package/dist/hooks/useBiBotChatBot.d.ts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +25 -33
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +25 -33
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -3492,33 +3492,17 @@ var AppProvider = function AppProvider(_ref) {
|
|
3492
3492
|
};
|
3493
3493
|
|
3494
3494
|
var getRemoteClientChatPredefinedQuestions = function getRemoteClientChatPredefinedQuestions(params) {
|
3495
|
-
|
3496
|
-
|
3497
|
-
|
3498
|
-
|
3499
|
-
|
3500
|
-
|
3501
|
-
|
3502
|
-
|
3503
|
-
|
3504
|
-
|
3505
|
-
|
3506
|
-
question: 'These are placeholders',
|
3507
|
-
answer: ''
|
3508
|
-
}, {
|
3509
|
-
question: 'They will be removed in production',
|
3510
|
-
answer: ''
|
3511
|
-
}, {
|
3512
|
-
question: 'This will be empty if there are no predefined questions',
|
3513
|
-
answer: ''
|
3514
|
-
}, {
|
3515
|
-
question: 'So hide if there are no predefined questions',
|
3516
|
-
answer: ''
|
3517
|
-
}];
|
3518
|
-
}));
|
3519
|
-
} catch (e) {
|
3520
|
-
return Promise.reject(e);
|
3521
|
-
}
|
3495
|
+
return Promise.resolve(_catch(function () {
|
3496
|
+
var path = "" + domain.inference + resources.predefinedQ;
|
3497
|
+
return Promise.resolve(pluginAxiosInstance.get(path, {
|
3498
|
+
params: params
|
3499
|
+
})).then(function (response) {
|
3500
|
+
console.log(response.data.predefined_questions);
|
3501
|
+
return response.data.predefined_questions;
|
3502
|
+
});
|
3503
|
+
}, function () {
|
3504
|
+
return [];
|
3505
|
+
}));
|
3522
3506
|
};
|
3523
3507
|
var getRemoteClientChatBubbleConfig = function getRemoteClientChatBubbleConfig(params) {
|
3524
3508
|
try {
|
@@ -3627,7 +3611,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
|
|
3627
3611
|
return Promise.resolve(askBiBot({
|
3628
3612
|
client_id: clientId,
|
3629
3613
|
q: input,
|
3630
|
-
session_id: state.sessionId,
|
3614
|
+
session_id: client_session_id ? client_session_id : state.sessionId,
|
3631
3615
|
chat_id: v4()
|
3632
3616
|
})).then(function (response) {
|
3633
3617
|
setMessages(function (messages) {
|
@@ -3680,7 +3664,8 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
|
|
3680
3664
|
return Promise.reject(e);
|
3681
3665
|
}
|
3682
3666
|
};
|
3683
|
-
var clientId = _ref.clientId
|
3667
|
+
var clientId = _ref.clientId,
|
3668
|
+
client_session_id = _ref.client_session_id;
|
3684
3669
|
var _useState = useState([]),
|
3685
3670
|
predefinedQuestions = _useState[0],
|
3686
3671
|
setPredefinedQuestions = _useState[1];
|
@@ -4128,9 +4113,13 @@ var PredefinedQuestions = function PredefinedQuestions(_ref) {
|
|
4128
4113
|
};
|
4129
4114
|
var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
|
4130
4115
|
var _chatBubbleConfig$col2, _chatBubbleConfig$col3;
|
4131
|
-
var clientId = _ref2.clientId
|
4116
|
+
var clientId = _ref2.clientId,
|
4117
|
+
client_session_id = _ref2.client_session_id,
|
4118
|
+
redirect_notice = _ref2.redirect_notice;
|
4132
4119
|
var _useBiBotChatBot2 = useBiBotChatBot({
|
4133
|
-
clientId: clientId
|
4120
|
+
clientId: clientId,
|
4121
|
+
client_session_id: client_session_id,
|
4122
|
+
redirect_notice: redirect_notice
|
4134
4123
|
}),
|
4135
4124
|
chatIsOpen = _useBiBotChatBot2.chatIsOpen,
|
4136
4125
|
messages = _useBiBotChatBot2.messages,
|
@@ -4338,9 +4327,12 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
|
|
4338
4327
|
};
|
4339
4328
|
|
4340
4329
|
var BiBot = function BiBot(_ref) {
|
4341
|
-
var clientId = _ref.clientId
|
4330
|
+
var clientId = _ref.clientId,
|
4331
|
+
client_session_id = _ref.client_session_id;
|
4342
4332
|
return createElement(AppProvider, null, createElement(ChatBubbleBiBot, {
|
4343
|
-
clientId: clientId
|
4333
|
+
clientId: clientId,
|
4334
|
+
client_session_id: client_session_id,
|
4335
|
+
redirect_notice: false
|
4344
4336
|
}));
|
4345
4337
|
};
|
4346
4338
|
|