@promptbook/pdf 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 CHANGED
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
20
20
  *
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- var PROMPTBOOK_ENGINE_VERSION = '0.75.3';
23
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.4';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1797,6 +1797,42 @@ var PipelineExecutionError = /** @class */ (function (_super) {
1797
1797
  return PipelineExecutionError;
1798
1798
  }(Error));
1799
1799
 
1800
+ /**
1801
+ * This error indicates problems parsing the format value
1802
+ *
1803
+ * For example, when the format value is not a valid JSON or CSV
1804
+ * This is not thrown directly but in extended classes
1805
+ *
1806
+ * @public exported from `@promptbook/core`
1807
+ */
1808
+ var AbstractFormatError = /** @class */ (function (_super) {
1809
+ __extends(AbstractFormatError, _super);
1810
+ // Note: To allow instanceof do not put here error `name`
1811
+ // public readonly name = 'AbstractFormatError';
1812
+ function AbstractFormatError(message) {
1813
+ var _this = _super.call(this, message) || this;
1814
+ Object.setPrototypeOf(_this, AbstractFormatError.prototype);
1815
+ return _this;
1816
+ }
1817
+ return AbstractFormatError;
1818
+ }(Error));
1819
+
1820
+ /**
1821
+ * This error indicates problem with parsing of CSV
1822
+ *
1823
+ * @public exported from `@promptbook/core`
1824
+ */
1825
+ var CsvFormatError = /** @class */ (function (_super) {
1826
+ __extends(CsvFormatError, _super);
1827
+ function CsvFormatError(message) {
1828
+ var _this = _super.call(this, message) || this;
1829
+ _this.name = 'CsvFormatError';
1830
+ Object.setPrototypeOf(_this, CsvFormatError.prototype);
1831
+ return _this;
1832
+ }
1833
+ return CsvFormatError;
1834
+ }(AbstractFormatError));
1835
+
1800
1836
  /**
1801
1837
  * This error indicates that the pipeline collection cannot be propperly loaded
1802
1838
  *
@@ -1848,6 +1884,22 @@ var ExpectError = /** @class */ (function (_super) {
1848
1884
  return ExpectError;
1849
1885
  }(Error));
1850
1886
 
1887
+ /**
1888
+ * This error indicates that the promptbook can not retrieve knowledge from external sources
1889
+ *
1890
+ * @public exported from `@promptbook/core`
1891
+ */
1892
+ var KnowledgeScrapeError = /** @class */ (function (_super) {
1893
+ __extends(KnowledgeScrapeError, _super);
1894
+ function KnowledgeScrapeError(message) {
1895
+ var _this = _super.call(this, message) || this;
1896
+ _this.name = 'KnowledgeScrapeError';
1897
+ Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
1898
+ return _this;
1899
+ }
1900
+ return KnowledgeScrapeError;
1901
+ }(Error));
1902
+
1851
1903
  /**
1852
1904
  * This error type indicates that some limit was reached
1853
1905
  *
@@ -1870,10 +1922,14 @@ var LimitReachedError = /** @class */ (function (_super) {
1870
1922
  * @public exported from `@promptbook/core`
1871
1923
  */
1872
1924
  var ERRORS = {
1873
- ExpectError: ExpectError,
1925
+ AbstractFormatError: AbstractFormatError,
1926
+ CsvFormatError: CsvFormatError,
1874
1927
  CollectionError: CollectionError,
1875
1928
  EnvironmentMismatchError: EnvironmentMismatchError,
1929
+ ExpectError: ExpectError,
1930
+ KnowledgeScrapeError: KnowledgeScrapeError,
1876
1931
  LimitReachedError: LimitReachedError,
1932
+ MissingToolsError: MissingToolsError,
1877
1933
  NotFoundError: NotFoundError,
1878
1934
  NotYetImplementedError: NotYetImplementedError,
1879
1935
  ParseError: ParseError,
@@ -2674,22 +2730,6 @@ function preparePersona(personaDescription, tools, options) {
2674
2730
  * TODO: [🏢] !! Check validity of `temperature` in pipeline
2675
2731
  */
2676
2732
 
2677
- /**
2678
- * This error indicates that the promptbook can not retrieve knowledge from external sources
2679
- *
2680
- * @public exported from `@promptbook/core`
2681
- */
2682
- var KnowledgeScrapeError = /** @class */ (function (_super) {
2683
- __extends(KnowledgeScrapeError, _super);
2684
- function KnowledgeScrapeError(message) {
2685
- var _this = _super.call(this, message) || this;
2686
- _this.name = 'KnowledgeScrapeError';
2687
- Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
2688
- return _this;
2689
- }
2690
- return KnowledgeScrapeError;
2691
- }(Error));
2692
-
2693
2733
  /**
2694
2734
  * @@@
2695
2735
  *
@@ -3709,42 +3749,6 @@ function union() {
3709
3749
  return union;
3710
3750
  }
3711
3751
 
3712
- /**
3713
- * This error indicates problems parsing the format value
3714
- *
3715
- * For example, when the format value is not a valid JSON or CSV
3716
- * This is not thrown directly but in extended classes
3717
- *
3718
- * @public exported from `@promptbook/core`
3719
- */
3720
- var AbstractFormatError = /** @class */ (function (_super) {
3721
- __extends(AbstractFormatError, _super);
3722
- // Note: To allow instanceof do not put here error `name`
3723
- // public readonly name = 'AbstractFormatError';
3724
- function AbstractFormatError(message) {
3725
- var _this = _super.call(this, message) || this;
3726
- Object.setPrototypeOf(_this, AbstractFormatError.prototype);
3727
- return _this;
3728
- }
3729
- return AbstractFormatError;
3730
- }(Error));
3731
-
3732
- /**
3733
- * This error indicates problem with parsing of CSV
3734
- *
3735
- * @public exported from `@promptbook/core`
3736
- */
3737
- var CsvFormatError = /** @class */ (function (_super) {
3738
- __extends(CsvFormatError, _super);
3739
- function CsvFormatError(message) {
3740
- var _this = _super.call(this, message) || this;
3741
- _this.name = 'CsvFormatError';
3742
- Object.setPrototypeOf(_this, CsvFormatError.prototype);
3743
- return _this;
3744
- }
3745
- return CsvFormatError;
3746
- }(AbstractFormatError));
3747
-
3748
3752
  /**
3749
3753
  * @@@
3750
3754
  *
@@ -3785,7 +3789,7 @@ var CsvFormatDefinition = {
3785
3789
  case 0:
3786
3790
  csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3787
3791
  if (csv.errors.length !== 0) {
3788
- 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 "); }));
3792
+ 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 "); }));
3789
3793
  }
3790
3794
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
3791
3795
  var _a, _b;
@@ -3823,7 +3827,7 @@ var CsvFormatDefinition = {
3823
3827
  case 0:
3824
3828
  csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3825
3829
  if (csv.errors.length !== 0) {
3826
- 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 "); }));
3830
+ 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 "); }));
3827
3831
  }
3828
3832
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
3829
3833
  var _this = this;