deep-chat-dev 9.0.104 → 9.0.105
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/custom-elements.json +6280 -6273
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +1 -0
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +724 -683
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/dist/webModel/webModel.d.ts.map +1 -1
- package/package.json +1 -2
package/dist/deepChat.js
CHANGED
@@ -3300,29 +3300,29 @@ function co(_x10, _x11) {
|
|
3300
3300
|
return _co.apply(this, arguments);
|
3301
3301
|
}
|
3302
3302
|
function _co() {
|
3303
|
-
_co = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3303
|
+
_co = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee103(s, e) {
|
3304
3304
|
var t, i;
|
3305
|
-
return _regeneratorRuntime().wrap(function
|
3306
|
-
while (1) switch (
|
3305
|
+
return _regeneratorRuntime().wrap(function _callee103$(_context103) {
|
3306
|
+
while (1) switch (_context103.prev = _context103.next) {
|
3307
3307
|
case 0:
|
3308
3308
|
t = s.getReader();
|
3309
3309
|
case 1:
|
3310
|
-
|
3310
|
+
_context103.next = 3;
|
3311
3311
|
return t.read();
|
3312
3312
|
case 3:
|
3313
|
-
if ((i =
|
3314
|
-
|
3313
|
+
if ((i = _context103.sent).done) {
|
3314
|
+
_context103.next = 7;
|
3315
3315
|
break;
|
3316
3316
|
}
|
3317
3317
|
e(i.value);
|
3318
3318
|
case 5:
|
3319
|
-
|
3319
|
+
_context103.next = 1;
|
3320
3320
|
break;
|
3321
3321
|
case 7:
|
3322
3322
|
case "end":
|
3323
|
-
return
|
3323
|
+
return _context103.stop();
|
3324
3324
|
}
|
3325
|
-
},
|
3325
|
+
}, _callee103);
|
3326
3326
|
}));
|
3327
3327
|
return _co.apply(this, arguments);
|
3328
3328
|
}
|
@@ -5212,7 +5212,7 @@ var En = {
|
|
5212
5212
|
var _this10 = this;
|
5213
5213
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
5214
5214
|
var i;
|
5215
|
-
window.webLLM ? this.configureInit(this.shouldAddInitialMessage(e.introMessage)) : t > M.MODULE_SEARCH_LIMIT_S ? ((i = this._messages) == null || i.addNewErrorMessage("service", M.WEB_LLM_NOT_FOUND_ERROR), console.error("The
|
5215
|
+
window.webLLM ? this.configureInit(this.shouldAddInitialMessage(e.introMessage)) : t > M.MODULE_SEARCH_LIMIT_S ? ((i = this._messages) == null || i.addNewErrorMessage("service", M.WEB_LLM_NOT_FOUND_ERROR), console.error("The deep-chat-web-llm module has not been attached to the window object. Please see the following guide:"), console.error("https://deepchat.dev/examples/externalModules")) : setTimeout(function () {
|
5216
5216
|
return _this10.findModelInWindow(e, t + 1);
|
5217
5217
|
}, 1e3);
|
5218
5218
|
}
|
@@ -5522,47 +5522,82 @@ var En = {
|
|
5522
5522
|
}()
|
5523
5523
|
}, {
|
5524
5524
|
key: "generateRespByType",
|
5525
|
-
value: function generateRespByType(e, t, i, n) {
|
5526
|
-
var r = t.body,
|
5527
|
-
o = t.error;
|
5528
|
-
if (o) E.displayError(e, new Error(t.error)), (i ? this.streamHandlers.onClose : this.completionsHandlers.onFinish)();else if (!r || !r.text) {
|
5529
|
-
var a = C.INVALID_MODEL_REQUEST({
|
5530
|
-
body: r
|
5531
|
-
}, !1);
|
5532
|
-
console.error(a);
|
5533
|
-
var l = i ? this.streamHandlers.onClose : this.completionsHandlers.onFinish;
|
5534
|
-
E.onInterceptorError(e, a, l);
|
5535
|
-
} else i ? this.streamResp(e, r.text, n) : this.immediateResp(e, r.text, n);
|
5536
|
-
}
|
5537
|
-
}, {
|
5538
|
-
key: "generateResp",
|
5539
5525
|
value: function () {
|
5540
|
-
var
|
5541
|
-
var
|
5526
|
+
var _generateRespByType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e, t, i, n) {
|
5527
|
+
var r;
|
5542
5528
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
5543
5529
|
while (1) switch (_context30.prev = _context30.next) {
|
5530
|
+
case 0:
|
5531
|
+
_context30.prev = 0;
|
5532
|
+
if (!i) {
|
5533
|
+
_context30.next = 6;
|
5534
|
+
break;
|
5535
|
+
}
|
5536
|
+
_context30.next = 4;
|
5537
|
+
return this.streamResp(e, t, n);
|
5538
|
+
case 4:
|
5539
|
+
_context30.next = 8;
|
5540
|
+
break;
|
5541
|
+
case 6:
|
5542
|
+
_context30.next = 8;
|
5543
|
+
return this.immediateResp(e, t, n);
|
5544
|
+
case 8:
|
5545
|
+
_context30.next = 13;
|
5546
|
+
break;
|
5547
|
+
case 10:
|
5548
|
+
_context30.prev = 10;
|
5549
|
+
_context30.t0 = _context30["catch"](0);
|
5550
|
+
(r = this._messages) == null || r.addNewErrorMessage("service"), console.log(_context30.t0);
|
5551
|
+
case 13:
|
5552
|
+
case "end":
|
5553
|
+
return _context30.stop();
|
5554
|
+
}
|
5555
|
+
}, _callee30, this, [[0, 10]]);
|
5556
|
+
}));
|
5557
|
+
function generateRespByType(_x58, _x59, _x60, _x61) {
|
5558
|
+
return _generateRespByType.apply(this, arguments);
|
5559
|
+
}
|
5560
|
+
return generateRespByType;
|
5561
|
+
}()
|
5562
|
+
}, {
|
5563
|
+
key: "generateResp",
|
5564
|
+
value: function () {
|
5565
|
+
var _generateResp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e, t, i) {
|
5566
|
+
var n, _yield$E$processReque5, r, o, a, l, c;
|
5567
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
5568
|
+
while (1) switch (_context31.prev = _context31.next) {
|
5544
5569
|
case 0:
|
5545
5570
|
n = t[t.length - 1].text;
|
5546
|
-
|
5571
|
+
_context31.next = 3;
|
5547
5572
|
return E.processRequestInterceptor(this.deepChat, {
|
5548
5573
|
body: {
|
5549
5574
|
text: n
|
5550
5575
|
}
|
5551
5576
|
});
|
5552
5577
|
case 3:
|
5553
|
-
|
5578
|
+
_yield$E$processReque5 = _context31.sent;
|
5579
|
+
r = _yield$E$processReque5.body;
|
5580
|
+
o = _yield$E$processReque5.error;
|
5581
|
+
a = !!this.deepChat.stream;
|
5554
5582
|
try {
|
5555
|
-
|
5556
|
-
|
5557
|
-
|
5583
|
+
if (o) E.displayError(e, new Error(o)), (a ? this.streamHandlers.onClose : this.completionsHandlers.onFinish)();else if (!r || !r.text) {
|
5584
|
+
l = C.INVALID_MODEL_REQUEST({
|
5585
|
+
body: r
|
5586
|
+
}, !1);
|
5587
|
+
console.error(l);
|
5588
|
+
c = a ? this.streamHandlers.onClose : this.completionsHandlers.onFinish;
|
5589
|
+
E.onInterceptorError(e, l, c);
|
5590
|
+
} else this.generateRespByType(e, r, !!this.deepChat.stream, i);
|
5591
|
+
} catch (l) {
|
5592
|
+
this.unloadChat(l);
|
5558
5593
|
}
|
5559
|
-
case
|
5594
|
+
case 8:
|
5560
5595
|
case "end":
|
5561
|
-
return
|
5596
|
+
return _context31.stop();
|
5562
5597
|
}
|
5563
|
-
},
|
5598
|
+
}, _callee31, this);
|
5564
5599
|
}));
|
5565
|
-
function generateResp(
|
5600
|
+
function generateResp(_x62, _x63, _x64) {
|
5566
5601
|
return _generateResp.apply(this, arguments);
|
5567
5602
|
}
|
5568
5603
|
return generateResp;
|
@@ -5570,35 +5605,35 @@ var En = {
|
|
5570
5605
|
}, {
|
5571
5606
|
key: "callServiceAPI",
|
5572
5607
|
value: function () {
|
5573
|
-
var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5608
|
+
var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e, t) {
|
5574
5609
|
var i, n;
|
5575
|
-
return _regeneratorRuntime().wrap(function
|
5576
|
-
while (1) switch (
|
5610
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
5611
|
+
while (1) switch (_context32.prev = _context32.next) {
|
5577
5612
|
case 0:
|
5578
5613
|
if (this._isModelLoaded) {
|
5579
|
-
|
5614
|
+
_context32.next = 7;
|
5580
5615
|
break;
|
5581
5616
|
}
|
5582
5617
|
if (!this._loadOnFirstMessage) {
|
5583
|
-
|
5618
|
+
_context32.next = 6;
|
5584
5619
|
break;
|
5585
5620
|
}
|
5586
|
-
|
5621
|
+
_context32.next = 4;
|
5587
5622
|
return this.init();
|
5588
5623
|
case 4:
|
5589
|
-
|
5624
|
+
_context32.next = 7;
|
5590
5625
|
break;
|
5591
5626
|
case 6:
|
5592
|
-
return
|
5627
|
+
return _context32.abrupt("return");
|
5593
5628
|
case 7:
|
5594
5629
|
!M.chat || this._isModelLoading || ((i = this._webModel.introMessage) != null && i.removeAfterMessage && ((n = this._removeIntro) == null || n.call(this)), e.addLoadingMessage(), this.generateResp(e, t, M.chat));
|
5595
5630
|
case 8:
|
5596
5631
|
case "end":
|
5597
|
-
return
|
5632
|
+
return _context32.stop();
|
5598
5633
|
}
|
5599
|
-
},
|
5634
|
+
}, _callee32, this);
|
5600
5635
|
}));
|
5601
|
-
function callServiceAPI(
|
5636
|
+
function callServiceAPI(_x65, _x66) {
|
5602
5637
|
return _callServiceAPI2.apply(this, arguments);
|
5603
5638
|
}
|
5604
5639
|
return callServiceAPI;
|
@@ -5626,45 +5661,45 @@ var En = {
|
|
5626
5661
|
}, {
|
5627
5662
|
key: "processResponse",
|
5628
5663
|
value: function () {
|
5629
|
-
var _processResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5664
|
+
var _processResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e, t, i) {
|
5630
5665
|
var r, n, o;
|
5631
|
-
return _regeneratorRuntime().wrap(function
|
5632
|
-
while (1) switch (
|
5666
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
5667
|
+
while (1) switch (_context33.prev = _context33.next) {
|
5633
5668
|
case 0:
|
5634
|
-
|
5669
|
+
_context33.next = 2;
|
5635
5670
|
return (r = e.responseInterceptor) == null ? void 0 : r.call(e, i);
|
5636
5671
|
case 2:
|
5637
|
-
|
5638
|
-
if (
|
5639
|
-
|
5672
|
+
_context33.t0 = _context33.sent;
|
5673
|
+
if (_context33.t0) {
|
5674
|
+
_context33.next = 5;
|
5640
5675
|
break;
|
5641
5676
|
}
|
5642
|
-
|
5677
|
+
_context33.t0 = i;
|
5643
5678
|
case 5:
|
5644
|
-
n =
|
5679
|
+
n = _context33.t0;
|
5645
5680
|
if (!n.error) {
|
5646
|
-
|
5681
|
+
_context33.next = 11;
|
5647
5682
|
break;
|
5648
5683
|
}
|
5649
5684
|
E.displayError(t, new Error(n.error));
|
5650
|
-
return
|
5685
|
+
return _context33.abrupt("return");
|
5651
5686
|
case 11:
|
5652
5687
|
if (!(!n || !n.text)) {
|
5653
|
-
|
5688
|
+
_context33.next = 15;
|
5654
5689
|
break;
|
5655
5690
|
}
|
5656
5691
|
o = C.INVALID_MODEL_RESPONSE(i, !!e.responseInterceptor, n);
|
5657
5692
|
E.displayError(t, new Error(o));
|
5658
|
-
return
|
5693
|
+
return _context33.abrupt("return");
|
5659
5694
|
case 15:
|
5660
|
-
return
|
5695
|
+
return _context33.abrupt("return", n);
|
5661
5696
|
case 16:
|
5662
5697
|
case "end":
|
5663
|
-
return
|
5698
|
+
return _context33.stop();
|
5664
5699
|
}
|
5665
|
-
},
|
5700
|
+
}, _callee33);
|
5666
5701
|
}));
|
5667
|
-
function processResponse(
|
5702
|
+
function processResponse(_x67, _x68, _x69) {
|
5668
5703
|
return _processResponse.apply(this, arguments);
|
5669
5704
|
}
|
5670
5705
|
return processResponse;
|
@@ -5688,7 +5723,7 @@ var En = {
|
|
5688
5723
|
}]);
|
5689
5724
|
return M;
|
5690
5725
|
}(Le);
|
5691
|
-
et.GENERIC_ERROR = "Error, please check the
|
5726
|
+
et.GENERIC_ERROR = "Error, please check the [troubleshooting](https://deepchat.dev/docs/webModel#troubleshooting) section of documentation for help.";
|
5692
5727
|
et.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models";
|
5693
5728
|
et.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found";
|
5694
5729
|
et.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1";
|
@@ -5750,13 +5785,13 @@ var os = /*#__PURE__*/function (_q) {
|
|
5750
5785
|
}, {
|
5751
5786
|
key: "callServiceAPI",
|
5752
5787
|
value: function () {
|
5753
|
-
var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5788
|
+
var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e, t, i) {
|
5754
5789
|
var n;
|
5755
|
-
return _regeneratorRuntime().wrap(function
|
5756
|
-
while (1) switch (
|
5790
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
5791
|
+
while (1) switch (_context34.prev = _context34.next) {
|
5757
5792
|
case 0:
|
5758
5793
|
if (this.requestSettings) {
|
5759
|
-
|
5794
|
+
_context34.next = 2;
|
5760
5795
|
break;
|
5761
5796
|
}
|
5762
5797
|
throw new Error("Request settings have not been set up");
|
@@ -5765,11 +5800,11 @@ var os = /*#__PURE__*/function (_q) {
|
|
5765
5800
|
w.request(this, n, e);
|
5766
5801
|
case 4:
|
5767
5802
|
case "end":
|
5768
|
-
return
|
5803
|
+
return _context34.stop();
|
5769
5804
|
}
|
5770
|
-
},
|
5805
|
+
}, _callee34, this);
|
5771
5806
|
}));
|
5772
|
-
function callServiceAPI(
|
5807
|
+
function callServiceAPI(_x70, _x71, _x72) {
|
5773
5808
|
return _callServiceAPI3.apply(this, arguments);
|
5774
5809
|
}
|
5775
5810
|
return callServiceAPI;
|
@@ -5798,18 +5833,18 @@ var xt = /*#__PURE__*/function (_Pe) {
|
|
5798
5833
|
}, {
|
5799
5834
|
key: "callServiceAPI",
|
5800
5835
|
value: function () {
|
5801
|
-
var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5802
|
-
return _regeneratorRuntime().wrap(function
|
5803
|
-
while (1) switch (
|
5836
|
+
var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e, t, i) {
|
5837
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
5838
|
+
while (1) switch (_context35.prev = _context35.next) {
|
5804
5839
|
case 0:
|
5805
5840
|
if (this.requestSettings) {
|
5806
|
-
|
5841
|
+
_context35.next = 2;
|
5807
5842
|
break;
|
5808
5843
|
}
|
5809
5844
|
throw new Error("Request settings have not been set up");
|
5810
5845
|
case 2:
|
5811
5846
|
if (i != null && i[0]) {
|
5812
|
-
|
5847
|
+
_context35.next = 4;
|
5813
5848
|
break;
|
5814
5849
|
}
|
5815
5850
|
throw new Error("No file was added");
|
@@ -5817,11 +5852,11 @@ var xt = /*#__PURE__*/function (_Pe) {
|
|
5817
5852
|
w.poll(this, i[0], e, !1);
|
5818
5853
|
case 5:
|
5819
5854
|
case "end":
|
5820
|
-
return
|
5855
|
+
return _context35.stop();
|
5821
5856
|
}
|
5822
|
-
},
|
5857
|
+
}, _callee35, this);
|
5823
5858
|
}));
|
5824
|
-
function callServiceAPI(
|
5859
|
+
function callServiceAPI(_x73, _x74, _x75) {
|
5825
5860
|
return _callServiceAPI4.apply(this, arguments);
|
5826
5861
|
}
|
5827
5862
|
return callServiceAPI;
|
@@ -5850,35 +5885,35 @@ var _o = /*#__PURE__*/function (_xt) {
|
|
5850
5885
|
_createClass(_o, [{
|
5851
5886
|
key: "extractPollResultData",
|
5852
5887
|
value: function () {
|
5853
|
-
var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5888
|
+
var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e) {
|
5854
5889
|
var t;
|
5855
|
-
return _regeneratorRuntime().wrap(function
|
5856
|
-
while (1) switch (
|
5890
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
5891
|
+
while (1) switch (_context36.prev = _context36.next) {
|
5857
5892
|
case 0:
|
5858
5893
|
if (!e.estimated_time) {
|
5859
|
-
|
5894
|
+
_context36.next = 2;
|
5860
5895
|
break;
|
5861
5896
|
}
|
5862
|
-
return
|
5897
|
+
return _context36.abrupt("return", {
|
5863
5898
|
timeoutMS: (e.estimated_time + 1) * 1e3
|
5864
5899
|
});
|
5865
5900
|
case 2:
|
5866
5901
|
if (!e.error) {
|
5867
|
-
|
5902
|
+
_context36.next = 4;
|
5868
5903
|
break;
|
5869
5904
|
}
|
5870
5905
|
throw e.error;
|
5871
5906
|
case 4:
|
5872
|
-
return
|
5907
|
+
return _context36.abrupt("return", {
|
5873
5908
|
text: ((t = e[0]) == null ? void 0 : t.label) || ""
|
5874
5909
|
});
|
5875
5910
|
case 5:
|
5876
5911
|
case "end":
|
5877
|
-
return
|
5912
|
+
return _context36.stop();
|
5878
5913
|
}
|
5879
|
-
},
|
5914
|
+
}, _callee36);
|
5880
5915
|
}));
|
5881
|
-
function extractPollResultData(
|
5916
|
+
function extractPollResultData(_x76) {
|
5882
5917
|
return _extractPollResultData.apply(this, arguments);
|
5883
5918
|
}
|
5884
5919
|
return extractPollResultData;
|
@@ -5901,35 +5936,35 @@ var So = /*#__PURE__*/function (_xt2) {
|
|
5901
5936
|
_createClass(So, [{
|
5902
5937
|
key: "extractPollResultData",
|
5903
5938
|
value: function () {
|
5904
|
-
var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5939
|
+
var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
|
5905
5940
|
var t;
|
5906
|
-
return _regeneratorRuntime().wrap(function
|
5907
|
-
while (1) switch (
|
5941
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
5942
|
+
while (1) switch (_context37.prev = _context37.next) {
|
5908
5943
|
case 0:
|
5909
5944
|
if (!e.estimated_time) {
|
5910
|
-
|
5945
|
+
_context37.next = 2;
|
5911
5946
|
break;
|
5912
5947
|
}
|
5913
|
-
return
|
5948
|
+
return _context37.abrupt("return", {
|
5914
5949
|
timeoutMS: (e.estimated_time + 1) * 1e3
|
5915
5950
|
});
|
5916
5951
|
case 2:
|
5917
5952
|
if (!e.error) {
|
5918
|
-
|
5953
|
+
_context37.next = 4;
|
5919
5954
|
break;
|
5920
5955
|
}
|
5921
5956
|
throw e.error;
|
5922
5957
|
case 4:
|
5923
|
-
return
|
5958
|
+
return _context37.abrupt("return", {
|
5924
5959
|
text: ((t = e[0]) == null ? void 0 : t.label) || ""
|
5925
5960
|
});
|
5926
5961
|
case 5:
|
5927
5962
|
case "end":
|
5928
|
-
return
|
5963
|
+
return _context37.stop();
|
5929
5964
|
}
|
5930
|
-
},
|
5965
|
+
}, _callee37);
|
5931
5966
|
}));
|
5932
|
-
function extractPollResultData(
|
5967
|
+
function extractPollResultData(_x77) {
|
5933
5968
|
return _extractPollResultData2.apply(this, arguments);
|
5934
5969
|
}
|
5935
5970
|
return extractPollResultData;
|
@@ -6014,19 +6049,19 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6014
6049
|
}, {
|
6015
6050
|
key: "callServiceAPI",
|
6016
6051
|
value: function () {
|
6017
|
-
var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6052
|
+
var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e, t, i) {
|
6018
6053
|
var n;
|
6019
|
-
return _regeneratorRuntime().wrap(function
|
6020
|
-
while (1) switch (
|
6054
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
6055
|
+
while (1) switch (_context38.prev = _context38.next) {
|
6021
6056
|
case 0:
|
6022
6057
|
if (this.requestSettings) {
|
6023
|
-
|
6058
|
+
_context38.next = 2;
|
6024
6059
|
break;
|
6025
6060
|
}
|
6026
6061
|
throw new Error("Request settings have not been set up");
|
6027
6062
|
case 2:
|
6028
6063
|
if (i) {
|
6029
|
-
|
6064
|
+
_context38.next = 4;
|
6030
6065
|
break;
|
6031
6066
|
}
|
6032
6067
|
throw new Error("Image was not found");
|
@@ -6035,11 +6070,11 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6035
6070
|
E.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, n, e), !1);
|
6036
6071
|
case 6:
|
6037
6072
|
case "end":
|
6038
|
-
return
|
6073
|
+
return _context38.stop();
|
6039
6074
|
}
|
6040
|
-
},
|
6075
|
+
}, _callee38, this);
|
6041
6076
|
}));
|
6042
|
-
function callServiceAPI(
|
6077
|
+
function callServiceAPI(_x78, _x79, _x80) {
|
6043
6078
|
return _callServiceAPI5.apply(this, arguments);
|
6044
6079
|
}
|
6045
6080
|
return callServiceAPI;
|
@@ -6047,17 +6082,17 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6047
6082
|
}, {
|
6048
6083
|
key: "extractResultData",
|
6049
6084
|
value: function () {
|
6050
|
-
var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6051
|
-
return _regeneratorRuntime().wrap(function
|
6052
|
-
while (1) switch (
|
6085
|
+
var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(e) {
|
6086
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
6087
|
+
while (1) switch (_context39.prev = _context39.next) {
|
6053
6088
|
case 0:
|
6054
6089
|
if (!e.message) {
|
6055
|
-
|
6090
|
+
_context39.next = 2;
|
6056
6091
|
break;
|
6057
6092
|
}
|
6058
6093
|
throw e.message;
|
6059
6094
|
case 2:
|
6060
|
-
return
|
6095
|
+
return _context39.abrupt("return", {
|
6061
6096
|
files: e.artifacts.map(function (i) {
|
6062
6097
|
return {
|
6063
6098
|
src: "".concat(Et).concat(i.base64),
|
@@ -6067,11 +6102,11 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6067
6102
|
});
|
6068
6103
|
case 3:
|
6069
6104
|
case "end":
|
6070
|
-
return
|
6105
|
+
return _context39.stop();
|
6071
6106
|
}
|
6072
|
-
},
|
6107
|
+
}, _callee39);
|
6073
6108
|
}));
|
6074
|
-
function extractResultData(
|
6109
|
+
function extractResultData(_x81) {
|
6075
6110
|
return _extractResultData2.apply(this, arguments);
|
6076
6111
|
}
|
6077
6112
|
return extractResultData;
|
@@ -6123,19 +6158,19 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6123
6158
|
}, {
|
6124
6159
|
key: "callServiceAPI",
|
6125
6160
|
value: function () {
|
6126
|
-
var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6161
|
+
var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(e, t, i) {
|
6127
6162
|
var o, a, n, r;
|
6128
|
-
return _regeneratorRuntime().wrap(function
|
6129
|
-
while (1) switch (
|
6163
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
6164
|
+
while (1) switch (_context40.prev = _context40.next) {
|
6130
6165
|
case 0:
|
6131
6166
|
if (this.requestSettings) {
|
6132
|
-
|
6167
|
+
_context40.next = 2;
|
6133
6168
|
break;
|
6134
6169
|
}
|
6135
6170
|
throw new Error("Request settings have not been set up");
|
6136
6171
|
case 2:
|
6137
6172
|
if (!(!i || !i[0] || !i[1])) {
|
6138
|
-
|
6173
|
+
_context40.next = 4;
|
6139
6174
|
break;
|
6140
6175
|
}
|
6141
6176
|
throw new Error("Image was not found");
|
@@ -6144,11 +6179,11 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6144
6179
|
E.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, r, e), !1);
|
6145
6180
|
case 6:
|
6146
6181
|
case "end":
|
6147
|
-
return
|
6182
|
+
return _context40.stop();
|
6148
6183
|
}
|
6149
|
-
},
|
6184
|
+
}, _callee40, this);
|
6150
6185
|
}));
|
6151
|
-
function callServiceAPI(
|
6186
|
+
function callServiceAPI(_x82, _x83, _x84) {
|
6152
6187
|
return _callServiceAPI6.apply(this, arguments);
|
6153
6188
|
}
|
6154
6189
|
return callServiceAPI;
|
@@ -6156,17 +6191,17 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6156
6191
|
}, {
|
6157
6192
|
key: "extractResultData",
|
6158
6193
|
value: function () {
|
6159
|
-
var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6160
|
-
return _regeneratorRuntime().wrap(function
|
6161
|
-
while (1) switch (
|
6194
|
+
var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(e) {
|
6195
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
6196
|
+
while (1) switch (_context41.prev = _context41.next) {
|
6162
6197
|
case 0:
|
6163
6198
|
if (!e.message) {
|
6164
|
-
|
6199
|
+
_context41.next = 2;
|
6165
6200
|
break;
|
6166
6201
|
}
|
6167
6202
|
throw e.message;
|
6168
6203
|
case 2:
|
6169
|
-
return
|
6204
|
+
return _context41.abrupt("return", {
|
6170
6205
|
files: e.artifacts.map(function (i) {
|
6171
6206
|
return {
|
6172
6207
|
src: "".concat(Et).concat(i.base64),
|
@@ -6176,11 +6211,11 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6176
6211
|
});
|
6177
6212
|
case 3:
|
6178
6213
|
case "end":
|
6179
|
-
return
|
6214
|
+
return _context41.stop();
|
6180
6215
|
}
|
6181
|
-
},
|
6216
|
+
}, _callee41);
|
6182
6217
|
}));
|
6183
|
-
function extractResultData(
|
6218
|
+
function extractResultData(_x85) {
|
6184
6219
|
return _extractResultData3.apply(this, arguments);
|
6185
6220
|
}
|
6186
6221
|
return extractResultData;
|
@@ -6213,34 +6248,34 @@ var wo = /*#__PURE__*/function (_xt3) {
|
|
6213
6248
|
_createClass(wo, [{
|
6214
6249
|
key: "extractPollResultData",
|
6215
6250
|
value: function () {
|
6216
|
-
var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6217
|
-
return _regeneratorRuntime().wrap(function
|
6218
|
-
while (1) switch (
|
6251
|
+
var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e) {
|
6252
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
6253
|
+
while (1) switch (_context42.prev = _context42.next) {
|
6219
6254
|
case 0:
|
6220
6255
|
if (!e.estimated_time) {
|
6221
|
-
|
6256
|
+
_context42.next = 2;
|
6222
6257
|
break;
|
6223
6258
|
}
|
6224
|
-
return
|
6259
|
+
return _context42.abrupt("return", {
|
6225
6260
|
timeoutMS: (e.estimated_time + 1) * 1e3
|
6226
6261
|
});
|
6227
6262
|
case 2:
|
6228
6263
|
if (!e.error) {
|
6229
|
-
|
6264
|
+
_context42.next = 4;
|
6230
6265
|
break;
|
6231
6266
|
}
|
6232
6267
|
throw e.error;
|
6233
6268
|
case 4:
|
6234
|
-
return
|
6269
|
+
return _context42.abrupt("return", {
|
6235
6270
|
text: e.text || ""
|
6236
6271
|
});
|
6237
6272
|
case 5:
|
6238
6273
|
case "end":
|
6239
|
-
return
|
6274
|
+
return _context42.stop();
|
6240
6275
|
}
|
6241
|
-
},
|
6276
|
+
}, _callee42);
|
6242
6277
|
}));
|
6243
|
-
function extractPollResultData(
|
6278
|
+
function extractPollResultData(_x86) {
|
6244
6279
|
return _extractPollResultData3.apply(this, arguments);
|
6245
6280
|
}
|
6246
6281
|
return extractPollResultData;
|
@@ -6261,26 +6296,26 @@ var Mo = /*#__PURE__*/function (_Pe2) {
|
|
6261
6296
|
_createClass(Mo, [{
|
6262
6297
|
key: "extractResultData",
|
6263
6298
|
value: function () {
|
6264
|
-
var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6265
|
-
return _regeneratorRuntime().wrap(function
|
6266
|
-
while (1) switch (
|
6299
|
+
var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(e) {
|
6300
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
6301
|
+
while (1) switch (_context43.prev = _context43.next) {
|
6267
6302
|
case 0:
|
6268
6303
|
if (!e.error) {
|
6269
|
-
|
6304
|
+
_context43.next = 2;
|
6270
6305
|
break;
|
6271
6306
|
}
|
6272
6307
|
throw e.error;
|
6273
6308
|
case 2:
|
6274
|
-
return
|
6309
|
+
return _context43.abrupt("return", {
|
6275
6310
|
text: e[0].generated_text || ""
|
6276
6311
|
});
|
6277
6312
|
case 3:
|
6278
6313
|
case "end":
|
6279
|
-
return
|
6314
|
+
return _context43.stop();
|
6280
6315
|
}
|
6281
|
-
},
|
6316
|
+
}, _callee43);
|
6282
6317
|
}));
|
6283
|
-
function extractResultData(
|
6318
|
+
function extractResultData(_x87) {
|
6284
6319
|
return _extractResultData4.apply(this, arguments);
|
6285
6320
|
}
|
6286
6321
|
return extractResultData;
|
@@ -6317,26 +6352,26 @@ var To = /*#__PURE__*/function (_Pe3) {
|
|
6317
6352
|
}, {
|
6318
6353
|
key: "extractResultData",
|
6319
6354
|
value: function () {
|
6320
|
-
var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6321
|
-
return _regeneratorRuntime().wrap(function
|
6322
|
-
while (1) switch (
|
6355
|
+
var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(e) {
|
6356
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context44) {
|
6357
|
+
while (1) switch (_context44.prev = _context44.next) {
|
6323
6358
|
case 0:
|
6324
6359
|
if (!e.error) {
|
6325
|
-
|
6360
|
+
_context44.next = 2;
|
6326
6361
|
break;
|
6327
6362
|
}
|
6328
6363
|
throw e.error;
|
6329
6364
|
case 2:
|
6330
|
-
return
|
6365
|
+
return _context44.abrupt("return", {
|
6331
6366
|
text: e.answer || ""
|
6332
6367
|
});
|
6333
6368
|
case 3:
|
6334
6369
|
case "end":
|
6335
|
-
return
|
6370
|
+
return _context44.stop();
|
6336
6371
|
}
|
6337
|
-
},
|
6372
|
+
}, _callee44);
|
6338
6373
|
}));
|
6339
|
-
function extractResultData(
|
6374
|
+
function extractResultData(_x88) {
|
6340
6375
|
return _extractResultData5.apply(this, arguments);
|
6341
6376
|
}
|
6342
6377
|
return extractResultData;
|
@@ -6357,26 +6392,26 @@ var Co = /*#__PURE__*/function (_Pe4) {
|
|
6357
6392
|
_createClass(Co, [{
|
6358
6393
|
key: "extractResultData",
|
6359
6394
|
value: function () {
|
6360
|
-
var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6361
|
-
return _regeneratorRuntime().wrap(function
|
6362
|
-
while (1) switch (
|
6395
|
+
var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(e) {
|
6396
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
6397
|
+
while (1) switch (_context45.prev = _context45.next) {
|
6363
6398
|
case 0:
|
6364
6399
|
if (!e.error) {
|
6365
|
-
|
6400
|
+
_context45.next = 2;
|
6366
6401
|
break;
|
6367
6402
|
}
|
6368
6403
|
throw e.error;
|
6369
6404
|
case 2:
|
6370
|
-
return
|
6405
|
+
return _context45.abrupt("return", {
|
6371
6406
|
text: e[0].summary_text || ""
|
6372
6407
|
});
|
6373
6408
|
case 3:
|
6374
6409
|
case "end":
|
6375
|
-
return
|
6410
|
+
return _context45.stop();
|
6376
6411
|
}
|
6377
|
-
},
|
6412
|
+
}, _callee45);
|
6378
6413
|
}));
|
6379
|
-
function extractResultData(
|
6414
|
+
function extractResultData(_x89) {
|
6380
6415
|
return _extractResultData6.apply(this, arguments);
|
6381
6416
|
}
|
6382
6417
|
return extractResultData;
|
@@ -6441,26 +6476,26 @@ var Ao = /*#__PURE__*/function (_Pe5) {
|
|
6441
6476
|
}, {
|
6442
6477
|
key: "extractResultData",
|
6443
6478
|
value: function () {
|
6444
|
-
var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6445
|
-
return _regeneratorRuntime().wrap(function
|
6446
|
-
while (1) switch (
|
6479
|
+
var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e) {
|
6480
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context46) {
|
6481
|
+
while (1) switch (_context46.prev = _context46.next) {
|
6447
6482
|
case 0:
|
6448
6483
|
if (!e.error) {
|
6449
|
-
|
6484
|
+
_context46.next = 2;
|
6450
6485
|
break;
|
6451
6486
|
}
|
6452
6487
|
throw e.error;
|
6453
6488
|
case 2:
|
6454
|
-
return
|
6489
|
+
return _context46.abrupt("return", {
|
6455
6490
|
text: e.generated_text || ""
|
6456
6491
|
});
|
6457
6492
|
case 3:
|
6458
6493
|
case "end":
|
6459
|
-
return
|
6494
|
+
return _context46.stop();
|
6460
6495
|
}
|
6461
|
-
},
|
6496
|
+
}, _callee46);
|
6462
6497
|
}));
|
6463
|
-
function extractResultData(
|
6498
|
+
function extractResultData(_x90) {
|
6464
6499
|
return _extractResultData7.apply(this, arguments);
|
6465
6500
|
}
|
6466
6501
|
return extractResultData;
|
@@ -6502,19 +6537,19 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6502
6537
|
}, {
|
6503
6538
|
key: "callServiceAPI",
|
6504
6539
|
value: function () {
|
6505
|
-
var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6540
|
+
var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e, t, i) {
|
6506
6541
|
var o, a, n, r;
|
6507
|
-
return _regeneratorRuntime().wrap(function
|
6508
|
-
while (1) switch (
|
6542
|
+
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
6543
|
+
while (1) switch (_context47.prev = _context47.next) {
|
6509
6544
|
case 0:
|
6510
6545
|
if (this.requestSettings) {
|
6511
|
-
|
6546
|
+
_context47.next = 2;
|
6512
6547
|
break;
|
6513
6548
|
}
|
6514
6549
|
throw new Error("Request settings have not been set up");
|
6515
6550
|
case 2:
|
6516
6551
|
if (i) {
|
6517
|
-
|
6552
|
+
_context47.next = 4;
|
6518
6553
|
break;
|
6519
6554
|
}
|
6520
6555
|
throw new Error("Image was not found");
|
@@ -6523,11 +6558,11 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6523
6558
|
E.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, r, e), !1);
|
6524
6559
|
case 6:
|
6525
6560
|
case "end":
|
6526
|
-
return
|
6561
|
+
return _context47.stop();
|
6527
6562
|
}
|
6528
|
-
},
|
6563
|
+
}, _callee47, this);
|
6529
6564
|
}));
|
6530
|
-
function callServiceAPI(
|
6565
|
+
function callServiceAPI(_x91, _x92, _x93) {
|
6531
6566
|
return _callServiceAPI7.apply(this, arguments);
|
6532
6567
|
}
|
6533
6568
|
return callServiceAPI;
|
@@ -6535,17 +6570,17 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6535
6570
|
}, {
|
6536
6571
|
key: "extractResultData",
|
6537
6572
|
value: function () {
|
6538
|
-
var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6539
|
-
return _regeneratorRuntime().wrap(function
|
6540
|
-
while (1) switch (
|
6573
|
+
var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e) {
|
6574
|
+
return _regeneratorRuntime().wrap(function _callee48$(_context48) {
|
6575
|
+
while (1) switch (_context48.prev = _context48.next) {
|
6541
6576
|
case 0:
|
6542
6577
|
if (!e.message) {
|
6543
|
-
|
6578
|
+
_context48.next = 2;
|
6544
6579
|
break;
|
6545
6580
|
}
|
6546
6581
|
throw e.message;
|
6547
6582
|
case 2:
|
6548
|
-
return
|
6583
|
+
return _context48.abrupt("return", {
|
6549
6584
|
files: e.artifacts.map(function (i) {
|
6550
6585
|
return {
|
6551
6586
|
src: "".concat(Et).concat(i.base64),
|
@@ -6555,11 +6590,11 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6555
6590
|
});
|
6556
6591
|
case 3:
|
6557
6592
|
case "end":
|
6558
|
-
return
|
6593
|
+
return _context48.stop();
|
6559
6594
|
}
|
6560
|
-
},
|
6595
|
+
}, _callee48);
|
6561
6596
|
}));
|
6562
|
-
function extractResultData(
|
6597
|
+
function extractResultData(_x94) {
|
6563
6598
|
return _extractResultData8.apply(this, arguments);
|
6564
6599
|
}
|
6565
6600
|
return extractResultData;
|
@@ -6590,26 +6625,26 @@ var ko = /*#__PURE__*/function (_Pe6) {
|
|
6590
6625
|
_createClass(ko, [{
|
6591
6626
|
key: "extractResultData",
|
6592
6627
|
value: function () {
|
6593
|
-
var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6594
|
-
return _regeneratorRuntime().wrap(function
|
6595
|
-
while (1) switch (
|
6628
|
+
var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e) {
|
6629
|
+
return _regeneratorRuntime().wrap(function _callee49$(_context49) {
|
6630
|
+
while (1) switch (_context49.prev = _context49.next) {
|
6596
6631
|
case 0:
|
6597
6632
|
if (!e.error) {
|
6598
|
-
|
6633
|
+
_context49.next = 2;
|
6599
6634
|
break;
|
6600
6635
|
}
|
6601
6636
|
throw e.error;
|
6602
6637
|
case 2:
|
6603
|
-
return
|
6638
|
+
return _context49.abrupt("return", {
|
6604
6639
|
text: e[0].translation_text || ""
|
6605
6640
|
});
|
6606
6641
|
case 3:
|
6607
6642
|
case "end":
|
6608
|
-
return
|
6643
|
+
return _context49.stop();
|
6609
6644
|
}
|
6610
|
-
},
|
6645
|
+
}, _callee49);
|
6611
6646
|
}));
|
6612
|
-
function extractResultData(
|
6647
|
+
function extractResultData(_x95) {
|
6613
6648
|
return _extractResultData9.apply(this, arguments);
|
6614
6649
|
}
|
6615
6650
|
return extractResultData;
|
@@ -6643,13 +6678,13 @@ var Ht = /*#__PURE__*/function (_ni4) {
|
|
6643
6678
|
}, {
|
6644
6679
|
key: "callServiceAPI",
|
6645
6680
|
value: function () {
|
6646
|
-
var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6681
|
+
var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(e, t) {
|
6647
6682
|
var i;
|
6648
|
-
return _regeneratorRuntime().wrap(function
|
6649
|
-
while (1) switch (
|
6683
|
+
return _regeneratorRuntime().wrap(function _callee50$(_context50) {
|
6684
|
+
while (1) switch (_context50.prev = _context50.next) {
|
6650
6685
|
case 0:
|
6651
6686
|
if (this.requestSettings) {
|
6652
|
-
|
6687
|
+
_context50.next = 2;
|
6653
6688
|
break;
|
6654
6689
|
}
|
6655
6690
|
throw new Error("Request settings have not been set up");
|
@@ -6658,11 +6693,11 @@ var Ht = /*#__PURE__*/function (_ni4) {
|
|
6658
6693
|
w.request(this, i, e);
|
6659
6694
|
case 4:
|
6660
6695
|
case "end":
|
6661
|
-
return
|
6696
|
+
return _context50.stop();
|
6662
6697
|
}
|
6663
|
-
},
|
6698
|
+
}, _callee50, this);
|
6664
6699
|
}));
|
6665
|
-
function callServiceAPI(
|
6700
|
+
function callServiceAPI(_x96, _x97) {
|
6666
6701
|
return _callServiceAPI8.apply(this, arguments);
|
6667
6702
|
}
|
6668
6703
|
return callServiceAPI;
|
@@ -6670,17 +6705,17 @@ var Ht = /*#__PURE__*/function (_ni4) {
|
|
6670
6705
|
}, {
|
6671
6706
|
key: "extractResultData",
|
6672
6707
|
value: function () {
|
6673
|
-
var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6674
|
-
return _regeneratorRuntime().wrap(function
|
6675
|
-
while (1) switch (
|
6708
|
+
var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(e) {
|
6709
|
+
return _regeneratorRuntime().wrap(function _callee51$(_context51) {
|
6710
|
+
while (1) switch (_context51.prev = _context51.next) {
|
6676
6711
|
case 0:
|
6677
6712
|
if (!e.message) {
|
6678
|
-
|
6713
|
+
_context51.next = 2;
|
6679
6714
|
break;
|
6680
6715
|
}
|
6681
6716
|
throw e.message;
|
6682
6717
|
case 2:
|
6683
|
-
return
|
6718
|
+
return _context51.abrupt("return", {
|
6684
6719
|
files: e.artifacts.map(function (i) {
|
6685
6720
|
return {
|
6686
6721
|
src: "".concat(Et).concat(i.base64),
|
@@ -6690,11 +6725,11 @@ var Ht = /*#__PURE__*/function (_ni4) {
|
|
6690
6725
|
});
|
6691
6726
|
case 3:
|
6692
6727
|
case "end":
|
6693
|
-
return
|
6728
|
+
return _context51.stop();
|
6694
6729
|
}
|
6695
|
-
},
|
6730
|
+
}, _callee51);
|
6696
6731
|
}));
|
6697
|
-
function extractResultData(
|
6732
|
+
function extractResultData(_x98) {
|
6698
6733
|
return _extractResultData10.apply(this, arguments);
|
6699
6734
|
}
|
6700
6735
|
return extractResultData;
|
@@ -6727,26 +6762,26 @@ var Io = /*#__PURE__*/function (_Pe7) {
|
|
6727
6762
|
_createClass(Io, [{
|
6728
6763
|
key: "extractResultData",
|
6729
6764
|
value: function () {
|
6730
|
-
var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6731
|
-
return _regeneratorRuntime().wrap(function
|
6732
|
-
while (1) switch (
|
6765
|
+
var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e) {
|
6766
|
+
return _regeneratorRuntime().wrap(function _callee52$(_context52) {
|
6767
|
+
while (1) switch (_context52.prev = _context52.next) {
|
6733
6768
|
case 0:
|
6734
6769
|
if (!e.error) {
|
6735
|
-
|
6770
|
+
_context52.next = 2;
|
6736
6771
|
break;
|
6737
6772
|
}
|
6738
6773
|
throw e.error;
|
6739
6774
|
case 2:
|
6740
|
-
return
|
6775
|
+
return _context52.abrupt("return", {
|
6741
6776
|
text: e[0].sequence || ""
|
6742
6777
|
});
|
6743
6778
|
case 3:
|
6744
6779
|
case "end":
|
6745
|
-
return
|
6780
|
+
return _context52.stop();
|
6746
6781
|
}
|
6747
|
-
},
|
6782
|
+
}, _callee52);
|
6748
6783
|
}));
|
6749
|
-
function extractResultData(
|
6784
|
+
function extractResultData(_x99) {
|
6750
6785
|
return _extractResultData11.apply(this, arguments);
|
6751
6786
|
}
|
6752
6787
|
return extractResultData;
|
@@ -6822,13 +6857,13 @@ var Lo = /*#__PURE__*/function (_Yi) {
|
|
6822
6857
|
}, {
|
6823
6858
|
key: "callServiceAPI",
|
6824
6859
|
value: function () {
|
6825
|
-
var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6860
|
+
var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e, t) {
|
6826
6861
|
var i;
|
6827
|
-
return _regeneratorRuntime().wrap(function
|
6828
|
-
while (1) switch (
|
6862
|
+
return _regeneratorRuntime().wrap(function _callee53$(_context53) {
|
6863
|
+
while (1) switch (_context53.prev = _context53.next) {
|
6829
6864
|
case 0:
|
6830
6865
|
if (this.requestSettings) {
|
6831
|
-
|
6866
|
+
_context53.next = 2;
|
6832
6867
|
break;
|
6833
6868
|
}
|
6834
6869
|
throw new Error("Request settings have not been set up");
|
@@ -6837,11 +6872,11 @@ var Lo = /*#__PURE__*/function (_Yi) {
|
|
6837
6872
|
w.request(this, i, e);
|
6838
6873
|
case 4:
|
6839
6874
|
case "end":
|
6840
|
-
return
|
6875
|
+
return _context53.stop();
|
6841
6876
|
}
|
6842
|
-
},
|
6877
|
+
}, _callee53, this);
|
6843
6878
|
}));
|
6844
|
-
function callServiceAPI(
|
6879
|
+
function callServiceAPI(_x100, _x101) {
|
6845
6880
|
return _callServiceAPI9.apply(this, arguments);
|
6846
6881
|
}
|
6847
6882
|
return callServiceAPI;
|
@@ -6849,27 +6884,27 @@ var Lo = /*#__PURE__*/function (_Yi) {
|
|
6849
6884
|
}, {
|
6850
6885
|
key: "extractResultData",
|
6851
6886
|
value: function () {
|
6852
|
-
var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6887
|
+
var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e) {
|
6853
6888
|
var t;
|
6854
|
-
return _regeneratorRuntime().wrap(function
|
6855
|
-
while (1) switch (
|
6889
|
+
return _regeneratorRuntime().wrap(function _callee54$(_context54) {
|
6890
|
+
while (1) switch (_context54.prev = _context54.next) {
|
6856
6891
|
case 0:
|
6857
6892
|
if (!e.message) {
|
6858
|
-
|
6893
|
+
_context54.next = 2;
|
6859
6894
|
break;
|
6860
6895
|
}
|
6861
6896
|
throw e.message;
|
6862
6897
|
case 2:
|
6863
|
-
return
|
6898
|
+
return _context54.abrupt("return", {
|
6864
6899
|
text: ((t = e.generations) == null ? void 0 : t[0].text) || ""
|
6865
6900
|
});
|
6866
6901
|
case 3:
|
6867
6902
|
case "end":
|
6868
|
-
return
|
6903
|
+
return _context54.stop();
|
6869
6904
|
}
|
6870
|
-
},
|
6905
|
+
}, _callee54);
|
6871
6906
|
}));
|
6872
|
-
function extractResultData(
|
6907
|
+
function extractResultData(_x102) {
|
6873
6908
|
return _extractResultData12.apply(this, arguments);
|
6874
6909
|
}
|
6875
6910
|
return extractResultData;
|
@@ -6899,13 +6934,13 @@ var Ro = /*#__PURE__*/function (_Yi2) {
|
|
6899
6934
|
}, {
|
6900
6935
|
key: "callServiceAPI",
|
6901
6936
|
value: function () {
|
6902
|
-
var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6937
|
+
var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e, t) {
|
6903
6938
|
var i;
|
6904
|
-
return _regeneratorRuntime().wrap(function
|
6905
|
-
while (1) switch (
|
6939
|
+
return _regeneratorRuntime().wrap(function _callee55$(_context55) {
|
6940
|
+
while (1) switch (_context55.prev = _context55.next) {
|
6906
6941
|
case 0:
|
6907
6942
|
if (this.requestSettings) {
|
6908
|
-
|
6943
|
+
_context55.next = 2;
|
6909
6944
|
break;
|
6910
6945
|
}
|
6911
6946
|
throw new Error("Request settings have not been set up");
|
@@ -6914,11 +6949,11 @@ var Ro = /*#__PURE__*/function (_Yi2) {
|
|
6914
6949
|
w.request(this, i, e);
|
6915
6950
|
case 4:
|
6916
6951
|
case "end":
|
6917
|
-
return
|
6952
|
+
return _context55.stop();
|
6918
6953
|
}
|
6919
|
-
},
|
6954
|
+
}, _callee55, this);
|
6920
6955
|
}));
|
6921
|
-
function callServiceAPI(
|
6956
|
+
function callServiceAPI(_x103, _x104) {
|
6922
6957
|
return _callServiceAPI10.apply(this, arguments);
|
6923
6958
|
}
|
6924
6959
|
return callServiceAPI;
|
@@ -6926,26 +6961,26 @@ var Ro = /*#__PURE__*/function (_Yi2) {
|
|
6926
6961
|
}, {
|
6927
6962
|
key: "extractResultData",
|
6928
6963
|
value: function () {
|
6929
|
-
var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
6930
|
-
return _regeneratorRuntime().wrap(function
|
6931
|
-
while (1) switch (
|
6964
|
+
var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e) {
|
6965
|
+
return _regeneratorRuntime().wrap(function _callee56$(_context56) {
|
6966
|
+
while (1) switch (_context56.prev = _context56.next) {
|
6932
6967
|
case 0:
|
6933
6968
|
if (!e.message) {
|
6934
|
-
|
6969
|
+
_context56.next = 2;
|
6935
6970
|
break;
|
6936
6971
|
}
|
6937
6972
|
throw e.message;
|
6938
6973
|
case 2:
|
6939
|
-
return
|
6974
|
+
return _context56.abrupt("return", {
|
6940
6975
|
text: e.summary || ""
|
6941
6976
|
});
|
6942
6977
|
case 3:
|
6943
6978
|
case "end":
|
6944
|
-
return
|
6979
|
+
return _context56.stop();
|
6945
6980
|
}
|
6946
|
-
},
|
6981
|
+
}, _callee56);
|
6947
6982
|
}));
|
6948
|
-
function extractResultData(
|
6983
|
+
function extractResultData(_x105) {
|
6949
6984
|
return _extractResultData13.apply(this, arguments);
|
6950
6985
|
}
|
6951
6986
|
return extractResultData;
|
@@ -6984,60 +7019,60 @@ var O = /*#__PURE__*/function () {
|
|
6984
7019
|
}, {
|
6985
7020
|
key: "storeFiles",
|
6986
7021
|
value: function () {
|
6987
|
-
var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7022
|
+
var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e, t, i) {
|
6988
7023
|
var n, r, o, a;
|
6989
|
-
return _regeneratorRuntime().wrap(function
|
6990
|
-
while (1) switch (
|
7024
|
+
return _regeneratorRuntime().wrap(function _callee58$(_context58) {
|
7025
|
+
while (1) switch (_context58.prev = _context58.next) {
|
6991
7026
|
case 0:
|
6992
7027
|
n = e.requestSettings.headers;
|
6993
7028
|
if (n) {
|
6994
|
-
|
7029
|
+
_context58.next = 3;
|
6995
7030
|
break;
|
6996
7031
|
}
|
6997
|
-
return
|
7032
|
+
return _context58.abrupt("return");
|
6998
7033
|
case 3:
|
6999
7034
|
e.url = "https://api.openai.com/v1/files";
|
7000
7035
|
r = n[E.CONTENT_TYPE];
|
7001
7036
|
delete n[E.CONTENT_TYPE];
|
7002
7037
|
o = i.map( /*#__PURE__*/function () {
|
7003
|
-
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7038
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(a) {
|
7004
7039
|
var l;
|
7005
|
-
return _regeneratorRuntime().wrap(function
|
7006
|
-
while (1) switch (
|
7040
|
+
return _regeneratorRuntime().wrap(function _callee57$(_context57) {
|
7041
|
+
while (1) switch (_context57.prev = _context57.next) {
|
7007
7042
|
case 0:
|
7008
7043
|
l = new FormData();
|
7009
|
-
return
|
7044
|
+
return _context57.abrupt("return", (l.append("purpose", "assistants"), l.append("file", a), new Promise(function (c) {
|
7010
7045
|
c(O.directFetch(e, l, "POST", !1));
|
7011
7046
|
})));
|
7012
7047
|
case 2:
|
7013
7048
|
case "end":
|
7014
|
-
return
|
7049
|
+
return _context57.stop();
|
7015
7050
|
}
|
7016
|
-
},
|
7051
|
+
}, _callee57);
|
7017
7052
|
}));
|
7018
|
-
return function (
|
7053
|
+
return function (_x109) {
|
7019
7054
|
return _ref8.apply(this, arguments);
|
7020
7055
|
};
|
7021
7056
|
}());
|
7022
|
-
|
7023
|
-
|
7057
|
+
_context58.prev = 7;
|
7058
|
+
_context58.next = 10;
|
7024
7059
|
return Promise.all(o);
|
7025
7060
|
case 10:
|
7026
|
-
a =
|
7061
|
+
a = _context58.sent.map(function (l) {
|
7027
7062
|
return l.id;
|
7028
7063
|
});
|
7029
|
-
return
|
7064
|
+
return _context58.abrupt("return", (n[E.CONTENT_TYPE] = r, a));
|
7030
7065
|
case 14:
|
7031
|
-
|
7032
|
-
|
7033
|
-
throw n[E.CONTENT_TYPE] = r, E.displayError(t,
|
7066
|
+
_context58.prev = 14;
|
7067
|
+
_context58.t0 = _context58["catch"](7);
|
7068
|
+
throw n[E.CONTENT_TYPE] = r, E.displayError(t, _context58.t0), e.completionsHandlers.onFinish(), _context58.t0;
|
7034
7069
|
case 17:
|
7035
7070
|
case "end":
|
7036
|
-
return
|
7071
|
+
return _context58.stop();
|
7037
7072
|
}
|
7038
|
-
},
|
7073
|
+
}, _callee58, null, [[7, 14]]);
|
7039
7074
|
}));
|
7040
|
-
function storeFiles(
|
7075
|
+
function storeFiles(_x106, _x107, _x108) {
|
7041
7076
|
return _storeFiles.apply(this, arguments);
|
7042
7077
|
}
|
7043
7078
|
return storeFiles;
|
@@ -7045,35 +7080,35 @@ var O = /*#__PURE__*/function () {
|
|
7045
7080
|
}, {
|
7046
7081
|
key: "directFetch",
|
7047
7082
|
value: function () {
|
7048
|
-
var _directFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7083
|
+
var _directFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e, t, i) {
|
7049
7084
|
var n,
|
7050
7085
|
r,
|
7051
|
-
|
7052
|
-
return _regeneratorRuntime().wrap(function
|
7053
|
-
while (1) switch (
|
7086
|
+
_args59 = arguments;
|
7087
|
+
return _regeneratorRuntime().wrap(function _callee59$(_context59) {
|
7088
|
+
while (1) switch (_context59.prev = _context59.next) {
|
7054
7089
|
case 0:
|
7055
|
-
n =
|
7090
|
+
n = _args59.length > 3 && _args59[3] !== undefined ? _args59[3] : !0;
|
7056
7091
|
e.requestSettings.method = i;
|
7057
|
-
|
7092
|
+
_context59.next = 4;
|
7058
7093
|
return E.fetch(e, e.requestSettings.headers, n, t).then(function (o) {
|
7059
7094
|
return E.processResponseByType(o);
|
7060
7095
|
});
|
7061
7096
|
case 4:
|
7062
|
-
r =
|
7097
|
+
r = _context59.sent;
|
7063
7098
|
if (!r.error) {
|
7064
|
-
|
7099
|
+
_context59.next = 7;
|
7065
7100
|
break;
|
7066
7101
|
}
|
7067
7102
|
throw r.error.message;
|
7068
7103
|
case 7:
|
7069
|
-
return
|
7104
|
+
return _context59.abrupt("return", r);
|
7070
7105
|
case 8:
|
7071
7106
|
case "end":
|
7072
|
-
return
|
7107
|
+
return _context59.stop();
|
7073
7108
|
}
|
7074
|
-
},
|
7109
|
+
}, _callee59);
|
7075
7110
|
}));
|
7076
|
-
function directFetch(
|
7111
|
+
function directFetch(_x110, _x111, _x112) {
|
7077
7112
|
return _directFetch.apply(this, arguments);
|
7078
7113
|
}
|
7079
7114
|
return directFetch;
|
@@ -7107,13 +7142,13 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7107
7142
|
}, {
|
7108
7143
|
key: "callServiceAPI",
|
7109
7144
|
value: function () {
|
7110
|
-
var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7145
|
+
var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e, t) {
|
7111
7146
|
var n, i;
|
7112
|
-
return _regeneratorRuntime().wrap(function
|
7113
|
-
while (1) switch (
|
7147
|
+
return _regeneratorRuntime().wrap(function _callee60$(_context60) {
|
7148
|
+
while (1) switch (_context60.prev = _context60.next) {
|
7114
7149
|
case 0:
|
7115
7150
|
if ((n = this.requestSettings) != null && n.headers) {
|
7116
|
-
|
7151
|
+
_context60.next = 2;
|
7117
7152
|
break;
|
7118
7153
|
}
|
7119
7154
|
throw new Error("Request settings have not been set up");
|
@@ -7123,11 +7158,11 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7123
7158
|
w.request(this, i, e);
|
7124
7159
|
case 5:
|
7125
7160
|
case "end":
|
7126
|
-
return
|
7161
|
+
return _context60.stop();
|
7127
7162
|
}
|
7128
|
-
},
|
7163
|
+
}, _callee60, this);
|
7129
7164
|
}));
|
7130
|
-
function callServiceAPI(
|
7165
|
+
function callServiceAPI(_x113, _x114) {
|
7131
7166
|
return _callServiceAPI11.apply(this, arguments);
|
7132
7167
|
}
|
7133
7168
|
return callServiceAPI;
|
@@ -7135,15 +7170,15 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7135
7170
|
}, {
|
7136
7171
|
key: "extractResultData",
|
7137
7172
|
value: function () {
|
7138
|
-
var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7139
|
-
return _regeneratorRuntime().wrap(function
|
7140
|
-
while (1) switch (
|
7173
|
+
var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(e) {
|
7174
|
+
return _regeneratorRuntime().wrap(function _callee61$(_context61) {
|
7175
|
+
while (1) switch (_context61.prev = _context61.next) {
|
7141
7176
|
case 0:
|
7142
7177
|
if (!(e instanceof Blob)) {
|
7143
|
-
|
7178
|
+
_context61.next = 2;
|
7144
7179
|
break;
|
7145
7180
|
}
|
7146
|
-
return
|
7181
|
+
return _context61.abrupt("return", new Promise(function (t) {
|
7147
7182
|
var i = new FileReader();
|
7148
7183
|
i.readAsDataURL(e), i.onload = function (n) {
|
7149
7184
|
t({
|
@@ -7156,21 +7191,21 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7156
7191
|
}));
|
7157
7192
|
case 2:
|
7158
7193
|
if (!e.error) {
|
7159
|
-
|
7194
|
+
_context61.next = 4;
|
7160
7195
|
break;
|
7161
7196
|
}
|
7162
7197
|
throw e.error.message;
|
7163
7198
|
case 4:
|
7164
|
-
return
|
7199
|
+
return _context61.abrupt("return", {
|
7165
7200
|
error: "error"
|
7166
7201
|
});
|
7167
7202
|
case 5:
|
7168
7203
|
case "end":
|
7169
|
-
return
|
7204
|
+
return _context61.stop();
|
7170
7205
|
}
|
7171
|
-
},
|
7206
|
+
}, _callee61);
|
7172
7207
|
}));
|
7173
|
-
function extractResultData(
|
7208
|
+
function extractResultData(_x115) {
|
7174
7209
|
return _extractResultData14.apply(this, arguments);
|
7175
7210
|
}
|
7176
7211
|
return extractResultData;
|
@@ -7215,19 +7250,19 @@ var si = /*#__PURE__*/function (_q5) {
|
|
7215
7250
|
}, {
|
7216
7251
|
key: "callServiceAPI",
|
7217
7252
|
value: function () {
|
7218
|
-
var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7253
|
+
var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e, t, i) {
|
7219
7254
|
var o, n, r;
|
7220
|
-
return _regeneratorRuntime().wrap(function
|
7221
|
-
while (1) switch (
|
7255
|
+
return _regeneratorRuntime().wrap(function _callee62$(_context62) {
|
7256
|
+
while (1) switch (_context62.prev = _context62.next) {
|
7222
7257
|
case 0:
|
7223
7258
|
if ((o = this.requestSettings) != null && o.headers) {
|
7224
|
-
|
7259
|
+
_context62.next = 2;
|
7225
7260
|
break;
|
7226
7261
|
}
|
7227
7262
|
throw new Error("Request settings have not been set up");
|
7228
7263
|
case 2:
|
7229
7264
|
if (i != null && i[0]) {
|
7230
|
-
|
7265
|
+
_context62.next = 4;
|
7231
7266
|
break;
|
7232
7267
|
}
|
7233
7268
|
throw new Error("No file was added");
|
@@ -7237,11 +7272,11 @@ var si = /*#__PURE__*/function (_q5) {
|
|
7237
7272
|
E.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, r, e), !1);
|
7238
7273
|
case 7:
|
7239
7274
|
case "end":
|
7240
|
-
return
|
7275
|
+
return _context62.stop();
|
7241
7276
|
}
|
7242
|
-
},
|
7277
|
+
}, _callee62, this);
|
7243
7278
|
}));
|
7244
|
-
function callServiceAPI(
|
7279
|
+
function callServiceAPI(_x116, _x117, _x118) {
|
7245
7280
|
return _callServiceAPI12.apply(this, arguments);
|
7246
7281
|
}
|
7247
7282
|
return callServiceAPI;
|
@@ -7249,26 +7284,26 @@ var si = /*#__PURE__*/function (_q5) {
|
|
7249
7284
|
}, {
|
7250
7285
|
key: "extractResultData",
|
7251
7286
|
value: function () {
|
7252
|
-
var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7253
|
-
return _regeneratorRuntime().wrap(function
|
7254
|
-
while (1) switch (
|
7287
|
+
var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e) {
|
7288
|
+
return _regeneratorRuntime().wrap(function _callee63$(_context63) {
|
7289
|
+
while (1) switch (_context63.prev = _context63.next) {
|
7255
7290
|
case 0:
|
7256
7291
|
if (!e.error) {
|
7257
|
-
|
7292
|
+
_context63.next = 2;
|
7258
7293
|
break;
|
7259
7294
|
}
|
7260
7295
|
throw e.error.message;
|
7261
7296
|
case 2:
|
7262
|
-
return
|
7297
|
+
return _context63.abrupt("return", {
|
7263
7298
|
text: e.text
|
7264
7299
|
});
|
7265
7300
|
case 3:
|
7266
7301
|
case "end":
|
7267
|
-
return
|
7302
|
+
return _context63.stop();
|
7268
7303
|
}
|
7269
|
-
},
|
7304
|
+
}, _callee63);
|
7270
7305
|
}));
|
7271
|
-
function extractResultData(
|
7306
|
+
function extractResultData(_x119) {
|
7272
7307
|
return _extractResultData15.apply(this, arguments);
|
7273
7308
|
}
|
7274
7309
|
return extractResultData;
|
@@ -7447,13 +7482,13 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7447
7482
|
}, {
|
7448
7483
|
key: "callServiceAPI",
|
7449
7484
|
value: function () {
|
7450
|
-
var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7485
|
+
var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(e, t) {
|
7451
7486
|
var i;
|
7452
|
-
return _regeneratorRuntime().wrap(function
|
7453
|
-
while (1) switch (
|
7487
|
+
return _regeneratorRuntime().wrap(function _callee64$(_context64) {
|
7488
|
+
while (1) switch (_context64.prev = _context64.next) {
|
7454
7489
|
case 0:
|
7455
7490
|
if (this.requestSettings) {
|
7456
|
-
|
7491
|
+
_context64.next = 2;
|
7457
7492
|
break;
|
7458
7493
|
}
|
7459
7494
|
throw new Error("Request settings have not been set up");
|
@@ -7462,11 +7497,11 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7462
7497
|
w.request(this, i, e), this.messages = e;
|
7463
7498
|
case 4:
|
7464
7499
|
case "end":
|
7465
|
-
return
|
7500
|
+
return _context64.stop();
|
7466
7501
|
}
|
7467
|
-
},
|
7502
|
+
}, _callee64, this);
|
7468
7503
|
}));
|
7469
|
-
function callServiceAPI(
|
7504
|
+
function callServiceAPI(_x120, _x121) {
|
7470
7505
|
return _callServiceAPI13.apply(this, arguments);
|
7471
7506
|
}
|
7472
7507
|
return callServiceAPI;
|
@@ -7474,13 +7509,13 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7474
7509
|
}, {
|
7475
7510
|
key: "extractResultData",
|
7476
7511
|
value: function () {
|
7477
|
-
var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7512
|
+
var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e) {
|
7478
7513
|
var t, _i9, n;
|
7479
|
-
return _regeneratorRuntime().wrap(function
|
7480
|
-
while (1) switch (
|
7514
|
+
return _regeneratorRuntime().wrap(function _callee65$(_context65) {
|
7515
|
+
while (1) switch (_context65.prev = _context65.next) {
|
7481
7516
|
case 0:
|
7482
7517
|
if (!e.error) {
|
7483
|
-
|
7518
|
+
_context65.next = 2;
|
7484
7519
|
break;
|
7485
7520
|
}
|
7486
7521
|
throw e.error.message;
|
@@ -7492,16 +7527,16 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7492
7527
|
};
|
7493
7528
|
w.executePollRequest(this, _i9, n, this.messages);
|
7494
7529
|
}
|
7495
|
-
return
|
7530
|
+
return _context65.abrupt("return", {
|
7496
7531
|
makingAnotherRequest: !0
|
7497
7532
|
});
|
7498
7533
|
case 4:
|
7499
7534
|
case "end":
|
7500
|
-
return
|
7535
|
+
return _context65.stop();
|
7501
7536
|
}
|
7502
|
-
},
|
7537
|
+
}, _callee65, this);
|
7503
7538
|
}));
|
7504
|
-
function extractResultData(
|
7539
|
+
function extractResultData(_x122) {
|
7505
7540
|
return _extractResultData16.apply(this, arguments);
|
7506
7541
|
}
|
7507
7542
|
return extractResultData;
|
@@ -7509,33 +7544,33 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7509
7544
|
}, {
|
7510
7545
|
key: "extractPollResultData",
|
7511
7546
|
value: function () {
|
7512
|
-
var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7547
|
+
var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e) {
|
7513
7548
|
var t, _iterator, _step, _i10;
|
7514
|
-
return _regeneratorRuntime().wrap(function
|
7515
|
-
while (1) switch (
|
7549
|
+
return _regeneratorRuntime().wrap(function _callee66$(_context66) {
|
7550
|
+
while (1) switch (_context66.prev = _context66.next) {
|
7516
7551
|
case 0:
|
7517
7552
|
if (!e.error) {
|
7518
|
-
|
7553
|
+
_context66.next = 2;
|
7519
7554
|
break;
|
7520
7555
|
}
|
7521
7556
|
throw e.error;
|
7522
7557
|
case 2:
|
7523
7558
|
if (!(e.status === "running")) {
|
7524
|
-
|
7559
|
+
_context66.next = 4;
|
7525
7560
|
break;
|
7526
7561
|
}
|
7527
|
-
return
|
7562
|
+
return _context66.abrupt("return", {
|
7528
7563
|
timeoutMS: 2e3
|
7529
7564
|
});
|
7530
7565
|
case 4:
|
7531
7566
|
if (!(e.errors.length > 0)) {
|
7532
|
-
|
7567
|
+
_context66.next = 6;
|
7533
7568
|
break;
|
7534
7569
|
}
|
7535
7570
|
throw e.errors[0];
|
7536
7571
|
case 6:
|
7537
7572
|
if (!(e.tasks.items[0].results.errors.length > 0)) {
|
7538
|
-
|
7573
|
+
_context66.next = 8;
|
7539
7574
|
break;
|
7540
7575
|
}
|
7541
7576
|
throw e.tasks.items[0].results.errors[0];
|
@@ -7552,16 +7587,16 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7552
7587
|
} finally {
|
7553
7588
|
_iterator.f();
|
7554
7589
|
}
|
7555
|
-
return
|
7590
|
+
return _context66.abrupt("return", {
|
7556
7591
|
text: t || ""
|
7557
7592
|
});
|
7558
7593
|
case 12:
|
7559
7594
|
case "end":
|
7560
|
-
return
|
7595
|
+
return _context66.stop();
|
7561
7596
|
}
|
7562
|
-
},
|
7597
|
+
}, _callee66);
|
7563
7598
|
}));
|
7564
|
-
function extractPollResultData(
|
7599
|
+
function extractPollResultData(_x123) {
|
7565
7600
|
return _extractPollResultData4.apply(this, arguments);
|
7566
7601
|
}
|
7567
7602
|
return extractPollResultData;
|
@@ -7576,17 +7611,17 @@ var ct = /*#__PURE__*/function () {
|
|
7576
7611
|
_createClass(ct, null, [{
|
7577
7612
|
key: "poll",
|
7578
7613
|
value: function () {
|
7579
|
-
var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7614
|
+
var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(e, t) {
|
7580
7615
|
var i, a, l, d;
|
7581
|
-
return _regeneratorRuntime().wrap(function
|
7582
|
-
while (1) switch (
|
7616
|
+
return _regeneratorRuntime().wrap(function _callee67$(_context67) {
|
7617
|
+
while (1) switch (_context67.prev = _context67.next) {
|
7583
7618
|
case 0:
|
7584
7619
|
i = {
|
7585
7620
|
authorization: e,
|
7586
7621
|
"content-type": "application/json"
|
7587
7622
|
};
|
7588
|
-
|
7589
|
-
|
7623
|
+
_context67.t0 = "https://api.assemblyai.com/v2/transcript/";
|
7624
|
+
_context67.next = 4;
|
7590
7625
|
return fetch("https://api.assemblyai.com/v2/transcript", {
|
7591
7626
|
method: "POST",
|
7592
7627
|
body: JSON.stringify({
|
@@ -7595,55 +7630,55 @@ var ct = /*#__PURE__*/function () {
|
|
7595
7630
|
headers: i
|
7596
7631
|
});
|
7597
7632
|
case 4:
|
7598
|
-
|
7599
|
-
return
|
7633
|
+
_context67.next = 6;
|
7634
|
+
return _context67.sent.json();
|
7600
7635
|
case 6:
|
7601
|
-
|
7602
|
-
a =
|
7636
|
+
_context67.t1 = _context67.sent.id;
|
7637
|
+
a = _context67.t0.concat.call(_context67.t0, _context67.t1);
|
7603
7638
|
case 8:
|
7604
7639
|
if (l) {
|
7605
|
-
|
7640
|
+
_context67.next = 24;
|
7606
7641
|
break;
|
7607
7642
|
}
|
7608
|
-
|
7643
|
+
_context67.next = 11;
|
7609
7644
|
return fetch(a, {
|
7610
7645
|
headers: i
|
7611
7646
|
});
|
7612
7647
|
case 11:
|
7613
|
-
|
7614
|
-
return
|
7648
|
+
_context67.next = 13;
|
7649
|
+
return _context67.sent.json();
|
7615
7650
|
case 13:
|
7616
|
-
d =
|
7651
|
+
d = _context67.sent;
|
7617
7652
|
if (!(d.status === "completed")) {
|
7618
|
-
|
7653
|
+
_context67.next = 18;
|
7619
7654
|
break;
|
7620
7655
|
}
|
7621
7656
|
l = d;
|
7622
|
-
|
7657
|
+
_context67.next = 22;
|
7623
7658
|
break;
|
7624
7659
|
case 18:
|
7625
7660
|
if (!(d.status === "error")) {
|
7626
|
-
|
7661
|
+
_context67.next = 20;
|
7627
7662
|
break;
|
7628
7663
|
}
|
7629
7664
|
throw new Error("Transcription failed: ".concat(d.error));
|
7630
7665
|
case 20:
|
7631
|
-
|
7666
|
+
_context67.next = 22;
|
7632
7667
|
return new Promise(function (u) {
|
7633
7668
|
return setTimeout(u, 3e3);
|
7634
7669
|
});
|
7635
7670
|
case 22:
|
7636
|
-
|
7671
|
+
_context67.next = 8;
|
7637
7672
|
break;
|
7638
7673
|
case 24:
|
7639
|
-
return
|
7674
|
+
return _context67.abrupt("return", l);
|
7640
7675
|
case 25:
|
7641
7676
|
case "end":
|
7642
|
-
return
|
7677
|
+
return _context67.stop();
|
7643
7678
|
}
|
7644
|
-
},
|
7679
|
+
}, _callee67);
|
7645
7680
|
}));
|
7646
|
-
function poll(
|
7681
|
+
function poll(_x124, _x125) {
|
7647
7682
|
return _poll2.apply(this, arguments);
|
7648
7683
|
}
|
7649
7684
|
return poll;
|
@@ -7691,19 +7726,19 @@ var Xi = /*#__PURE__*/function (_q7) {
|
|
7691
7726
|
_createClass(Xi, [{
|
7692
7727
|
key: "callServiceAPI",
|
7693
7728
|
value: function () {
|
7694
|
-
var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7729
|
+
var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(e, t, i) {
|
7695
7730
|
var n;
|
7696
|
-
return _regeneratorRuntime().wrap(function
|
7697
|
-
while (1) switch (
|
7731
|
+
return _regeneratorRuntime().wrap(function _callee68$(_context68) {
|
7732
|
+
while (1) switch (_context68.prev = _context68.next) {
|
7698
7733
|
case 0:
|
7699
7734
|
if ((n = this.requestSettings) != null && n.headers) {
|
7700
|
-
|
7735
|
+
_context68.next = 2;
|
7701
7736
|
break;
|
7702
7737
|
}
|
7703
7738
|
throw new Error("Request settings have not been set up");
|
7704
7739
|
case 2:
|
7705
7740
|
if (i != null && i[0]) {
|
7706
|
-
|
7741
|
+
_context68.next = 4;
|
7707
7742
|
break;
|
7708
7743
|
}
|
7709
7744
|
throw new Error("No file was added");
|
@@ -7711,11 +7746,11 @@ var Xi = /*#__PURE__*/function (_q7) {
|
|
7711
7746
|
w.request(this, i[0], e, !1);
|
7712
7747
|
case 5:
|
7713
7748
|
case "end":
|
7714
|
-
return
|
7749
|
+
return _context68.stop();
|
7715
7750
|
}
|
7716
|
-
},
|
7751
|
+
}, _callee68, this);
|
7717
7752
|
}));
|
7718
|
-
function callServiceAPI(
|
7753
|
+
function callServiceAPI(_x126, _x127, _x128) {
|
7719
7754
|
return _callServiceAPI14.apply(this, arguments);
|
7720
7755
|
}
|
7721
7756
|
return callServiceAPI;
|
@@ -7723,32 +7758,32 @@ var Xi = /*#__PURE__*/function (_q7) {
|
|
7723
7758
|
}, {
|
7724
7759
|
key: "extractResultData",
|
7725
7760
|
value: function () {
|
7726
|
-
var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7761
|
+
var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(e) {
|
7727
7762
|
var n, r, t;
|
7728
|
-
return _regeneratorRuntime().wrap(function
|
7729
|
-
while (1) switch (
|
7763
|
+
return _regeneratorRuntime().wrap(function _callee69$(_context69) {
|
7764
|
+
while (1) switch (_context69.prev = _context69.next) {
|
7730
7765
|
case 0:
|
7731
7766
|
if (!e.error) {
|
7732
|
-
|
7767
|
+
_context69.next = 2;
|
7733
7768
|
break;
|
7734
7769
|
}
|
7735
7770
|
throw e.error;
|
7736
7771
|
case 2:
|
7737
7772
|
t = (r = (n = this.requestSettings) == null ? void 0 : n.headers) == null ? void 0 : r.Authorization;
|
7738
|
-
|
7773
|
+
_context69.next = 5;
|
7739
7774
|
return ct.poll(t, e.upload_url);
|
7740
7775
|
case 5:
|
7741
|
-
|
7742
|
-
return
|
7743
|
-
text:
|
7776
|
+
_context69.t0 = _context69.sent.text;
|
7777
|
+
return _context69.abrupt("return", {
|
7778
|
+
text: _context69.t0
|
7744
7779
|
});
|
7745
7780
|
case 7:
|
7746
7781
|
case "end":
|
7747
|
-
return
|
7782
|
+
return _context69.stop();
|
7748
7783
|
}
|
7749
|
-
},
|
7784
|
+
}, _callee69, this);
|
7750
7785
|
}));
|
7751
|
-
function extractResultData(
|
7786
|
+
function extractResultData(_x129) {
|
7752
7787
|
return _extractResultData17.apply(this, arguments);
|
7753
7788
|
}
|
7754
7789
|
return extractResultData;
|
@@ -7798,13 +7833,13 @@ var ls = /*#__PURE__*/function (_as) {
|
|
7798
7833
|
}, {
|
7799
7834
|
key: "callServiceAPI",
|
7800
7835
|
value: function () {
|
7801
|
-
var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7836
|
+
var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e, t) {
|
7802
7837
|
var i;
|
7803
|
-
return _regeneratorRuntime().wrap(function
|
7804
|
-
while (1) switch (
|
7838
|
+
return _regeneratorRuntime().wrap(function _callee70$(_context70) {
|
7839
|
+
while (1) switch (_context70.prev = _context70.next) {
|
7805
7840
|
case 0:
|
7806
7841
|
if (this.requestSettings) {
|
7807
|
-
|
7842
|
+
_context70.next = 2;
|
7808
7843
|
break;
|
7809
7844
|
}
|
7810
7845
|
throw new Error("Request settings have not been set up");
|
@@ -7813,11 +7848,11 @@ var ls = /*#__PURE__*/function (_as) {
|
|
7813
7848
|
w.request(this, i, e, !1);
|
7814
7849
|
case 4:
|
7815
7850
|
case "end":
|
7816
|
-
return
|
7851
|
+
return _context70.stop();
|
7817
7852
|
}
|
7818
|
-
},
|
7853
|
+
}, _callee70, this);
|
7819
7854
|
}));
|
7820
|
-
function callServiceAPI(
|
7855
|
+
function callServiceAPI(_x130, _x131) {
|
7821
7856
|
return _callServiceAPI15.apply(this, arguments);
|
7822
7857
|
}
|
7823
7858
|
return callServiceAPI;
|
@@ -7825,11 +7860,11 @@ var ls = /*#__PURE__*/function (_as) {
|
|
7825
7860
|
}, {
|
7826
7861
|
key: "extractResultData",
|
7827
7862
|
value: function () {
|
7828
|
-
var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7829
|
-
return _regeneratorRuntime().wrap(function
|
7830
|
-
while (1) switch (
|
7863
|
+
var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e) {
|
7864
|
+
return _regeneratorRuntime().wrap(function _callee71$(_context71) {
|
7865
|
+
while (1) switch (_context71.prev = _context71.next) {
|
7831
7866
|
case 0:
|
7832
|
-
return
|
7867
|
+
return _context71.abrupt("return", new Promise(function (t) {
|
7833
7868
|
var i = new FileReader();
|
7834
7869
|
i.readAsDataURL(e), i.onload = function (n) {
|
7835
7870
|
t({
|
@@ -7842,11 +7877,11 @@ var ls = /*#__PURE__*/function (_as) {
|
|
7842
7877
|
}));
|
7843
7878
|
case 1:
|
7844
7879
|
case "end":
|
7845
|
-
return
|
7880
|
+
return _context71.stop();
|
7846
7881
|
}
|
7847
|
-
},
|
7882
|
+
}, _callee71);
|
7848
7883
|
}));
|
7849
|
-
function extractResultData(
|
7884
|
+
function extractResultData(_x132) {
|
7850
7885
|
return _extractResultData18.apply(this, arguments);
|
7851
7886
|
}
|
7852
7887
|
return extractResultData;
|
@@ -7882,19 +7917,19 @@ var ds = /*#__PURE__*/function (_as2) {
|
|
7882
7917
|
_createClass(Bi, [{
|
7883
7918
|
key: "callServiceAPI",
|
7884
7919
|
value: function () {
|
7885
|
-
var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7920
|
+
var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e, t, i) {
|
7886
7921
|
var n, r;
|
7887
|
-
return _regeneratorRuntime().wrap(function
|
7888
|
-
while (1) switch (
|
7922
|
+
return _regeneratorRuntime().wrap(function _callee72$(_context72) {
|
7923
|
+
while (1) switch (_context72.prev = _context72.next) {
|
7889
7924
|
case 0:
|
7890
7925
|
if ((n = this.requestSettings) != null && n.headers) {
|
7891
|
-
|
7926
|
+
_context72.next = 2;
|
7892
7927
|
break;
|
7893
7928
|
}
|
7894
7929
|
throw new Error("Request settings have not been set up");
|
7895
7930
|
case 2:
|
7896
7931
|
if (i != null && i[0]) {
|
7897
|
-
|
7932
|
+
_context72.next = 4;
|
7898
7933
|
break;
|
7899
7934
|
}
|
7900
7935
|
throw new Error("No file was added");
|
@@ -7902,11 +7937,11 @@ var ds = /*#__PURE__*/function (_as2) {
|
|
7902
7937
|
(r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), w.request(this, i[0], e, !1);
|
7903
7938
|
case 5:
|
7904
7939
|
case "end":
|
7905
|
-
return
|
7940
|
+
return _context72.stop();
|
7906
7941
|
}
|
7907
|
-
},
|
7942
|
+
}, _callee72, this);
|
7908
7943
|
}));
|
7909
|
-
function callServiceAPI(
|
7944
|
+
function callServiceAPI(_x133, _x134, _x135) {
|
7910
7945
|
return _callServiceAPI16.apply(this, arguments);
|
7911
7946
|
}
|
7912
7947
|
return callServiceAPI;
|
@@ -7914,26 +7949,26 @@ var ds = /*#__PURE__*/function (_as2) {
|
|
7914
7949
|
}, {
|
7915
7950
|
key: "extractResultData",
|
7916
7951
|
value: function () {
|
7917
|
-
var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
7918
|
-
return _regeneratorRuntime().wrap(function
|
7919
|
-
while (1) switch (
|
7952
|
+
var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e) {
|
7953
|
+
return _regeneratorRuntime().wrap(function _callee73$(_context73) {
|
7954
|
+
while (1) switch (_context73.prev = _context73.next) {
|
7920
7955
|
case 0:
|
7921
7956
|
if (!e.error) {
|
7922
|
-
|
7957
|
+
_context73.next = 2;
|
7923
7958
|
break;
|
7924
7959
|
}
|
7925
7960
|
throw e.error;
|
7926
7961
|
case 2:
|
7927
|
-
return
|
7962
|
+
return _context73.abrupt("return", {
|
7928
7963
|
text: e.DisplayText || ""
|
7929
7964
|
});
|
7930
7965
|
case 3:
|
7931
7966
|
case "end":
|
7932
|
-
return
|
7967
|
+
return _context73.stop();
|
7933
7968
|
}
|
7934
|
-
},
|
7969
|
+
}, _callee73);
|
7935
7970
|
}));
|
7936
|
-
function extractResultData(
|
7971
|
+
function extractResultData(_x136) {
|
7937
7972
|
return _extractResultData19.apply(this, arguments);
|
7938
7973
|
}
|
7939
7974
|
return extractResultData;
|
@@ -7976,13 +8011,13 @@ var Bo = /*#__PURE__*/function (_q9) {
|
|
7976
8011
|
}, {
|
7977
8012
|
key: "callServiceAPI",
|
7978
8013
|
value: function () {
|
7979
|
-
var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8014
|
+
var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(e, t) {
|
7980
8015
|
var i;
|
7981
|
-
return _regeneratorRuntime().wrap(function
|
7982
|
-
while (1) switch (
|
8016
|
+
return _regeneratorRuntime().wrap(function _callee74$(_context74) {
|
8017
|
+
while (1) switch (_context74.prev = _context74.next) {
|
7983
8018
|
case 0:
|
7984
8019
|
if (this.requestSettings) {
|
7985
|
-
|
8020
|
+
_context74.next = 2;
|
7986
8021
|
break;
|
7987
8022
|
}
|
7988
8023
|
throw new Error("Request settings have not been set up");
|
@@ -7991,11 +8026,11 @@ var Bo = /*#__PURE__*/function (_q9) {
|
|
7991
8026
|
w.request(this, i, e);
|
7992
8027
|
case 4:
|
7993
8028
|
case "end":
|
7994
|
-
return
|
8029
|
+
return _context74.stop();
|
7995
8030
|
}
|
7996
|
-
},
|
8031
|
+
}, _callee74, this);
|
7997
8032
|
}));
|
7998
|
-
function callServiceAPI(
|
8033
|
+
function callServiceAPI(_x137, _x138) {
|
7999
8034
|
return _callServiceAPI17.apply(this, arguments);
|
8000
8035
|
}
|
8001
8036
|
return callServiceAPI;
|
@@ -8003,27 +8038,27 @@ var Bo = /*#__PURE__*/function (_q9) {
|
|
8003
8038
|
}, {
|
8004
8039
|
key: "extractResultData",
|
8005
8040
|
value: function () {
|
8006
|
-
var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8041
|
+
var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(e) {
|
8007
8042
|
var t;
|
8008
|
-
return _regeneratorRuntime().wrap(function
|
8009
|
-
while (1) switch (
|
8043
|
+
return _regeneratorRuntime().wrap(function _callee75$(_context75) {
|
8044
|
+
while (1) switch (_context75.prev = _context75.next) {
|
8010
8045
|
case 0:
|
8011
8046
|
if (!Array.isArray(e)) {
|
8012
|
-
|
8047
|
+
_context75.next = 2;
|
8013
8048
|
break;
|
8014
8049
|
}
|
8015
|
-
return
|
8050
|
+
return _context75.abrupt("return", {
|
8016
8051
|
text: ((t = e[0].translations) == null ? void 0 : t[0].text) || ""
|
8017
8052
|
});
|
8018
8053
|
case 2:
|
8019
8054
|
throw e.error;
|
8020
8055
|
case 3:
|
8021
8056
|
case "end":
|
8022
|
-
return
|
8057
|
+
return _context75.stop();
|
8023
8058
|
}
|
8024
|
-
},
|
8059
|
+
}, _callee75);
|
8025
8060
|
}));
|
8026
|
-
function extractResultData(
|
8061
|
+
function extractResultData(_x139) {
|
8027
8062
|
return _extractResultData20.apply(this, arguments);
|
8028
8063
|
}
|
8029
8064
|
return extractResultData;
|
@@ -8088,40 +8123,40 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8088
8123
|
}, {
|
8089
8124
|
key: "callServiceAPI",
|
8090
8125
|
value: function () {
|
8091
|
-
var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8126
|
+
var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(e, t, i) {
|
8092
8127
|
var n;
|
8093
|
-
return _regeneratorRuntime().wrap(function
|
8094
|
-
while (1) switch (
|
8128
|
+
return _regeneratorRuntime().wrap(function _callee76$(_context76) {
|
8129
|
+
while (1) switch (_context76.prev = _context76.next) {
|
8095
8130
|
case 0:
|
8096
8131
|
if (this.requestSettings) {
|
8097
|
-
|
8132
|
+
_context76.next = 2;
|
8098
8133
|
break;
|
8099
8134
|
}
|
8100
8135
|
throw new Error("Request settings have not been set up");
|
8101
8136
|
case 2:
|
8102
8137
|
this.searchedForThreadId || this.searchPreviousMessagesForThreadId(e.messages);
|
8103
8138
|
if (!i) {
|
8104
|
-
|
8139
|
+
_context76.next = 9;
|
8105
8140
|
break;
|
8106
8141
|
}
|
8107
|
-
|
8142
|
+
_context76.next = 6;
|
8108
8143
|
return O.storeFiles(this, e, i);
|
8109
8144
|
case 6:
|
8110
|
-
|
8111
|
-
|
8145
|
+
_context76.t0 = _context76.sent;
|
8146
|
+
_context76.next = 10;
|
8112
8147
|
break;
|
8113
8148
|
case 9:
|
8114
|
-
|
8149
|
+
_context76.t0 = void 0;
|
8115
8150
|
case 10:
|
8116
|
-
n =
|
8151
|
+
n = _context76.t0;
|
8117
8152
|
this.requestSettings.method = "POST", this.callService(e, t, n);
|
8118
8153
|
case 12:
|
8119
8154
|
case "end":
|
8120
|
-
return
|
8155
|
+
return _context76.stop();
|
8121
8156
|
}
|
8122
|
-
},
|
8157
|
+
}, _callee76, this);
|
8123
8158
|
}));
|
8124
|
-
function callServiceAPI(
|
8159
|
+
function callServiceAPI(_x140, _x141, _x142) {
|
8125
8160
|
return _callServiceAPI18.apply(this, arguments);
|
8126
8161
|
}
|
8127
8162
|
return callServiceAPI;
|
@@ -8137,34 +8172,34 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8137
8172
|
}, {
|
8138
8173
|
key: "extractResultData",
|
8139
8174
|
value: function () {
|
8140
|
-
var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8175
|
+
var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(e) {
|
8141
8176
|
var n, t, i;
|
8142
|
-
return _regeneratorRuntime().wrap(function
|
8143
|
-
while (1) switch (
|
8177
|
+
return _regeneratorRuntime().wrap(function _callee77$(_context77) {
|
8178
|
+
while (1) switch (_context77.prev = _context77.next) {
|
8144
8179
|
case 0:
|
8145
8180
|
if (!e.error) {
|
8146
|
-
|
8181
|
+
_context77.next = 2;
|
8147
8182
|
break;
|
8148
8183
|
}
|
8149
8184
|
throw e.error.message;
|
8150
8185
|
case 2:
|
8151
|
-
|
8186
|
+
_context77.next = 4;
|
8152
8187
|
return this.assignThreadAndRun(e);
|
8153
8188
|
case 4:
|
8154
8189
|
t = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
|
8155
8190
|
method: "GET",
|
8156
8191
|
headers: (n = this.requestSettings) == null ? void 0 : n.headers
|
8157
8192
|
};
|
8158
|
-
return
|
8193
|
+
return _context77.abrupt("return", (w.executePollRequest(this, t, i, this.messages), {
|
8159
8194
|
makingAnotherRequest: !0
|
8160
8195
|
}));
|
8161
8196
|
case 6:
|
8162
8197
|
case "end":
|
8163
|
-
return
|
8198
|
+
return _context77.stop();
|
8164
8199
|
}
|
8165
|
-
},
|
8200
|
+
}, _callee77, this);
|
8166
8201
|
}));
|
8167
|
-
function extractResultData(
|
8202
|
+
function extractResultData(_x143) {
|
8168
8203
|
return _extractResultData21.apply(this, arguments);
|
8169
8204
|
}
|
8170
8205
|
return extractResultData;
|
@@ -8172,32 +8207,32 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8172
8207
|
}, {
|
8173
8208
|
key: "assignThreadAndRun",
|
8174
8209
|
value: function () {
|
8175
|
-
var _assignThreadAndRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8210
|
+
var _assignThreadAndRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(e) {
|
8176
8211
|
var t;
|
8177
|
-
return _regeneratorRuntime().wrap(function
|
8178
|
-
while (1) switch (
|
8212
|
+
return _regeneratorRuntime().wrap(function _callee78$(_context78) {
|
8213
|
+
while (1) switch (_context78.prev = _context78.next) {
|
8179
8214
|
case 0:
|
8180
8215
|
if (!this.sessionId) {
|
8181
|
-
|
8216
|
+
_context78.next = 8;
|
8182
8217
|
break;
|
8183
8218
|
}
|
8184
8219
|
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
|
8185
|
-
|
8220
|
+
_context78.next = 4;
|
8186
8221
|
return O.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
|
8187
8222
|
case 4:
|
8188
|
-
t =
|
8223
|
+
t = _context78.sent;
|
8189
8224
|
this.run_id = t.id;
|
8190
|
-
|
8225
|
+
_context78.next = 9;
|
8191
8226
|
break;
|
8192
8227
|
case 8:
|
8193
8228
|
this.sessionId = e.thread_id, this.run_id = e.id, this.messages && (this.messages.messages[this.messages.messages.length - 1]._sessionId = this.sessionId);
|
8194
8229
|
case 9:
|
8195
8230
|
case "end":
|
8196
|
-
return
|
8231
|
+
return _context78.stop();
|
8197
8232
|
}
|
8198
|
-
},
|
8233
|
+
}, _callee78, this);
|
8199
8234
|
}));
|
8200
|
-
function assignThreadAndRun(
|
8235
|
+
function assignThreadAndRun(_x144) {
|
8201
8236
|
return _assignThreadAndRun.apply(this, arguments);
|
8202
8237
|
}
|
8203
8238
|
return assignThreadAndRun;
|
@@ -8205,53 +8240,53 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8205
8240
|
}, {
|
8206
8241
|
key: "extractPollResultData",
|
8207
8242
|
value: function () {
|
8208
|
-
var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8243
|
+
var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(e) {
|
8209
8244
|
var r, t, i, n;
|
8210
|
-
return _regeneratorRuntime().wrap(function
|
8211
|
-
while (1) switch (
|
8245
|
+
return _regeneratorRuntime().wrap(function _callee79$(_context79) {
|
8246
|
+
while (1) switch (_context79.prev = _context79.next) {
|
8212
8247
|
case 0:
|
8213
8248
|
t = e.status, i = e.required_action;
|
8214
8249
|
if (!(t === "queued" || t === "in_progress")) {
|
8215
|
-
|
8250
|
+
_context79.next = 3;
|
8216
8251
|
break;
|
8217
8252
|
}
|
8218
|
-
return
|
8253
|
+
return _context79.abrupt("return", {
|
8219
8254
|
timeoutMS: ae.POLLING_TIMEOUT_MS
|
8220
8255
|
});
|
8221
8256
|
case 3:
|
8222
8257
|
if (!(t === "completed" && this.messages)) {
|
8223
|
-
|
8258
|
+
_context79.next = 10;
|
8224
8259
|
break;
|
8225
8260
|
}
|
8226
8261
|
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
|
8227
|
-
|
8262
|
+
_context79.next = 7;
|
8228
8263
|
return O.directFetch(this, {}, "GET");
|
8229
8264
|
case 7:
|
8230
|
-
|
8231
|
-
|
8232
|
-
return
|
8233
|
-
text:
|
8234
|
-
_sessionId:
|
8265
|
+
_context79.t0 = _context79.sent.data[0].content[0].text.value;
|
8266
|
+
_context79.t1 = this.sessionId;
|
8267
|
+
return _context79.abrupt("return", {
|
8268
|
+
text: _context79.t0,
|
8269
|
+
_sessionId: _context79.t1
|
8235
8270
|
});
|
8236
8271
|
case 10:
|
8237
8272
|
n = (r = i == null ? void 0 : i.submit_tool_outputs) == null ? void 0 : r.tool_calls;
|
8238
8273
|
if (!(t === "requires_action" && n)) {
|
8239
|
-
|
8274
|
+
_context79.next = 15;
|
8240
8275
|
break;
|
8241
8276
|
}
|
8242
|
-
|
8277
|
+
_context79.next = 14;
|
8243
8278
|
return this.handleTools(n);
|
8244
8279
|
case 14:
|
8245
|
-
return
|
8280
|
+
return _context79.abrupt("return", _context79.sent);
|
8246
8281
|
case 15:
|
8247
8282
|
throw Error("Thread run status: ".concat(t));
|
8248
8283
|
case 16:
|
8249
8284
|
case "end":
|
8250
|
-
return
|
8285
|
+
return _context79.stop();
|
8251
8286
|
}
|
8252
|
-
},
|
8287
|
+
}, _callee79, this);
|
8253
8288
|
}));
|
8254
|
-
function extractPollResultData(
|
8289
|
+
function extractPollResultData(_x145) {
|
8255
8290
|
return _extractPollResultData5.apply(this, arguments);
|
8256
8291
|
}
|
8257
8292
|
return extractPollResultData;
|
@@ -8259,13 +8294,13 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8259
8294
|
}, {
|
8260
8295
|
key: "handleTools",
|
8261
8296
|
value: function () {
|
8262
|
-
var _handleTools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8297
|
+
var _handleTools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(e) {
|
8263
8298
|
var t, i, n;
|
8264
|
-
return _regeneratorRuntime().wrap(function
|
8265
|
-
while (1) switch (
|
8299
|
+
return _regeneratorRuntime().wrap(function _callee80$(_context80) {
|
8300
|
+
while (1) switch (_context80.prev = _context80.next) {
|
8266
8301
|
case 0:
|
8267
8302
|
if (this._functionHandler) {
|
8268
|
-
|
8303
|
+
_context80.next = 2;
|
8269
8304
|
break;
|
8270
8305
|
}
|
8271
8306
|
throw Error("Please define the `function_handler` property inside the [openAI](https://deepchat.dev/docs/directConnection/openAI#Assistant) object.");
|
@@ -8276,14 +8311,14 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8276
8311
|
arguments: r["function"].arguments
|
8277
8312
|
};
|
8278
8313
|
});
|
8279
|
-
|
8314
|
+
_context80.next = 5;
|
8280
8315
|
return this._functionHandler(t);
|
8281
8316
|
case 5:
|
8282
|
-
i =
|
8317
|
+
i = _context80.sent;
|
8283
8318
|
if (!(!Array.isArray(i) || i.find(function (r) {
|
8284
8319
|
return typeof r != "string";
|
8285
8320
|
}) || e.length !== i.length)) {
|
8286
|
-
|
8321
|
+
_context80.next = 8;
|
8287
8322
|
break;
|
8288
8323
|
}
|
8289
8324
|
throw Error("Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.");
|
@@ -8295,21 +8330,21 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8295
8330
|
};
|
8296
8331
|
});
|
8297
8332
|
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
|
8298
|
-
|
8333
|
+
_context80.next = 12;
|
8299
8334
|
return O.directFetch(this, {
|
8300
8335
|
tool_outputs: n
|
8301
8336
|
}, "POST");
|
8302
8337
|
case 12:
|
8303
|
-
return
|
8338
|
+
return _context80.abrupt("return", {
|
8304
8339
|
timeoutMS: ae.POLLING_TIMEOUT_MS
|
8305
8340
|
});
|
8306
8341
|
case 13:
|
8307
8342
|
case "end":
|
8308
|
-
return
|
8343
|
+
return _context80.stop();
|
8309
8344
|
}
|
8310
|
-
},
|
8345
|
+
}, _callee80, this);
|
8311
8346
|
}));
|
8312
|
-
function handleTools(
|
8347
|
+
function handleTools(_x146) {
|
8313
8348
|
return _handleTools.apply(this, arguments);
|
8314
8349
|
}
|
8315
8350
|
return handleTools;
|
@@ -8374,27 +8409,27 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8374
8409
|
}, {
|
8375
8410
|
key: "callServiceAPI",
|
8376
8411
|
value: function () {
|
8377
|
-
var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8412
|
+
var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee81(e, t, i) {
|
8378
8413
|
var n, r;
|
8379
|
-
return _regeneratorRuntime().wrap(function
|
8380
|
-
while (1) switch (
|
8414
|
+
return _regeneratorRuntime().wrap(function _callee81$(_context81) {
|
8415
|
+
while (1) switch (_context81.prev = _context81.next) {
|
8381
8416
|
case 0:
|
8382
8417
|
if ((n = this.requestSettings) != null && n.headers) {
|
8383
|
-
|
8418
|
+
_context81.next = 2;
|
8384
8419
|
break;
|
8385
8420
|
}
|
8386
8421
|
throw new Error("Request settings have not been set up");
|
8387
8422
|
case 2:
|
8388
8423
|
if (!(i != null && i[0])) {
|
8389
|
-
|
8424
|
+
_context81.next = 6;
|
8390
8425
|
break;
|
8391
8426
|
}
|
8392
8427
|
this.callApiWithImage(e, t, i);
|
8393
|
-
|
8428
|
+
_context81.next = 11;
|
8394
8429
|
break;
|
8395
8430
|
case 6:
|
8396
8431
|
if (this.requestSettings) {
|
8397
|
-
|
8432
|
+
_context81.next = 8;
|
8398
8433
|
break;
|
8399
8434
|
}
|
8400
8435
|
throw new Error("Request settings have not been set up");
|
@@ -8404,11 +8439,11 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8404
8439
|
w.request(this, r, e);
|
8405
8440
|
case 11:
|
8406
8441
|
case "end":
|
8407
|
-
return
|
8442
|
+
return _context81.stop();
|
8408
8443
|
}
|
8409
|
-
},
|
8444
|
+
}, _callee81, this);
|
8410
8445
|
}));
|
8411
|
-
function callServiceAPI(
|
8446
|
+
function callServiceAPI(_x147, _x148, _x149) {
|
8412
8447
|
return _callServiceAPI19.apply(this, arguments);
|
8413
8448
|
}
|
8414
8449
|
return callServiceAPI;
|
@@ -8416,17 +8451,17 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8416
8451
|
}, {
|
8417
8452
|
key: "extractResultData",
|
8418
8453
|
value: function () {
|
8419
|
-
var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8420
|
-
return _regeneratorRuntime().wrap(function
|
8421
|
-
while (1) switch (
|
8454
|
+
var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e) {
|
8455
|
+
return _regeneratorRuntime().wrap(function _callee82$(_context82) {
|
8456
|
+
while (1) switch (_context82.prev = _context82.next) {
|
8422
8457
|
case 0:
|
8423
8458
|
if (!e.error) {
|
8424
|
-
|
8459
|
+
_context82.next = 2;
|
8425
8460
|
break;
|
8426
8461
|
}
|
8427
8462
|
throw e.error.message;
|
8428
8463
|
case 2:
|
8429
|
-
return
|
8464
|
+
return _context82.abrupt("return", {
|
8430
8465
|
files: e.data.map(function (i) {
|
8431
8466
|
return i.url ? {
|
8432
8467
|
src: i.url,
|
@@ -8439,11 +8474,11 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8439
8474
|
});
|
8440
8475
|
case 3:
|
8441
8476
|
case "end":
|
8442
|
-
return
|
8477
|
+
return _context82.stop();
|
8443
8478
|
}
|
8444
|
-
},
|
8479
|
+
}, _callee82);
|
8445
8480
|
}));
|
8446
|
-
function extractResultData(
|
8481
|
+
function extractResultData(_x150) {
|
8447
8482
|
return _extractResultData22.apply(this, arguments);
|
8448
8483
|
}
|
8449
8484
|
return extractResultData;
|
@@ -8522,13 +8557,13 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8522
8557
|
}, {
|
8523
8558
|
key: "callServiceAPI",
|
8524
8559
|
value: function () {
|
8525
|
-
var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8560
|
+
var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee83(e, t) {
|
8526
8561
|
var i, n;
|
8527
|
-
return _regeneratorRuntime().wrap(function
|
8528
|
-
while (1) switch (
|
8562
|
+
return _regeneratorRuntime().wrap(function _callee83$(_context83) {
|
8563
|
+
while (1) switch (_context83.prev = _context83.next) {
|
8529
8564
|
case 0:
|
8530
8565
|
if (this.requestSettings) {
|
8531
|
-
|
8566
|
+
_context83.next = 2;
|
8532
8567
|
break;
|
8533
8568
|
}
|
8534
8569
|
throw new Error("Request settings have not been set up");
|
@@ -8537,11 +8572,11 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8537
8572
|
n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0, I.request(this, i, e)) : w.request(this, i, e);
|
8538
8573
|
case 4:
|
8539
8574
|
case "end":
|
8540
|
-
return
|
8575
|
+
return _context83.stop();
|
8541
8576
|
}
|
8542
|
-
},
|
8577
|
+
}, _callee83, this);
|
8543
8578
|
}));
|
8544
|
-
function callServiceAPI(
|
8579
|
+
function callServiceAPI(_x151, _x152) {
|
8545
8580
|
return _callServiceAPI20.apply(this, arguments);
|
8546
8581
|
}
|
8547
8582
|
return callServiceAPI;
|
@@ -8549,17 +8584,17 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8549
8584
|
}, {
|
8550
8585
|
key: "extractResultData",
|
8551
8586
|
value: function () {
|
8552
|
-
var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8553
|
-
return _regeneratorRuntime().wrap(function
|
8554
|
-
while (1) switch (
|
8587
|
+
var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee84(e, t, i) {
|
8588
|
+
return _regeneratorRuntime().wrap(function _callee84$(_context84) {
|
8589
|
+
while (1) switch (_context84.prev = _context84.next) {
|
8555
8590
|
case 0:
|
8556
8591
|
if (!e.error) {
|
8557
|
-
|
8592
|
+
_context84.next = 2;
|
8558
8593
|
break;
|
8559
8594
|
}
|
8560
8595
|
throw e.error.message;
|
8561
8596
|
case 2:
|
8562
|
-
return
|
8597
|
+
return _context84.abrupt("return", e.choices[0].delta ? {
|
8563
8598
|
text: e.choices[0].delta.content || ""
|
8564
8599
|
} : e.choices[0].message ? e.choices[0].message.tool_calls ? this.handleTools(e.choices[0].message, t, i) : {
|
8565
8600
|
text: e.choices[0].message.content
|
@@ -8568,11 +8603,11 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8568
8603
|
});
|
8569
8604
|
case 3:
|
8570
8605
|
case "end":
|
8571
|
-
return
|
8606
|
+
return _context84.stop();
|
8572
8607
|
}
|
8573
|
-
},
|
8608
|
+
}, _callee84, this);
|
8574
8609
|
}));
|
8575
|
-
function extractResultData(
|
8610
|
+
function extractResultData(_x153, _x154, _x155) {
|
8576
8611
|
return _extractResultData23.apply(this, arguments);
|
8577
8612
|
}
|
8578
8613
|
return extractResultData;
|
@@ -8580,13 +8615,13 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8580
8615
|
}, {
|
8581
8616
|
key: "handleTools",
|
8582
8617
|
value: function () {
|
8583
|
-
var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8618
|
+
var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee85(e, t, i) {
|
8584
8619
|
var a, n, r, o, l;
|
8585
|
-
return _regeneratorRuntime().wrap(function
|
8586
|
-
while (1) switch (
|
8620
|
+
return _regeneratorRuntime().wrap(function _callee85$(_context85) {
|
8621
|
+
while (1) switch (_context85.prev = _context85.next) {
|
8587
8622
|
case 0:
|
8588
8623
|
if (!(!e.tool_calls || !t || !i || !this._functionHandler)) {
|
8589
|
-
|
8624
|
+
_context85.next = 2;
|
8590
8625
|
break;
|
8591
8626
|
}
|
8592
8627
|
throw Error("Please define the `function_handler` property inside the [openAI](https://deepchat.dev/docs/directConnection/openAI#Chat) object.");
|
@@ -8598,22 +8633,22 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8598
8633
|
arguments: l["function"].arguments
|
8599
8634
|
};
|
8600
8635
|
});
|
8601
|
-
|
8636
|
+
_context85.next = 6;
|
8602
8637
|
return (a = this._functionHandler) == null ? void 0 : a.call(this, r);
|
8603
8638
|
case 6:
|
8604
|
-
o =
|
8639
|
+
o = _context85.sent;
|
8605
8640
|
if (!o.text) {
|
8606
|
-
|
8641
|
+
_context85.next = 9;
|
8607
8642
|
break;
|
8608
8643
|
}
|
8609
|
-
return
|
8644
|
+
return _context85.abrupt("return", {
|
8610
8645
|
text: o.text
|
8611
8646
|
});
|
8612
8647
|
case 9:
|
8613
8648
|
if (!(n.messages.push(e), Array.isArray(o) && !o.find(function (l) {
|
8614
8649
|
return typeof l != "string";
|
8615
8650
|
}) || r.length === o.length)) {
|
8616
|
-
|
8651
|
+
_context85.next = 17;
|
8617
8652
|
break;
|
8618
8653
|
}
|
8619
8654
|
o.forEach(function (c, d) {
|
@@ -8626,30 +8661,30 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8626
8661
|
content: c.response
|
8627
8662
|
});
|
8628
8663
|
}), delete n.tools, delete n.tool_choice;
|
8629
|
-
|
8664
|
+
_context85.next = 13;
|
8630
8665
|
return t == null ? void 0 : t(n).then(function (c) {
|
8631
8666
|
return E.processResponseByType(c);
|
8632
8667
|
});
|
8633
8668
|
case 13:
|
8634
|
-
l =
|
8669
|
+
l = _context85.sent;
|
8635
8670
|
if (!l.error) {
|
8636
|
-
|
8671
|
+
_context85.next = 16;
|
8637
8672
|
break;
|
8638
8673
|
}
|
8639
8674
|
throw l.error.message;
|
8640
8675
|
case 16:
|
8641
|
-
return
|
8676
|
+
return _context85.abrupt("return", {
|
8642
8677
|
text: l.choices[0].message.content || ""
|
8643
8678
|
});
|
8644
8679
|
case 17:
|
8645
8680
|
throw Error("Response object must either be {response: string}[] for each individual function or {text: string} for a direct response, see https://deepchat.dev/docs/directConnection/OpenAI#FunctionHandler.");
|
8646
8681
|
case 18:
|
8647
8682
|
case "end":
|
8648
|
-
return
|
8683
|
+
return _context85.stop();
|
8649
8684
|
}
|
8650
|
-
},
|
8685
|
+
}, _callee85, this);
|
8651
8686
|
}));
|
8652
|
-
function handleTools(
|
8687
|
+
function handleTools(_x156, _x157, _x158) {
|
8653
8688
|
return _handleTools2.apply(this, arguments);
|
8654
8689
|
}
|
8655
8690
|
return handleTools;
|
@@ -8715,13 +8750,13 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8715
8750
|
}, {
|
8716
8751
|
key: "callServiceAPI",
|
8717
8752
|
value: function () {
|
8718
|
-
var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8753
|
+
var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee86(e, t) {
|
8719
8754
|
var i;
|
8720
|
-
return _regeneratorRuntime().wrap(function
|
8721
|
-
while (1) switch (
|
8755
|
+
return _regeneratorRuntime().wrap(function _callee86$(_context86) {
|
8756
|
+
while (1) switch (_context86.prev = _context86.next) {
|
8722
8757
|
case 0:
|
8723
8758
|
if (this.requestSettings) {
|
8724
|
-
|
8759
|
+
_context86.next = 2;
|
8725
8760
|
break;
|
8726
8761
|
}
|
8727
8762
|
throw new Error("Request settings have not been set up");
|
@@ -8730,11 +8765,11 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8730
8765
|
w.request(this, i, e);
|
8731
8766
|
case 4:
|
8732
8767
|
case "end":
|
8733
|
-
return
|
8768
|
+
return _context86.stop();
|
8734
8769
|
}
|
8735
|
-
},
|
8770
|
+
}, _callee86, this);
|
8736
8771
|
}));
|
8737
|
-
function callServiceAPI(
|
8772
|
+
function callServiceAPI(_x159, _x160) {
|
8738
8773
|
return _callServiceAPI21.apply(this, arguments);
|
8739
8774
|
}
|
8740
8775
|
return callServiceAPI;
|
@@ -8742,26 +8777,26 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8742
8777
|
}, {
|
8743
8778
|
key: "extractResultData",
|
8744
8779
|
value: function () {
|
8745
|
-
var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8746
|
-
return _regeneratorRuntime().wrap(function
|
8747
|
-
while (1) switch (
|
8780
|
+
var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee87(e) {
|
8781
|
+
return _regeneratorRuntime().wrap(function _callee87$(_context87) {
|
8782
|
+
while (1) switch (_context87.prev = _context87.next) {
|
8748
8783
|
case 0:
|
8749
8784
|
if (!e.message) {
|
8750
|
-
|
8785
|
+
_context87.next = 2;
|
8751
8786
|
break;
|
8752
8787
|
}
|
8753
8788
|
throw e.message;
|
8754
8789
|
case 2:
|
8755
|
-
return
|
8790
|
+
return _context87.abrupt("return", {
|
8756
8791
|
text: e.text
|
8757
8792
|
});
|
8758
8793
|
case 3:
|
8759
8794
|
case "end":
|
8760
|
-
return
|
8795
|
+
return _context87.stop();
|
8761
8796
|
}
|
8762
|
-
},
|
8797
|
+
}, _callee87);
|
8763
8798
|
}));
|
8764
|
-
function extractResultData(
|
8799
|
+
function extractResultData(_x161) {
|
8765
8800
|
return _extractResultData24.apply(this, arguments);
|
8766
8801
|
}
|
8767
8802
|
return extractResultData;
|
@@ -8949,20 +8984,20 @@ var fe = /*#__PURE__*/function () {
|
|
8949
8984
|
}, {
|
8950
8985
|
key: "addNewImageMessage",
|
8951
8986
|
value: function () {
|
8952
|
-
var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8987
|
+
var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee88(e, t, i) {
|
8953
8988
|
var n, r;
|
8954
|
-
return _regeneratorRuntime().wrap(function
|
8955
|
-
while (1) switch (
|
8989
|
+
return _regeneratorRuntime().wrap(function _callee88$(_context88) {
|
8990
|
+
while (1) switch (_context88.prev = _context88.next) {
|
8956
8991
|
case 0:
|
8957
8992
|
n = fe.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
|
8958
8993
|
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), ne.addMessage(e, r, "image", i);
|
8959
8994
|
case 2:
|
8960
8995
|
case "end":
|
8961
|
-
return
|
8996
|
+
return _context88.stop();
|
8962
8997
|
}
|
8963
|
-
},
|
8998
|
+
}, _callee88);
|
8964
8999
|
}));
|
8965
|
-
function addNewImageMessage(
|
9000
|
+
function addNewImageMessage(_x162, _x163, _x164) {
|
8966
9001
|
return _addNewImageMessage.apply(this, arguments);
|
8967
9002
|
}
|
8968
9003
|
return addNewImageMessage;
|
@@ -9024,7 +9059,11 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9024
9059
|
o = t.demo;
|
9025
9060
|
_this38._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this38._onClearMessages = jt.onClearMessages.bind(_assertThisInitialized(_this38), e), _this38._onError = jt.onError.bind(_assertThisInitialized(_this38), e), _this38._displayLoadingMessage = me.getDisplayLoadingMessage(e, t), _this38._permittedErrorPrefixes = n, _this38.addSetupMessageIfNeeded(e, t), _this38.populateIntroPanel(i, r, e.introPanelStyle), _this38.addIntroductoryMessage(e, t), e.initialMessages && _this38.populateInitialMessages(e.initialMessages), _this38._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
9026
9061
|
return JSON.parse(JSON.stringify(_this38.messages));
|
9027
|
-
}, e.clearMessages = _this38.clearMessages.bind(_assertThisInitialized(_this38), t), e.refreshMessages = _this38.refreshTextMessages.bind(_assertThisInitialized(_this38)), e.scrollToBottom = Y.scrollToBottom.bind(_assertThisInitialized(_this38), _this38.elementRef),
|
9062
|
+
}, e.clearMessages = _this38.clearMessages.bind(_assertThisInitialized(_this38), t), e.refreshMessages = _this38.refreshTextMessages.bind(_assertThisInitialized(_this38)), e.scrollToBottom = Y.scrollToBottom.bind(_assertThisInitialized(_this38), _this38.elementRef), e._addMessage = function (c, d) {
|
9063
|
+
_this38.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
|
9064
|
+
sendUpdate: !!d
|
9065
|
+
}), !d);
|
9066
|
+
}, t.isWebModel() && t.setUpMessages(_assertThisInitialized(_this38)), o && _this38.prepareDemo(o), e.textToSpeech && Nt.processConfig(e.textToSpeech, function (c) {
|
9028
9067
|
_this38.textToSpeech = c;
|
9029
9068
|
});
|
9030
9069
|
return _this38;
|
@@ -9167,11 +9206,11 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9167
9206
|
}, {
|
9168
9207
|
key: "addMultipleFiles",
|
9169
9208
|
value: function () {
|
9170
|
-
var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
9171
|
-
return _regeneratorRuntime().wrap(function
|
9172
|
-
while (1) switch (
|
9209
|
+
var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee89(e) {
|
9210
|
+
return _regeneratorRuntime().wrap(function _callee89$(_context89) {
|
9211
|
+
while (1) switch (_context89.prev = _context89.next) {
|
9173
9212
|
case 0:
|
9174
|
-
return
|
9213
|
+
return _context89.abrupt("return", Promise.all((e || []).map(function (t) {
|
9175
9214
|
return new Promise(function (i) {
|
9176
9215
|
if (!t.type || t.type === "any") {
|
9177
9216
|
var n = t.file.name || ne.DEFAULT_FILE_NAME;
|
@@ -9194,11 +9233,11 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9194
9233
|
})));
|
9195
9234
|
case 1:
|
9196
9235
|
case "end":
|
9197
|
-
return
|
9236
|
+
return _context89.stop();
|
9198
9237
|
}
|
9199
|
-
},
|
9238
|
+
}, _callee89);
|
9200
9239
|
}));
|
9201
|
-
function addMultipleFiles(
|
9240
|
+
function addMultipleFiles(_x165) {
|
9202
9241
|
return _addMultipleFiles.apply(this, arguments);
|
9203
9242
|
}
|
9204
9243
|
return addMultipleFiles;
|
@@ -10045,33 +10084,33 @@ var wt = /*#__PURE__*/function () {
|
|
10045
10084
|
}, {
|
10046
10085
|
key: "completePlaceholders",
|
10047
10086
|
value: function () {
|
10048
|
-
var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10049
|
-
return _regeneratorRuntime().wrap(function
|
10050
|
-
while (1) switch (
|
10087
|
+
var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee91() {
|
10088
|
+
return _regeneratorRuntime().wrap(function _callee91$(_context91) {
|
10089
|
+
while (1) switch (_context91.prev = _context91.next) {
|
10051
10090
|
case 0:
|
10052
|
-
|
10091
|
+
_context91.next = 2;
|
10053
10092
|
return Promise.all(this._fileAttachmentsTypes.map( /*#__PURE__*/function () {
|
10054
|
-
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10093
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee90(e) {
|
10055
10094
|
var t;
|
10056
|
-
return _regeneratorRuntime().wrap(function
|
10057
|
-
while (1) switch (
|
10095
|
+
return _regeneratorRuntime().wrap(function _callee90$(_context90) {
|
10096
|
+
while (1) switch (_context90.prev = _context90.next) {
|
10058
10097
|
case 0:
|
10059
|
-
return
|
10098
|
+
return _context90.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
|
10060
10099
|
case 1:
|
10061
10100
|
case "end":
|
10062
|
-
return
|
10101
|
+
return _context90.stop();
|
10063
10102
|
}
|
10064
|
-
},
|
10103
|
+
}, _callee90);
|
10065
10104
|
}));
|
10066
|
-
return function (
|
10105
|
+
return function (_x166) {
|
10067
10106
|
return _ref11.apply(this, arguments);
|
10068
10107
|
};
|
10069
10108
|
}()));
|
10070
10109
|
case 2:
|
10071
10110
|
case "end":
|
10072
|
-
return
|
10111
|
+
return _context91.stop();
|
10073
10112
|
}
|
10074
|
-
},
|
10113
|
+
}, _callee91, this);
|
10075
10114
|
}));
|
10076
10115
|
function completePlaceholders() {
|
10077
10116
|
return _completePlaceholders.apply(this, arguments);
|
@@ -10359,26 +10398,26 @@ var Me = /*#__PURE__*/function () {
|
|
10359
10398
|
}, {
|
10360
10399
|
key: "useValidationFunc",
|
10361
10400
|
value: function () {
|
10362
|
-
var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10401
|
+
var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee92(e, t, i, n) {
|
10363
10402
|
var r, o, a, l;
|
10364
|
-
return _regeneratorRuntime().wrap(function
|
10365
|
-
while (1) switch (
|
10403
|
+
return _regeneratorRuntime().wrap(function _callee92$(_context92) {
|
10404
|
+
while (1) switch (_context92.prev = _context92.next) {
|
10366
10405
|
case 0:
|
10367
10406
|
r = t.inputElementRef, o = r.classList.contains("text-input-placeholder") ? "" : r.textContent;
|
10368
|
-
|
10407
|
+
_context92.next = 3;
|
10369
10408
|
return i.completePlaceholders();
|
10370
10409
|
case 3:
|
10371
10410
|
a = i.getAllFileData(), l = a == null ? void 0 : a.map(function (c) {
|
10372
10411
|
return c.file;
|
10373
10412
|
});
|
10374
|
-
return
|
10413
|
+
return _context92.abrupt("return", Me.validate(e, n, o, l));
|
10375
10414
|
case 5:
|
10376
10415
|
case "end":
|
10377
|
-
return
|
10416
|
+
return _context92.stop();
|
10378
10417
|
}
|
10379
|
-
},
|
10418
|
+
}, _callee92);
|
10380
10419
|
}));
|
10381
|
-
function useValidationFunc(
|
10420
|
+
function useValidationFunc(_x167, _x168, _x169, _x170) {
|
10382
10421
|
return _useValidationFunc.apply(this, arguments);
|
10383
10422
|
}
|
10384
10423
|
return useValidationFunc;
|
@@ -10386,22 +10425,22 @@ var Me = /*#__PURE__*/function () {
|
|
10386
10425
|
}, {
|
10387
10426
|
key: "useValidationFuncProgrammatic",
|
10388
10427
|
value: function () {
|
10389
|
-
var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10428
|
+
var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee93(e, t, i) {
|
10390
10429
|
var r, n;
|
10391
|
-
return _regeneratorRuntime().wrap(function
|
10392
|
-
while (1) switch (
|
10430
|
+
return _regeneratorRuntime().wrap(function _callee93$(_context93) {
|
10431
|
+
while (1) switch (_context93.prev = _context93.next) {
|
10393
10432
|
case 0:
|
10394
10433
|
n = (r = t.files) == null ? void 0 : r.map(function (o) {
|
10395
10434
|
return o.file;
|
10396
10435
|
});
|
10397
|
-
return
|
10436
|
+
return _context93.abrupt("return", Me.validate(e, i, t.text, n, !0));
|
10398
10437
|
case 2:
|
10399
10438
|
case "end":
|
10400
|
-
return
|
10439
|
+
return _context93.stop();
|
10401
10440
|
}
|
10402
|
-
},
|
10441
|
+
}, _callee93);
|
10403
10442
|
}));
|
10404
|
-
function useValidationFuncProgrammatic(
|
10443
|
+
function useValidationFuncProgrammatic(_x171, _x172, _x173) {
|
10405
10444
|
return _useValidationFuncProgrammatic.apply(this, arguments);
|
10406
10445
|
}
|
10407
10446
|
return useValidationFuncProgrammatic;
|
@@ -10417,26 +10456,26 @@ var Me = /*#__PURE__*/function () {
|
|
10417
10456
|
value: function attach(e, t, i, n, r) {
|
10418
10457
|
var o = e.validateInput || ke.processValidateInput(e);
|
10419
10458
|
e._validationHandler = /*#__PURE__*/function () {
|
10420
|
-
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10459
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee94(a) {
|
10421
10460
|
var l;
|
10422
|
-
return _regeneratorRuntime().wrap(function
|
10423
|
-
while (1) switch (
|
10461
|
+
return _regeneratorRuntime().wrap(function _callee94$(_context94) {
|
10462
|
+
while (1) switch (_context94.prev = _context94.next) {
|
10424
10463
|
case 0:
|
10425
10464
|
if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !Me.validateWebsocket(t, r))) {
|
10426
|
-
|
10465
|
+
_context94.next = 2;
|
10427
10466
|
break;
|
10428
10467
|
}
|
10429
|
-
return
|
10468
|
+
return _context94.abrupt("return", !1);
|
10430
10469
|
case 2:
|
10431
10470
|
l = o || t.canSendMessage;
|
10432
|
-
return
|
10471
|
+
return _context94.abrupt("return", l ? a ? Me.useValidationFuncProgrammatic(l, a, r) : Me.useValidationFunc(l, i, n, r) : null);
|
10433
10472
|
case 4:
|
10434
10473
|
case "end":
|
10435
|
-
return
|
10474
|
+
return _context94.stop();
|
10436
10475
|
}
|
10437
|
-
},
|
10476
|
+
}, _callee94);
|
10438
10477
|
}));
|
10439
|
-
return function (
|
10478
|
+
return function (_x174) {
|
10440
10479
|
return _ref12.apply(this, arguments);
|
10441
10480
|
};
|
10442
10481
|
}();
|
@@ -11392,26 +11431,26 @@ var $t = /*#__PURE__*/function () {
|
|
11392
11431
|
}, {
|
11393
11432
|
key: "getNewSpeechConfig",
|
11394
11433
|
value: function () {
|
11395
|
-
var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11396
|
-
return _regeneratorRuntime().wrap(function
|
11397
|
-
while (1) switch (
|
11434
|
+
var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee95(e, t) {
|
11435
|
+
return _regeneratorRuntime().wrap(function _callee95$(_context95) {
|
11436
|
+
while (1) switch (_context95.prev = _context95.next) {
|
11398
11437
|
case 0:
|
11399
11438
|
if (!t.region) {
|
11400
|
-
|
11439
|
+
_context95.next = 2;
|
11401
11440
|
break;
|
11402
11441
|
}
|
11403
|
-
return
|
11442
|
+
return _context95.abrupt("return", t.subscriptionKey ? e.fromSubscription(t.subscriptionKey.trim(), t.region.trim()) : t.token ? e.fromAuthorizationToken(t.token.trim(), t.region.trim()) : t.retrieveToken ? t.retrieveToken().then(function (i) {
|
11404
11443
|
return t.region ? e.fromAuthorizationToken((i == null ? void 0 : i.trim()) || "", t.region.trim()) : null;
|
11405
11444
|
})["catch"](function (i) {
|
11406
11445
|
return console.error(i), null;
|
11407
11446
|
}) : null);
|
11408
11447
|
case 2:
|
11409
11448
|
case "end":
|
11410
|
-
return
|
11449
|
+
return _context95.stop();
|
11411
11450
|
}
|
11412
|
-
},
|
11451
|
+
}, _callee95);
|
11413
11452
|
}));
|
11414
|
-
function getNewSpeechConfig(
|
11453
|
+
function getNewSpeechConfig(_x175, _x176) {
|
11415
11454
|
return _getNewSpeechConfig.apply(this, arguments);
|
11416
11455
|
}
|
11417
11456
|
return getNewSpeechConfig;
|
@@ -11424,23 +11463,23 @@ var $t = /*#__PURE__*/function () {
|
|
11424
11463
|
}, {
|
11425
11464
|
key: "get",
|
11426
11465
|
value: function () {
|
11427
|
-
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11466
|
+
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(e, t) {
|
11428
11467
|
var i;
|
11429
|
-
return _regeneratorRuntime().wrap(function
|
11430
|
-
while (1) switch (
|
11468
|
+
return _regeneratorRuntime().wrap(function _callee96$(_context96) {
|
11469
|
+
while (1) switch (_context96.prev = _context96.next) {
|
11431
11470
|
case 0:
|
11432
|
-
|
11471
|
+
_context96.next = 2;
|
11433
11472
|
return $t.getNewSpeechConfig(e, t);
|
11434
11473
|
case 2:
|
11435
|
-
i =
|
11436
|
-
return
|
11474
|
+
i = _context96.sent;
|
11475
|
+
return _context96.abrupt("return", (i && $t.process(i, t), i));
|
11437
11476
|
case 4:
|
11438
11477
|
case "end":
|
11439
|
-
return
|
11478
|
+
return _context96.stop();
|
11440
11479
|
}
|
11441
|
-
},
|
11480
|
+
}, _callee96);
|
11442
11481
|
}));
|
11443
|
-
function get(
|
11482
|
+
function get(_x177, _x178) {
|
11444
11483
|
return _get.apply(this, arguments);
|
11445
11484
|
}
|
11446
11485
|
return get;
|
@@ -11530,28 +11569,28 @@ var Yt = /*#__PURE__*/function (_va$Speech) {
|
|
11530
11569
|
}, {
|
11531
11570
|
key: "startAsync",
|
11532
11571
|
value: function () {
|
11533
|
-
var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11572
|
+
var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee97(e) {
|
11534
11573
|
var t;
|
11535
|
-
return _regeneratorRuntime().wrap(function
|
11536
|
-
while (1) switch (
|
11574
|
+
return _regeneratorRuntime().wrap(function _callee97$(_context97) {
|
11575
|
+
while (1) switch (_context97.prev = _context97.next) {
|
11537
11576
|
case 0:
|
11538
|
-
|
11539
|
-
if (!
|
11540
|
-
|
11577
|
+
_context97.t0 = this.validate(e);
|
11578
|
+
if (!_context97.t0) {
|
11579
|
+
_context97.next = 6;
|
11541
11580
|
break;
|
11542
11581
|
}
|
11543
|
-
|
11582
|
+
_context97.next = 4;
|
11544
11583
|
return this.instantiateService(e);
|
11545
11584
|
case 4:
|
11546
11585
|
this._translations = e == null ? void 0 : e.translations;
|
11547
11586
|
(t = this._service) === null || t === void 0 || t.startContinuousRecognitionAsync(function () {}, this.error);
|
11548
11587
|
case 6:
|
11549
11588
|
case "end":
|
11550
|
-
return
|
11589
|
+
return _context97.stop();
|
11551
11590
|
}
|
11552
|
-
},
|
11591
|
+
}, _callee97, this);
|
11553
11592
|
}));
|
11554
|
-
function startAsync(
|
11593
|
+
function startAsync(_x179) {
|
11555
11594
|
return _startAsync.apply(this, arguments);
|
11556
11595
|
}
|
11557
11596
|
return startAsync;
|
@@ -11564,28 +11603,28 @@ var Yt = /*#__PURE__*/function (_va$Speech) {
|
|
11564
11603
|
}, {
|
11565
11604
|
key: "instantiateService",
|
11566
11605
|
value: function () {
|
11567
|
-
var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11606
|
+
var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee98(e) {
|
11568
11607
|
var t, i, n, r;
|
11569
|
-
return _regeneratorRuntime().wrap(function
|
11570
|
-
while (1) switch (
|
11608
|
+
return _regeneratorRuntime().wrap(function _callee98$(_context98) {
|
11609
|
+
while (1) switch (_context98.prev = _context98.next) {
|
11571
11610
|
case 0:
|
11572
11611
|
t = Yt.getAPI();
|
11573
11612
|
i = t.AudioConfig.fromDefaultMicrophoneInput();
|
11574
|
-
|
11613
|
+
_context98.next = 4;
|
11575
11614
|
return Dn.AzureSpeechConfig.get(t.SpeechConfig, e);
|
11576
11615
|
case 4:
|
11577
|
-
n =
|
11616
|
+
n = _context98.sent;
|
11578
11617
|
if (n) {
|
11579
11618
|
r = new t.SpeechRecognizer(n, i);
|
11580
11619
|
this.setEvents(r), this._service = r, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
|
11581
11620
|
} else this.error("Unable to contact Azure server");
|
11582
11621
|
case 6:
|
11583
11622
|
case "end":
|
11584
|
-
return
|
11623
|
+
return _context98.stop();
|
11585
11624
|
}
|
11586
|
-
},
|
11625
|
+
}, _callee98, this);
|
11587
11626
|
}));
|
11588
|
-
function instantiateService(
|
11627
|
+
function instantiateService(_x180) {
|
11589
11628
|
return _instantiateService.apply(this, arguments);
|
11590
11629
|
}
|
11591
11630
|
return instantiateService;
|
@@ -12027,12 +12066,12 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12027
12066
|
}, {
|
12028
12067
|
key: "submitFromInput",
|
12029
12068
|
value: function () {
|
12030
|
-
var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12069
|
+
var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee99() {
|
12031
12070
|
var t, e, _i18;
|
12032
|
-
return _regeneratorRuntime().wrap(function
|
12033
|
-
while (1) switch (
|
12071
|
+
return _regeneratorRuntime().wrap(function _callee99$(_context99) {
|
12072
|
+
while (1) switch (_context99.prev = _context99.next) {
|
12034
12073
|
case 0:
|
12035
|
-
|
12074
|
+
_context99.next = 2;
|
12036
12075
|
return this._fileAttachments.completePlaceholders();
|
12037
12076
|
case 2:
|
12038
12077
|
e = this._fileAttachments.getAllFileData();
|
@@ -12048,9 +12087,9 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12048
12087
|
}
|
12049
12088
|
case 4:
|
12050
12089
|
case "end":
|
12051
|
-
return
|
12090
|
+
return _context99.stop();
|
12052
12091
|
}
|
12053
|
-
},
|
12092
|
+
}, _callee99, this);
|
12054
12093
|
}));
|
12055
12094
|
function submitFromInput() {
|
12056
12095
|
return _submitFromInput.apply(this, arguments);
|
@@ -12060,11 +12099,11 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12060
12099
|
}, {
|
12061
12100
|
key: "programmaticSubmit",
|
12062
12101
|
value: function () {
|
12063
|
-
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12102
|
+
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee100(e) {
|
12064
12103
|
var _this63 = this;
|
12065
12104
|
var t;
|
12066
|
-
return _regeneratorRuntime().wrap(function
|
12067
|
-
while (1) switch (
|
12105
|
+
return _regeneratorRuntime().wrap(function _callee100$(_context100) {
|
12106
|
+
while (1) switch (_context100.prev = _context100.next) {
|
12068
12107
|
case 0:
|
12069
12108
|
typeof e == "string" && (e = ke.processSubmitUserMessage(e));
|
12070
12109
|
t = {
|
@@ -12080,11 +12119,11 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12080
12119
|
});
|
12081
12120
|
case 3:
|
12082
12121
|
case "end":
|
12083
|
-
return
|
12122
|
+
return _context100.stop();
|
12084
12123
|
}
|
12085
|
-
},
|
12124
|
+
}, _callee100);
|
12086
12125
|
}));
|
12087
|
-
function programmaticSubmit(
|
12126
|
+
function programmaticSubmit(_x181) {
|
12088
12127
|
return _programmaticSubmit.apply(this, arguments);
|
12089
12128
|
}
|
12090
12129
|
return programmaticSubmit;
|
@@ -12092,31 +12131,31 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12092
12131
|
}, {
|
12093
12132
|
key: "attemptSubmit",
|
12094
12133
|
value: function () {
|
12095
|
-
var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12134
|
+
var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee101(e) {
|
12096
12135
|
var t,
|
12097
12136
|
r,
|
12098
12137
|
o,
|
12099
12138
|
a,
|
12100
12139
|
i,
|
12101
12140
|
n,
|
12102
|
-
|
12103
|
-
return _regeneratorRuntime().wrap(function
|
12104
|
-
while (1) switch (
|
12141
|
+
_args101 = arguments;
|
12142
|
+
return _regeneratorRuntime().wrap(function _callee101$(_context101) {
|
12143
|
+
while (1) switch (_context101.prev = _context101.next) {
|
12105
12144
|
case 0:
|
12106
|
-
t =
|
12107
|
-
|
12145
|
+
t = _args101.length > 1 && _args101[1] !== undefined ? _args101[1] : !1;
|
12146
|
+
_context101.next = 3;
|
12108
12147
|
return (r = this._validationHandler) == null ? void 0 : r.call(this, t ? e : void 0);
|
12109
12148
|
case 3:
|
12110
|
-
|
12111
|
-
|
12112
|
-
if (!(
|
12113
|
-
|
12149
|
+
_context101.t0 = _context101.sent;
|
12150
|
+
_context101.t1 = !1;
|
12151
|
+
if (!(_context101.t0 === _context101.t1)) {
|
12152
|
+
_context101.next = 7;
|
12114
12153
|
break;
|
12115
12154
|
}
|
12116
|
-
return
|
12155
|
+
return _context101.abrupt("return");
|
12117
12156
|
case 7:
|
12118
12157
|
this.changeToLoadingIcon();
|
12119
|
-
|
12158
|
+
_context101.next = 10;
|
12120
12159
|
return this.addNewMessage(e);
|
12121
12160
|
case 10:
|
12122
12161
|
this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
|
@@ -12127,17 +12166,17 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12127
12166
|
text: e.text === "" ? void 0 : e.text,
|
12128
12167
|
files: i
|
12129
12168
|
};
|
12130
|
-
|
12169
|
+
_context101.next = 15;
|
12131
12170
|
return this._serviceIO.callAPI(n, this._messages);
|
12132
12171
|
case 15:
|
12133
12172
|
(a = this._fileAttachments) == null || a.removeAllFiles();
|
12134
12173
|
case 16:
|
12135
12174
|
case "end":
|
12136
|
-
return
|
12175
|
+
return _context101.stop();
|
12137
12176
|
}
|
12138
|
-
},
|
12177
|
+
}, _callee101, this);
|
12139
12178
|
}));
|
12140
|
-
function attemptSubmit(
|
12179
|
+
function attemptSubmit(_x182) {
|
12141
12180
|
return _attemptSubmit.apply(this, arguments);
|
12142
12181
|
}
|
12143
12182
|
return attemptSubmit;
|
@@ -12145,35 +12184,35 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12145
12184
|
}, {
|
12146
12185
|
key: "addNewMessage",
|
12147
12186
|
value: function () {
|
12148
|
-
var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12187
|
+
var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee102(_ref13) {
|
12149
12188
|
var e, t, i;
|
12150
|
-
return _regeneratorRuntime().wrap(function
|
12151
|
-
while (1) switch (
|
12189
|
+
return _regeneratorRuntime().wrap(function _callee102$(_context102) {
|
12190
|
+
while (1) switch (_context102.prev = _context102.next) {
|
12152
12191
|
case 0:
|
12153
12192
|
e = _ref13.text, t = _ref13.files;
|
12154
12193
|
i = {
|
12155
12194
|
role: v.USER_ROLE
|
12156
12195
|
};
|
12157
12196
|
e && (i.text = e);
|
12158
|
-
|
12159
|
-
if (!
|
12160
|
-
|
12197
|
+
_context102.t0 = t;
|
12198
|
+
if (!_context102.t0) {
|
12199
|
+
_context102.next = 8;
|
12161
12200
|
break;
|
12162
12201
|
}
|
12163
|
-
|
12202
|
+
_context102.next = 7;
|
12164
12203
|
return this._messages.addMultipleFiles(t);
|
12165
12204
|
case 7:
|
12166
|
-
i.files =
|
12205
|
+
i.files = _context102.sent;
|
12167
12206
|
case 8:
|
12168
12207
|
this._serviceIO.sessionId && (i._sessionId = this._serviceIO.sessionId);
|
12169
12208
|
Object.keys(i).length > 0 && this._messages.addNewMessage(i);
|
12170
12209
|
case 10:
|
12171
12210
|
case "end":
|
12172
|
-
return
|
12211
|
+
return _context102.stop();
|
12173
12212
|
}
|
12174
|
-
},
|
12213
|
+
}, _callee102, this);
|
12175
12214
|
}));
|
12176
|
-
function addNewMessage(
|
12215
|
+
function addNewMessage(_x183) {
|
12177
12216
|
return _addNewMessage.apply(this, arguments);
|
12178
12217
|
}
|
12179
12218
|
return addNewMessage;
|
@@ -12530,7 +12569,9 @@ var b = /*#__PURE__*/function (_vo) {
|
|
12530
12569
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
12531
12570
|
}, _this69.focusInput = function () {
|
12532
12571
|
return Qt.focusFromParentElement(_this69._elementRef);
|
12533
|
-
}, _this69.refreshMessages = function () {}, _this69.clearMessages = function () {}, _this69.scrollToBottom = function () {}, _this69.disableSubmitButton = function () {}, _this69._hasBeenRendered = !1, _this69._auxiliaryStyleApplied = !1,
|
12572
|
+
}, _this69.refreshMessages = function () {}, _this69.clearMessages = function () {}, _this69.scrollToBottom = function () {}, _this69.disableSubmitButton = function () {}, _this69._hasBeenRendered = !1, _this69._auxiliaryStyleApplied = !1, _this69._addMessage = function () {
|
12573
|
+
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
12574
|
+
}, Vo.appendStyleSheetToHead(), _this69._elementRef = document.createElement("div"), _this69._elementRef.id = "container", _this69.attachShadow({
|
12534
12575
|
mode: "open"
|
12535
12576
|
}).appendChild(_this69._elementRef), Ei.apply(ka, _this69.shadowRoot), setTimeout(function () {
|
12536
12577
|
_this69._hasBeenRendered || _this69.onRender();
|