@promptbook/pdf 0.92.0-23 → 0.92.0-24

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
@@ -26,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
26
26
  * @generated
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-23';
29
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
30
30
  /**
31
31
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
32
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -103,11 +103,20 @@ const DEFAULT_BOOK_TITLE = `✨ Untitled Book`;
103
103
  */
104
104
  const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
105
105
  /**
106
- * @@@
106
+ * Threshold value that determines when a dataset is considered "big"
107
+ * and may require special handling or optimizations
108
+ *
109
+ * For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
107
110
  *
108
111
  * @public exported from `@promptbook/core`
109
112
  */
110
113
  const BIG_DATASET_TRESHOLD = 50;
114
+ /**
115
+ * Placeholder text used to represent a placeholder value of failed operation
116
+ *
117
+ * @public exported from `@promptbook/core`
118
+ */
119
+ const FAILED_VALUE_PLACEHOLDER = '!?';
111
120
  // <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
112
121
  /**
113
122
  * The maximum number of iterations for a loops
@@ -1954,7 +1963,7 @@ class SimplePipelineCollection {
1954
1963
  /**
1955
1964
  * Constructs a pipeline collection from pipelines
1956
1965
  *
1957
- * @param pipelines @@@
1966
+ * @param pipelines Array of pipeline JSON objects to include in the collection
1958
1967
  *
1959
1968
  * Note: During the construction logic of all pipelines are validated
1960
1969
  * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
@@ -3091,7 +3100,8 @@ async function preparePersona(personaDescription, tools, options) {
3091
3100
  */
3092
3101
 
3093
3102
  /**
3094
- * @@@
3103
+ * Safely retrieves the global scope object (window in browser, global in Node.js)
3104
+ * regardless of the JavaScript environment in which the code is running
3095
3105
  *
3096
3106
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
3097
3107
  *
@@ -4192,6 +4202,15 @@ const CsvFormatParser = {
4192
4202
  mappedData.push(mappedRow);
4193
4203
  if (onProgress) {
4194
4204
  // Note: Report the CSV with all rows mapped so far
4205
+ /*
4206
+ !!!!
4207
+ // Report progress with updated value
4208
+ const progressData = mappedData.map((row, i) =>
4209
+ i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
4210
+ );
4211
+
4212
+
4213
+ */
4195
4214
  await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
4196
4215
  }
4197
4216
  }
@@ -5200,7 +5219,7 @@ async function executeFormatSubvalues(options) {
5200
5219
  `));
5201
5220
  if (length > BIG_DATASET_TRESHOLD) {
5202
5221
  console.error(highLevelError);
5203
- return '~';
5222
+ return FAILED_VALUE_PLACEHOLDER;
5204
5223
  }
5205
5224
  throw highLevelError;
5206
5225
  }
@@ -5231,7 +5250,7 @@ async function executeFormatSubvalues(options) {
5231
5250
  ${block(pipelineIdentification)}
5232
5251
  Subparameter index: ${index}
5233
5252
  `));
5234
- return '~';
5253
+ return FAILED_VALUE_PLACEHOLDER;
5235
5254
  }
5236
5255
  throw error;
5237
5256
  }