@botpress/cognitive 0.1.37 → 0.1.39
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/.turbo/turbo-build.log +7 -7
- package/dist/index.cjs +164 -179
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +10 -2
- package/dist/index.mjs +129 -144
- package/dist/index.mjs.map +2 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -32,9 +32,8 @@ var require_options = __commonJS({
|
|
|
32
32
|
__assign = Object.assign || function(t) {
|
|
33
33
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
34
34
|
s = arguments[i];
|
|
35
|
-
for (var p in s)
|
|
36
|
-
|
|
37
|
-
t[p] = s[p];
|
|
35
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
36
|
+
t[p] = s[p];
|
|
38
37
|
}
|
|
39
38
|
return t;
|
|
40
39
|
};
|
|
@@ -116,7 +115,7 @@ var require_delay_base = __commonJS({
|
|
|
116
115
|
var jitter_factory_1 = require_jitter_factory();
|
|
117
116
|
var Delay = (
|
|
118
117
|
/** @class */
|
|
119
|
-
function() {
|
|
118
|
+
(function() {
|
|
120
119
|
function Delay2(options) {
|
|
121
120
|
this.options = options;
|
|
122
121
|
this.attempt = 0;
|
|
@@ -157,7 +156,7 @@ var require_delay_base = __commonJS({
|
|
|
157
156
|
configurable: true
|
|
158
157
|
});
|
|
159
158
|
return Delay2;
|
|
160
|
-
}()
|
|
159
|
+
})()
|
|
161
160
|
);
|
|
162
161
|
exports.Delay = Delay;
|
|
163
162
|
}
|
|
@@ -167,14 +166,12 @@ var require_delay_base = __commonJS({
|
|
|
167
166
|
var require_skip_first_delay = __commonJS({
|
|
168
167
|
"../../node_modules/.pnpm/exponential-backoff@3.1.1/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js"(exports) {
|
|
169
168
|
"use strict";
|
|
170
|
-
var __extends = exports && exports.__extends || function() {
|
|
169
|
+
var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
|
|
171
170
|
var extendStatics = function(d, b) {
|
|
172
171
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
173
172
|
d2.__proto__ = b2;
|
|
174
173
|
} || function(d2, b2) {
|
|
175
|
-
for (var p in b2)
|
|
176
|
-
if (b2.hasOwnProperty(p))
|
|
177
|
-
d2[p] = b2[p];
|
|
174
|
+
for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p];
|
|
178
175
|
};
|
|
179
176
|
return extendStatics(d, b);
|
|
180
177
|
};
|
|
@@ -185,7 +182,7 @@ var require_skip_first_delay = __commonJS({
|
|
|
185
182
|
}
|
|
186
183
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
187
184
|
};
|
|
188
|
-
}();
|
|
185
|
+
})();
|
|
189
186
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
190
187
|
function adopt(value) {
|
|
191
188
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -215,8 +212,7 @@ var require_skip_first_delay = __commonJS({
|
|
|
215
212
|
};
|
|
216
213
|
var __generator = exports && exports.__generator || function(thisArg, body) {
|
|
217
214
|
var _ = { label: 0, sent: function() {
|
|
218
|
-
if (t[0] & 1)
|
|
219
|
-
throw t[1];
|
|
215
|
+
if (t[0] & 1) throw t[1];
|
|
220
216
|
return t[1];
|
|
221
217
|
}, trys: [], ops: [] }, f, y, t, g;
|
|
222
218
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
@@ -228,64 +224,58 @@ var require_skip_first_delay = __commonJS({
|
|
|
228
224
|
};
|
|
229
225
|
}
|
|
230
226
|
function step(op) {
|
|
231
|
-
if (f)
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
227
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
228
|
+
while (_) try {
|
|
229
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
230
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
231
|
+
switch (op[0]) {
|
|
232
|
+
case 0:
|
|
233
|
+
case 1:
|
|
234
|
+
t = op;
|
|
235
|
+
break;
|
|
236
|
+
case 4:
|
|
237
|
+
_.label++;
|
|
238
|
+
return { value: op[1], done: false };
|
|
239
|
+
case 5:
|
|
240
|
+
_.label++;
|
|
241
|
+
y = op[1];
|
|
242
|
+
op = [0];
|
|
243
|
+
continue;
|
|
244
|
+
case 7:
|
|
245
|
+
op = _.ops.pop();
|
|
246
|
+
_.trys.pop();
|
|
247
|
+
continue;
|
|
248
|
+
default:
|
|
249
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
250
|
+
_ = 0;
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
254
|
+
_.label = op[1];
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
258
|
+
_.label = t[1];
|
|
242
259
|
t = op;
|
|
243
260
|
break;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
op = _.ops.pop();
|
|
254
|
-
_.trys.pop();
|
|
255
|
-
continue;
|
|
256
|
-
default:
|
|
257
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
258
|
-
_ = 0;
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
262
|
-
_.label = op[1];
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
265
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
266
|
-
_.label = t[1];
|
|
267
|
-
t = op;
|
|
268
|
-
break;
|
|
269
|
-
}
|
|
270
|
-
if (t && _.label < t[2]) {
|
|
271
|
-
_.label = t[2];
|
|
272
|
-
_.ops.push(op);
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
if (t[2])
|
|
276
|
-
_.ops.pop();
|
|
277
|
-
_.trys.pop();
|
|
278
|
-
continue;
|
|
279
|
-
}
|
|
280
|
-
op = body.call(thisArg, _);
|
|
281
|
-
} catch (e) {
|
|
282
|
-
op = [6, e];
|
|
283
|
-
y = 0;
|
|
284
|
-
} finally {
|
|
285
|
-
f = t = 0;
|
|
261
|
+
}
|
|
262
|
+
if (t && _.label < t[2]) {
|
|
263
|
+
_.label = t[2];
|
|
264
|
+
_.ops.push(op);
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
if (t[2]) _.ops.pop();
|
|
268
|
+
_.trys.pop();
|
|
269
|
+
continue;
|
|
286
270
|
}
|
|
287
|
-
|
|
288
|
-
|
|
271
|
+
op = body.call(thisArg, _);
|
|
272
|
+
} catch (e) {
|
|
273
|
+
op = [6, e];
|
|
274
|
+
y = 0;
|
|
275
|
+
} finally {
|
|
276
|
+
f = t = 0;
|
|
277
|
+
}
|
|
278
|
+
if (op[0] & 5) throw op[1];
|
|
289
279
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
290
280
|
}
|
|
291
281
|
};
|
|
@@ -293,7 +283,7 @@ var require_skip_first_delay = __commonJS({
|
|
|
293
283
|
var delay_base_1 = require_delay_base();
|
|
294
284
|
var SkipFirstDelay = (
|
|
295
285
|
/** @class */
|
|
296
|
-
function(_super) {
|
|
286
|
+
(function(_super) {
|
|
297
287
|
__extends(SkipFirstDelay2, _super);
|
|
298
288
|
function SkipFirstDelay2() {
|
|
299
289
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -320,7 +310,7 @@ var require_skip_first_delay = __commonJS({
|
|
|
320
310
|
configurable: true
|
|
321
311
|
});
|
|
322
312
|
return SkipFirstDelay2;
|
|
323
|
-
}(delay_base_1.Delay)
|
|
313
|
+
})(delay_base_1.Delay)
|
|
324
314
|
);
|
|
325
315
|
exports.SkipFirstDelay = SkipFirstDelay;
|
|
326
316
|
}
|
|
@@ -330,14 +320,12 @@ var require_skip_first_delay = __commonJS({
|
|
|
330
320
|
var require_always_delay = __commonJS({
|
|
331
321
|
"../../node_modules/.pnpm/exponential-backoff@3.1.1/node_modules/exponential-backoff/dist/delay/always/always.delay.js"(exports) {
|
|
332
322
|
"use strict";
|
|
333
|
-
var __extends = exports && exports.__extends || function() {
|
|
323
|
+
var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
|
|
334
324
|
var extendStatics = function(d, b) {
|
|
335
325
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
336
326
|
d2.__proto__ = b2;
|
|
337
327
|
} || function(d2, b2) {
|
|
338
|
-
for (var p in b2)
|
|
339
|
-
if (b2.hasOwnProperty(p))
|
|
340
|
-
d2[p] = b2[p];
|
|
328
|
+
for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p];
|
|
341
329
|
};
|
|
342
330
|
return extendStatics(d, b);
|
|
343
331
|
};
|
|
@@ -348,18 +336,18 @@ var require_always_delay = __commonJS({
|
|
|
348
336
|
}
|
|
349
337
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
350
338
|
};
|
|
351
|
-
}();
|
|
339
|
+
})();
|
|
352
340
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
353
341
|
var delay_base_1 = require_delay_base();
|
|
354
342
|
var AlwaysDelay = (
|
|
355
343
|
/** @class */
|
|
356
|
-
function(_super) {
|
|
344
|
+
(function(_super) {
|
|
357
345
|
__extends(AlwaysDelay2, _super);
|
|
358
346
|
function AlwaysDelay2() {
|
|
359
347
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
360
348
|
}
|
|
361
349
|
return AlwaysDelay2;
|
|
362
|
-
}(delay_base_1.Delay)
|
|
350
|
+
})(delay_base_1.Delay)
|
|
363
351
|
);
|
|
364
352
|
exports.AlwaysDelay = AlwaysDelay;
|
|
365
353
|
}
|
|
@@ -420,8 +408,7 @@ var require_backoff = __commonJS({
|
|
|
420
408
|
};
|
|
421
409
|
var __generator = exports && exports.__generator || function(thisArg, body) {
|
|
422
410
|
var _ = { label: 0, sent: function() {
|
|
423
|
-
if (t[0] & 1)
|
|
424
|
-
throw t[1];
|
|
411
|
+
if (t[0] & 1) throw t[1];
|
|
425
412
|
return t[1];
|
|
426
413
|
}, trys: [], ops: [] }, f, y, t, g;
|
|
427
414
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
@@ -433,64 +420,58 @@ var require_backoff = __commonJS({
|
|
|
433
420
|
};
|
|
434
421
|
}
|
|
435
422
|
function step(op) {
|
|
436
|
-
if (f)
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
423
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
424
|
+
while (_) try {
|
|
425
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
426
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
427
|
+
switch (op[0]) {
|
|
428
|
+
case 0:
|
|
429
|
+
case 1:
|
|
430
|
+
t = op;
|
|
431
|
+
break;
|
|
432
|
+
case 4:
|
|
433
|
+
_.label++;
|
|
434
|
+
return { value: op[1], done: false };
|
|
435
|
+
case 5:
|
|
436
|
+
_.label++;
|
|
437
|
+
y = op[1];
|
|
438
|
+
op = [0];
|
|
439
|
+
continue;
|
|
440
|
+
case 7:
|
|
441
|
+
op = _.ops.pop();
|
|
442
|
+
_.trys.pop();
|
|
443
|
+
continue;
|
|
444
|
+
default:
|
|
445
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
446
|
+
_ = 0;
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
450
|
+
_.label = op[1];
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
454
|
+
_.label = t[1];
|
|
447
455
|
t = op;
|
|
448
456
|
break;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
op = _.ops.pop();
|
|
459
|
-
_.trys.pop();
|
|
460
|
-
continue;
|
|
461
|
-
default:
|
|
462
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
463
|
-
_ = 0;
|
|
464
|
-
continue;
|
|
465
|
-
}
|
|
466
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
467
|
-
_.label = op[1];
|
|
468
|
-
break;
|
|
469
|
-
}
|
|
470
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
471
|
-
_.label = t[1];
|
|
472
|
-
t = op;
|
|
473
|
-
break;
|
|
474
|
-
}
|
|
475
|
-
if (t && _.label < t[2]) {
|
|
476
|
-
_.label = t[2];
|
|
477
|
-
_.ops.push(op);
|
|
478
|
-
break;
|
|
479
|
-
}
|
|
480
|
-
if (t[2])
|
|
481
|
-
_.ops.pop();
|
|
482
|
-
_.trys.pop();
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
op = body.call(thisArg, _);
|
|
486
|
-
} catch (e) {
|
|
487
|
-
op = [6, e];
|
|
488
|
-
y = 0;
|
|
489
|
-
} finally {
|
|
490
|
-
f = t = 0;
|
|
457
|
+
}
|
|
458
|
+
if (t && _.label < t[2]) {
|
|
459
|
+
_.label = t[2];
|
|
460
|
+
_.ops.push(op);
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
if (t[2]) _.ops.pop();
|
|
464
|
+
_.trys.pop();
|
|
465
|
+
continue;
|
|
491
466
|
}
|
|
492
|
-
|
|
493
|
-
|
|
467
|
+
op = body.call(thisArg, _);
|
|
468
|
+
} catch (e) {
|
|
469
|
+
op = [6, e];
|
|
470
|
+
y = 0;
|
|
471
|
+
} finally {
|
|
472
|
+
f = t = 0;
|
|
473
|
+
}
|
|
474
|
+
if (op[0] & 5) throw op[1];
|
|
494
475
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
495
476
|
}
|
|
496
477
|
};
|
|
@@ -518,7 +499,7 @@ var require_backoff = __commonJS({
|
|
|
518
499
|
exports.backOff = backOff3;
|
|
519
500
|
var BackOff = (
|
|
520
501
|
/** @class */
|
|
521
|
-
function() {
|
|
502
|
+
(function() {
|
|
522
503
|
function BackOff2(request, options) {
|
|
523
504
|
this.request = request;
|
|
524
505
|
this.options = options;
|
|
@@ -530,8 +511,7 @@ var require_backoff = __commonJS({
|
|
|
530
511
|
return __generator(this, function(_a) {
|
|
531
512
|
switch (_a.label) {
|
|
532
513
|
case 0:
|
|
533
|
-
if (!!this.attemptLimitReached)
|
|
534
|
-
return [3, 7];
|
|
514
|
+
if (!!this.attemptLimitReached) return [3, 7];
|
|
535
515
|
_a.label = 1;
|
|
536
516
|
case 1:
|
|
537
517
|
_a.trys.push([1, 4, , 6]);
|
|
@@ -585,7 +565,7 @@ var require_backoff = __commonJS({
|
|
|
585
565
|
});
|
|
586
566
|
};
|
|
587
567
|
return BackOff2;
|
|
588
|
-
}()
|
|
568
|
+
})()
|
|
589
569
|
);
|
|
590
570
|
}
|
|
591
571
|
});
|
|
@@ -663,6 +643,7 @@ var CognitiveBeta = class {
|
|
|
663
643
|
timeout: props.timeout || 60001,
|
|
664
644
|
token: props.token || "",
|
|
665
645
|
botId: props.botId || "",
|
|
646
|
+
withCredentials: props.withCredentials || false,
|
|
666
647
|
headers: props.headers || {}
|
|
667
648
|
};
|
|
668
649
|
this._axiosClient = axios.create({
|
|
@@ -671,6 +652,7 @@ var CognitiveBeta = class {
|
|
|
671
652
|
"X-Bot-Id": this._config.botId,
|
|
672
653
|
...this._config.headers
|
|
673
654
|
},
|
|
655
|
+
withCredentials: this._config.withCredentials,
|
|
674
656
|
baseURL: this._config.baseUrl
|
|
675
657
|
});
|
|
676
658
|
}
|
|
@@ -702,8 +684,10 @@ var CognitiveBeta = class {
|
|
|
702
684
|
headers: {
|
|
703
685
|
Authorization: `Bearer ${this._config.token}`,
|
|
704
686
|
"X-Bot-Id": this._config.botId,
|
|
705
|
-
"Content-Type": "application/json"
|
|
687
|
+
"Content-Type": "application/json",
|
|
688
|
+
...this._config.headers
|
|
706
689
|
},
|
|
690
|
+
credentials: this._config.withCredentials ? "include" : "omit",
|
|
707
691
|
body: JSON.stringify({ ...request, stream: true }),
|
|
708
692
|
signal
|
|
709
693
|
});
|
|
@@ -718,7 +702,7 @@ var CognitiveBeta = class {
|
|
|
718
702
|
throw new Error("No response body received for streaming request");
|
|
719
703
|
}
|
|
720
704
|
const reader = body.getReader();
|
|
721
|
-
const iterable = async function* () {
|
|
705
|
+
const iterable = (async function* () {
|
|
722
706
|
for (; ; ) {
|
|
723
707
|
const { value, done } = await reader.read();
|
|
724
708
|
if (done) {
|
|
@@ -728,7 +712,7 @@ var CognitiveBeta = class {
|
|
|
728
712
|
yield value;
|
|
729
713
|
}
|
|
730
714
|
}
|
|
731
|
-
}();
|
|
715
|
+
})();
|
|
732
716
|
for await (const obj of this._ndjson(iterable)) {
|
|
733
717
|
yield obj;
|
|
734
718
|
}
|
|
@@ -923,7 +907,7 @@ var getBestModels = (models, boosts = {}) => models.sort((a, b) => scoreModel(b,
|
|
|
923
907
|
var getFastModels = (models, boosts = {}) => models.sort((a, b) => scoreModel(b, "fast", boosts) - scoreModel(a, "fast", boosts));
|
|
924
908
|
var pickModel = (models, downtimes = []) => {
|
|
925
909
|
const copy = [...models];
|
|
926
|
-
const elasped = (date) => new Date().getTime() - new Date(date).getTime();
|
|
910
|
+
const elasped = (date) => (/* @__PURE__ */ new Date()).getTime() - new Date(date).getTime();
|
|
927
911
|
const DOWNTIME_THRESHOLD = 1e3 * 60 * DOWNTIME_THRESHOLD_MINUTES;
|
|
928
912
|
if (!copy.length) {
|
|
929
913
|
throw new Error("At least one model is required");
|
|
@@ -1037,7 +1021,7 @@ var RemoteModelProvider = class extends ModelProvider {
|
|
|
1037
1021
|
};
|
|
1038
1022
|
|
|
1039
1023
|
// src/client.ts
|
|
1040
|
-
var Cognitive = class {
|
|
1024
|
+
var Cognitive = class _Cognitive {
|
|
1041
1025
|
["$$IS_COGNITIVE"] = true;
|
|
1042
1026
|
static isCognitiveClient(obj) {
|
|
1043
1027
|
return obj?.$$IS_COGNITIVE === true;
|
|
@@ -1068,7 +1052,7 @@ var Cognitive = class {
|
|
|
1068
1052
|
return this._client;
|
|
1069
1053
|
}
|
|
1070
1054
|
clone() {
|
|
1071
|
-
const copy = new
|
|
1055
|
+
const copy = new _Cognitive({
|
|
1072
1056
|
client: this._client.clone(),
|
|
1073
1057
|
provider: this._provider,
|
|
1074
1058
|
timeout: this._timeoutMs,
|
|
@@ -1154,6 +1138,7 @@ var Cognitive = class {
|
|
|
1154
1138
|
}
|
|
1155
1139
|
const betaClient = new CognitiveBeta({
|
|
1156
1140
|
headers: this._client.config.headers,
|
|
1141
|
+
withCredentials: this._client.config.withCredentials,
|
|
1157
1142
|
baseUrl: this._client.config.apiUrl.includes(".cloud") ? "https://cognitive.botpress.cloud" : "https://cognitive.botpress.dev"
|
|
1158
1143
|
});
|
|
1159
1144
|
const response = await betaClient.generateText(input);
|
|
@@ -1237,7 +1222,7 @@ var Cognitive = class {
|
|
|
1237
1222
|
if (action === "fallback") {
|
|
1238
1223
|
this._downtimes.push({
|
|
1239
1224
|
ref: `${integration}:${model}`,
|
|
1240
|
-
startedAt: new Date().toISOString(),
|
|
1225
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1241
1226
|
reason: "Model is down"
|
|
1242
1227
|
});
|
|
1243
1228
|
this._cleanupOldDowntimes();
|