@promptbook/remote-server 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
@@ -33,7 +33,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
33
33
  * @generated
34
34
  * @see https://github.com/webgptorg/promptbook
35
35
  */
36
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-23';
36
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
37
37
  /**
38
38
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
39
39
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -101,11 +101,20 @@ const DEFAULT_BOOK_TITLE = `✨ Untitled Book`;
101
101
  */
102
102
  const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
103
103
  /**
104
- * @@@
104
+ * Threshold value that determines when a dataset is considered "big"
105
+ * and may require special handling or optimizations
106
+ *
107
+ * For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
105
108
  *
106
109
  * @public exported from `@promptbook/core`
107
110
  */
108
111
  const BIG_DATASET_TRESHOLD = 50;
112
+ /**
113
+ * Placeholder text used to represent a placeholder value of failed operation
114
+ *
115
+ * @public exported from `@promptbook/core`
116
+ */
117
+ const FAILED_VALUE_PLACEHOLDER = '!?';
109
118
  // <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
110
119
  /**
111
120
  * The maximum number of iterations for a loops
@@ -2492,7 +2501,7 @@ class SimplePipelineCollection {
2492
2501
  /**
2493
2502
  * Constructs a pipeline collection from pipelines
2494
2503
  *
2495
- * @param pipelines @@@
2504
+ * @param pipelines Array of pipeline JSON objects to include in the collection
2496
2505
  *
2497
2506
  * Note: During the construction logic of all pipelines are validated
2498
2507
  * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
@@ -3023,7 +3032,8 @@ async function preparePersona(personaDescription, tools, options) {
3023
3032
  */
3024
3033
 
3025
3034
  /**
3026
- * @@@
3035
+ * Safely retrieves the global scope object (window in browser, global in Node.js)
3036
+ * regardless of the JavaScript environment in which the code is running
3027
3037
  *
3028
3038
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
3029
3039
  *
@@ -4510,6 +4520,15 @@ const CsvFormatParser = {
4510
4520
  mappedData.push(mappedRow);
4511
4521
  if (onProgress) {
4512
4522
  // Note: Report the CSV with all rows mapped so far
4523
+ /*
4524
+ !!!!
4525
+ // Report progress with updated value
4526
+ const progressData = mappedData.map((row, i) =>
4527
+ i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
4528
+ );
4529
+
4530
+
4531
+ */
4513
4532
  await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
4514
4533
  }
4515
4534
  }
@@ -5535,7 +5554,7 @@ async function executeFormatSubvalues(options) {
5535
5554
  `));
5536
5555
  if (length > BIG_DATASET_TRESHOLD) {
5537
5556
  console.error(highLevelError);
5538
- return '~';
5557
+ return FAILED_VALUE_PLACEHOLDER;
5539
5558
  }
5540
5559
  throw highLevelError;
5541
5560
  }
@@ -5566,7 +5585,7 @@ async function executeFormatSubvalues(options) {
5566
5585
  ${block(pipelineIdentification)}
5567
5586
  Subparameter index: ${index}
5568
5587
  `));
5569
- return '~';
5588
+ return FAILED_VALUE_PLACEHOLDER;
5570
5589
  }
5571
5590
  throw error;
5572
5591
  }