@promptbook/markdown-utils 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
@@ -25,7 +25,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
25
25
  * @generated
26
26
  * @see https://github.com/webgptorg/promptbook
27
27
  */
28
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-23';
28
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
29
29
  /**
30
30
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
31
31
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -232,11 +232,20 @@ const DEFAULT_BOOK_TITLE = `✨ Untitled Book`;
232
232
  */
233
233
  const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
234
234
  /**
235
- * @@@
235
+ * Threshold value that determines when a dataset is considered "big"
236
+ * and may require special handling or optimizations
237
+ *
238
+ * For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
236
239
  *
237
240
  * @public exported from `@promptbook/core`
238
241
  */
239
242
  const BIG_DATASET_TRESHOLD = 50;
243
+ /**
244
+ * Placeholder text used to represent a placeholder value of failed operation
245
+ *
246
+ * @public exported from `@promptbook/core`
247
+ */
248
+ const FAILED_VALUE_PLACEHOLDER = '!?';
240
249
  // <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
241
250
  /**
242
251
  * The maximum number of iterations for a loops
@@ -1614,7 +1623,7 @@ class SimplePipelineCollection {
1614
1623
  /**
1615
1624
  * Constructs a pipeline collection from pipelines
1616
1625
  *
1617
- * @param pipelines @@@
1626
+ * @param pipelines Array of pipeline JSON objects to include in the collection
1618
1627
  *
1619
1628
  * Note: During the construction logic of all pipelines are validated
1620
1629
  * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
@@ -2777,7 +2786,8 @@ async function preparePersona(personaDescription, tools, options) {
2777
2786
  */
2778
2787
 
2779
2788
  /**
2780
- * @@@
2789
+ * Safely retrieves the global scope object (window in browser, global in Node.js)
2790
+ * regardless of the JavaScript environment in which the code is running
2781
2791
  *
2782
2792
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
2783
2793
  *
@@ -4264,6 +4274,15 @@ const CsvFormatParser = {
4264
4274
  mappedData.push(mappedRow);
4265
4275
  if (onProgress) {
4266
4276
  // Note: Report the CSV with all rows mapped so far
4277
+ /*
4278
+ !!!!
4279
+ // Report progress with updated value
4280
+ const progressData = mappedData.map((row, i) =>
4281
+ i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
4282
+ );
4283
+
4284
+
4285
+ */
4267
4286
  await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
4268
4287
  }
4269
4288
  }
@@ -5170,7 +5189,7 @@ async function executeFormatSubvalues(options) {
5170
5189
  `));
5171
5190
  if (length > BIG_DATASET_TRESHOLD) {
5172
5191
  console.error(highLevelError);
5173
- return '~';
5192
+ return FAILED_VALUE_PLACEHOLDER;
5174
5193
  }
5175
5194
  throw highLevelError;
5176
5195
  }
@@ -5201,7 +5220,7 @@ async function executeFormatSubvalues(options) {
5201
5220
  ${block(pipelineIdentification)}
5202
5221
  Subparameter index: ${index}
5203
5222
  `));
5204
- return '~';
5223
+ return FAILED_VALUE_PLACEHOLDER;
5205
5224
  }
5206
5225
  throw error;
5207
5226
  }