@promptbook/legacy-documents 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
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
28
28
  * @generated
29
29
  * @see https://github.com/webgptorg/promptbook
30
30
  */
31
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-23';
31
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
32
32
  /**
33
33
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
34
34
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -105,11 +105,20 @@ const DEFAULT_BOOK_TITLE = `✨ Untitled Book`;
105
105
  */
106
106
  const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
107
107
  /**
108
- * @@@
108
+ * Threshold value that determines when a dataset is considered "big"
109
+ * and may require special handling or optimizations
110
+ *
111
+ * For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
109
112
  *
110
113
  * @public exported from `@promptbook/core`
111
114
  */
112
115
  const BIG_DATASET_TRESHOLD = 50;
116
+ /**
117
+ * Placeholder text used to represent a placeholder value of failed operation
118
+ *
119
+ * @public exported from `@promptbook/core`
120
+ */
121
+ const FAILED_VALUE_PLACEHOLDER = '!?';
113
122
  // <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
114
123
  /**
115
124
  * The maximum number of iterations for a loops
@@ -2133,7 +2142,7 @@ class SimplePipelineCollection {
2133
2142
  /**
2134
2143
  * Constructs a pipeline collection from pipelines
2135
2144
  *
2136
- * @param pipelines @@@
2145
+ * @param pipelines Array of pipeline JSON objects to include in the collection
2137
2146
  *
2138
2147
  * Note: During the construction logic of all pipelines are validated
2139
2148
  * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
@@ -3252,7 +3261,8 @@ async function preparePersona(personaDescription, tools, options) {
3252
3261
  */
3253
3262
 
3254
3263
  /**
3255
- * @@@
3264
+ * Safely retrieves the global scope object (window in browser, global in Node.js)
3265
+ * regardless of the JavaScript environment in which the code is running
3256
3266
  *
3257
3267
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
3258
3268
  *
@@ -4343,6 +4353,15 @@ const CsvFormatParser = {
4343
4353
  mappedData.push(mappedRow);
4344
4354
  if (onProgress) {
4345
4355
  // Note: Report the CSV with all rows mapped so far
4356
+ /*
4357
+ !!!!
4358
+ // Report progress with updated value
4359
+ const progressData = mappedData.map((row, i) =>
4360
+ i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
4361
+ );
4362
+
4363
+
4364
+ */
4346
4365
  await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
4347
4366
  }
4348
4367
  }
@@ -5351,7 +5370,7 @@ async function executeFormatSubvalues(options) {
5351
5370
  `));
5352
5371
  if (length > BIG_DATASET_TRESHOLD) {
5353
5372
  console.error(highLevelError);
5354
- return '~';
5373
+ return FAILED_VALUE_PLACEHOLDER;
5355
5374
  }
5356
5375
  throw highLevelError;
5357
5376
  }
@@ -5382,7 +5401,7 @@ async function executeFormatSubvalues(options) {
5382
5401
  ${block(pipelineIdentification)}
5383
5402
  Subparameter index: ${index}
5384
5403
  `));
5385
- return '~';
5404
+ return FAILED_VALUE_PLACEHOLDER;
5386
5405
  }
5387
5406
  throw error;
5388
5407
  }