@promptbook/cli 0.75.4 → 0.75.5
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/esm/index.es.js +60 -56
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +4 -2
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +12 -0
- package/esm/typings/src/errors/{index.d.ts → 0-index.d.ts} +10 -2
- package/esm/typings/src/errors/utils/ErrorJson.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +60 -56
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -37,7 +37,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
37
37
|
*
|
|
38
38
|
* @see https://github.com/webgptorg/promptbook
|
|
39
39
|
*/
|
|
40
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
40
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.4';
|
|
41
41
|
/**
|
|
42
42
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
43
43
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2215,6 +2215,42 @@ function createCollectionFromJson() {
|
|
|
2215
2215
|
return new (SimplePipelineCollection.bind.apply(SimplePipelineCollection, __spreadArray([void 0], __read(promptbooks), false)))();
|
|
2216
2216
|
}
|
|
2217
2217
|
|
|
2218
|
+
/**
|
|
2219
|
+
* This error indicates problems parsing the format value
|
|
2220
|
+
*
|
|
2221
|
+
* For example, when the format value is not a valid JSON or CSV
|
|
2222
|
+
* This is not thrown directly but in extended classes
|
|
2223
|
+
*
|
|
2224
|
+
* @public exported from `@promptbook/core`
|
|
2225
|
+
*/
|
|
2226
|
+
var AbstractFormatError = /** @class */ (function (_super) {
|
|
2227
|
+
__extends(AbstractFormatError, _super);
|
|
2228
|
+
// Note: To allow instanceof do not put here error `name`
|
|
2229
|
+
// public readonly name = 'AbstractFormatError';
|
|
2230
|
+
function AbstractFormatError(message) {
|
|
2231
|
+
var _this = _super.call(this, message) || this;
|
|
2232
|
+
Object.setPrototypeOf(_this, AbstractFormatError.prototype);
|
|
2233
|
+
return _this;
|
|
2234
|
+
}
|
|
2235
|
+
return AbstractFormatError;
|
|
2236
|
+
}(Error));
|
|
2237
|
+
|
|
2238
|
+
/**
|
|
2239
|
+
* This error indicates problem with parsing of CSV
|
|
2240
|
+
*
|
|
2241
|
+
* @public exported from `@promptbook/core`
|
|
2242
|
+
*/
|
|
2243
|
+
var CsvFormatError = /** @class */ (function (_super) {
|
|
2244
|
+
__extends(CsvFormatError, _super);
|
|
2245
|
+
function CsvFormatError(message) {
|
|
2246
|
+
var _this = _super.call(this, message) || this;
|
|
2247
|
+
_this.name = 'CsvFormatError';
|
|
2248
|
+
Object.setPrototypeOf(_this, CsvFormatError.prototype);
|
|
2249
|
+
return _this;
|
|
2250
|
+
}
|
|
2251
|
+
return CsvFormatError;
|
|
2252
|
+
}(AbstractFormatError));
|
|
2253
|
+
|
|
2218
2254
|
/**
|
|
2219
2255
|
* This error indicates that the pipeline collection cannot be propperly loaded
|
|
2220
2256
|
*
|
|
@@ -2250,6 +2286,22 @@ var ExpectError = /** @class */ (function (_super) {
|
|
|
2250
2286
|
return ExpectError;
|
|
2251
2287
|
}(Error));
|
|
2252
2288
|
|
|
2289
|
+
/**
|
|
2290
|
+
* This error indicates that the promptbook can not retrieve knowledge from external sources
|
|
2291
|
+
*
|
|
2292
|
+
* @public exported from `@promptbook/core`
|
|
2293
|
+
*/
|
|
2294
|
+
var KnowledgeScrapeError = /** @class */ (function (_super) {
|
|
2295
|
+
__extends(KnowledgeScrapeError, _super);
|
|
2296
|
+
function KnowledgeScrapeError(message) {
|
|
2297
|
+
var _this = _super.call(this, message) || this;
|
|
2298
|
+
_this.name = 'KnowledgeScrapeError';
|
|
2299
|
+
Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
|
|
2300
|
+
return _this;
|
|
2301
|
+
}
|
|
2302
|
+
return KnowledgeScrapeError;
|
|
2303
|
+
}(Error));
|
|
2304
|
+
|
|
2253
2305
|
/**
|
|
2254
2306
|
* This error type indicates that some limit was reached
|
|
2255
2307
|
*
|
|
@@ -2288,10 +2340,14 @@ var NotYetImplementedError = /** @class */ (function (_super) {
|
|
|
2288
2340
|
* @public exported from `@promptbook/core`
|
|
2289
2341
|
*/
|
|
2290
2342
|
var ERRORS = {
|
|
2291
|
-
|
|
2343
|
+
AbstractFormatError: AbstractFormatError,
|
|
2344
|
+
CsvFormatError: CsvFormatError,
|
|
2292
2345
|
CollectionError: CollectionError,
|
|
2293
2346
|
EnvironmentMismatchError: EnvironmentMismatchError,
|
|
2347
|
+
ExpectError: ExpectError,
|
|
2348
|
+
KnowledgeScrapeError: KnowledgeScrapeError,
|
|
2294
2349
|
LimitReachedError: LimitReachedError,
|
|
2350
|
+
MissingToolsError: MissingToolsError,
|
|
2295
2351
|
NotFoundError: NotFoundError,
|
|
2296
2352
|
NotYetImplementedError: NotYetImplementedError,
|
|
2297
2353
|
ParseError: ParseError,
|
|
@@ -2617,42 +2673,6 @@ function union() {
|
|
|
2617
2673
|
function TODO_USE() {
|
|
2618
2674
|
}
|
|
2619
2675
|
|
|
2620
|
-
/**
|
|
2621
|
-
* This error indicates problems parsing the format value
|
|
2622
|
-
*
|
|
2623
|
-
* For example, when the format value is not a valid JSON or CSV
|
|
2624
|
-
* This is not thrown directly but in extended classes
|
|
2625
|
-
*
|
|
2626
|
-
* @public exported from `@promptbook/core`
|
|
2627
|
-
*/
|
|
2628
|
-
var AbstractFormatError = /** @class */ (function (_super) {
|
|
2629
|
-
__extends(AbstractFormatError, _super);
|
|
2630
|
-
// Note: To allow instanceof do not put here error `name`
|
|
2631
|
-
// public readonly name = 'AbstractFormatError';
|
|
2632
|
-
function AbstractFormatError(message) {
|
|
2633
|
-
var _this = _super.call(this, message) || this;
|
|
2634
|
-
Object.setPrototypeOf(_this, AbstractFormatError.prototype);
|
|
2635
|
-
return _this;
|
|
2636
|
-
}
|
|
2637
|
-
return AbstractFormatError;
|
|
2638
|
-
}(Error));
|
|
2639
|
-
|
|
2640
|
-
/**
|
|
2641
|
-
* This error indicates problem with parsing of CSV
|
|
2642
|
-
*
|
|
2643
|
-
* @public exported from `@promptbook/core`
|
|
2644
|
-
*/
|
|
2645
|
-
var CsvFormatError = /** @class */ (function (_super) {
|
|
2646
|
-
__extends(CsvFormatError, _super);
|
|
2647
|
-
function CsvFormatError(message) {
|
|
2648
|
-
var _this = _super.call(this, message) || this;
|
|
2649
|
-
_this.name = 'CsvFormatError';
|
|
2650
|
-
Object.setPrototypeOf(_this, CsvFormatError.prototype);
|
|
2651
|
-
return _this;
|
|
2652
|
-
}
|
|
2653
|
-
return CsvFormatError;
|
|
2654
|
-
}(AbstractFormatError));
|
|
2655
|
-
|
|
2656
2676
|
/**
|
|
2657
2677
|
* @@@
|
|
2658
2678
|
*
|
|
@@ -2693,7 +2713,7 @@ var CsvFormatDefinition = {
|
|
|
2693
2713
|
case 0:
|
|
2694
2714
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
2695
2715
|
if (csv.errors.length !== 0) {
|
|
2696
|
-
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
|
|
2716
|
+
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
2697
2717
|
}
|
|
2698
2718
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
2699
2719
|
var _a, _b;
|
|
@@ -2731,7 +2751,7 @@ var CsvFormatDefinition = {
|
|
|
2731
2751
|
case 0:
|
|
2732
2752
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
2733
2753
|
if (csv.errors.length !== 0) {
|
|
2734
|
-
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
|
|
2754
|
+
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
2735
2755
|
}
|
|
2736
2756
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
|
|
2737
2757
|
var _this = this;
|
|
@@ -4769,22 +4789,6 @@ function preparePersona(personaDescription, tools, options) {
|
|
|
4769
4789
|
* TODO: [🏢] !! Check validity of `temperature` in pipeline
|
|
4770
4790
|
*/
|
|
4771
4791
|
|
|
4772
|
-
/**
|
|
4773
|
-
* This error indicates that the promptbook can not retrieve knowledge from external sources
|
|
4774
|
-
*
|
|
4775
|
-
* @public exported from `@promptbook/core`
|
|
4776
|
-
*/
|
|
4777
|
-
var KnowledgeScrapeError = /** @class */ (function (_super) {
|
|
4778
|
-
__extends(KnowledgeScrapeError, _super);
|
|
4779
|
-
function KnowledgeScrapeError(message) {
|
|
4780
|
-
var _this = _super.call(this, message) || this;
|
|
4781
|
-
_this.name = 'KnowledgeScrapeError';
|
|
4782
|
-
Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
|
|
4783
|
-
return _this;
|
|
4784
|
-
}
|
|
4785
|
-
return KnowledgeScrapeError;
|
|
4786
|
-
}(Error));
|
|
4787
|
-
|
|
4788
4792
|
/**
|
|
4789
4793
|
* @@@
|
|
4790
4794
|
*
|