@promptbook/core 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
@@ -27,7 +27,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
27
27
  * @generated
28
28
  * @see https://github.com/webgptorg/promptbook
29
29
  */
30
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-23';
30
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
31
31
  /**
32
32
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
33
33
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -275,20 +275,23 @@ const DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = 'result';
275
275
  */
276
276
  const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
277
277
  /**
278
- * @@@
278
+ * Threshold value that determines when a dataset is considered "big"
279
+ * and may require special handling or optimizations
280
+ *
281
+ * For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
279
282
  *
280
283
  * @public exported from `@promptbook/core`
281
284
  */
282
285
  const BIG_DATASET_TRESHOLD = 50;
283
286
  /**
284
- * @@@
287
+ * Placeholder text used to represent a placeholder value of failed operation
285
288
  *
286
289
  * @public exported from `@promptbook/core`
287
290
  */
288
- const FAILED_VALUE_PLACEHOLDER = '!';
289
- // <- TODO: !!!! Use
291
+ const FAILED_VALUE_PLACEHOLDER = '!?';
290
292
  /**
291
- * @@@
293
+ * Placeholder text used to represent operations or values that are still in progress
294
+ * or awaiting completion in UI displays and logging
292
295
  *
293
296
  * @public exported from `@promptbook/core`
294
297
  */
@@ -1628,7 +1631,7 @@ class SimplePipelineCollection {
1628
1631
  /**
1629
1632
  * Constructs a pipeline collection from pipelines
1630
1633
  *
1631
- * @param pipelines @@@
1634
+ * @param pipelines Array of pipeline JSON objects to include in the collection
1632
1635
  *
1633
1636
  * Note: During the construction logic of all pipelines are validated
1634
1637
  * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
@@ -2878,6 +2881,15 @@ const CsvFormatParser = {
2878
2881
  mappedData.push(mappedRow);
2879
2882
  if (onProgress) {
2880
2883
  // Note: Report the CSV with all rows mapped so far
2884
+ /*
2885
+ !!!!
2886
+ // Report progress with updated value
2887
+ const progressData = mappedData.map((row, i) =>
2888
+ i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
2889
+ );
2890
+
2891
+
2892
+ */
2881
2893
  await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
2882
2894
  }
2883
2895
  }
@@ -4397,7 +4409,7 @@ async function executeFormatSubvalues(options) {
4397
4409
  `));
4398
4410
  if (length > BIG_DATASET_TRESHOLD) {
4399
4411
  console.error(highLevelError);
4400
- return '~';
4412
+ return FAILED_VALUE_PLACEHOLDER;
4401
4413
  }
4402
4414
  throw highLevelError;
4403
4415
  }
@@ -4428,7 +4440,7 @@ async function executeFormatSubvalues(options) {
4428
4440
  ${block(pipelineIdentification)}
4429
4441
  Subparameter index: ${index}
4430
4442
  `));
4431
- return '~';
4443
+ return FAILED_VALUE_PLACEHOLDER;
4432
4444
  }
4433
4445
  throw error;
4434
4446
  }
@@ -5267,7 +5279,8 @@ async function preparePersona(personaDescription, tools, options) {
5267
5279
  */
5268
5280
 
5269
5281
  /**
5270
- * @@@
5282
+ * Safely retrieves the global scope object (window in browser, global in Node.js)
5283
+ * regardless of the JavaScript environment in which the code is running
5271
5284
  *
5272
5285
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
5273
5286
  *
@@ -7440,14 +7453,15 @@ const MatcherFormfactorDefinition = {
7440
7453
  };
7441
7454
 
7442
7455
  /**
7443
- * Sheets is form of app that @@@
7456
+ * Sheets is form of app that processes tabular data in CSV format, allowing transformation
7457
+ * and analysis of structured data through AI-powered operations
7444
7458
  *
7445
7459
  * @public exported from `@promptbook/core`
7446
7460
  */
7447
7461
  const SheetsFormfactorDefinition = {
7448
7462
  name: 'SHEETS',
7449
7463
  aliasNames: ['SHEETS', 'SHEET'],
7450
- description: `@@@`,
7464
+ description: `A formfactor for processing spreadsheet-like data in CSV format, enabling AI transformations on tabular data`,
7451
7465
  documentationUrl: `https://github.com/webgptorg/promptbook/discussions/176`,
7452
7466
  pipelineInterface: {
7453
7467
  inputParameters: [
@@ -7523,7 +7537,7 @@ const FORMFACTOR_DEFINITIONS = [
7523
7537
  /**
7524
7538
  * Parses the formfactor command
7525
7539
  *
7526
- * Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book` file
7540
+ * Note: This command is used as a formfactor for new commands and defines the app type format - it should NOT be used in any `.book` file
7527
7541
  *
7528
7542
  * @see `documentationUrl` for more details
7529
7543
  * @public exported from `@promptbook/editable`
@@ -7545,7 +7559,7 @@ const formfactorCommandParser = {
7545
7559
  /**
7546
7560
  * Description of the FORMFACTOR command
7547
7561
  */
7548
- description: `@@`,
7562
+ description: `Specifies the application type and interface requirements that this promptbook should conform to`,
7549
7563
  /**
7550
7564
  * Link to documentation
7551
7565
  */
@@ -10208,22 +10222,23 @@ function usageToHuman(usage) {
10208
10222
  */
10209
10223
 
10210
10224
  /**
10211
- * Boilerplate is form of app that @@@
10225
+ * Boilerplate is form of app that serves as a template structure for creating other formfactors
10226
+ * and should not be used directly in production.
10212
10227
  *
10213
10228
  * @public exported from `@promptbook/core`
10214
10229
  */
10215
10230
  const BoilerplateFormfactorDefinition = {
10216
10231
  name: 'BOILERPLATE',
10217
- description: `@@@`,
10232
+ description: `A template structure for creating new formfactors, providing the base architecture and interfaces that should be implemented.`,
10218
10233
  documentationUrl: `https://github.com/webgptorg/promptbook/discussions/@@`,
10219
10234
  // <- TODO: https://github.com/webgptorg/promptbook/discussions/new?category=concepts
10220
10235
  // "🔠 Boilerplate Formfactor"
10221
10236
  pipelineInterface: {
10222
10237
  inputParameters: [
10223
- /* @@@ */
10238
+ /* <- Example input parameters should be defined here */
10224
10239
  ],
10225
10240
  outputParameters: [
10226
- /* @@@ */
10241
+ /* <- Example output parameters should be defined here */
10227
10242
  ],
10228
10243
  },
10229
10244
  };
@@ -10706,9 +10721,9 @@ function cacheLlmTools(llmTools, options = {}) {
10706
10721
  /**
10707
10722
  * TODO: [🧠][💸] Maybe make some common abstraction `interceptLlmTools` and use here (or use javascript Proxy?)
10708
10723
  * TODO: [🧠] Is there some meaningfull way how to test this util
10709
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
10710
- * @@@ write discussion about this and storages
10711
- * @@@ write how to combine multiple interceptors
10724
+ * TODO: [👷‍♂️] Comprehensive manual about construction of llmTools
10725
+ * Detailed explanation about caching strategies and appropriate storage selection for different use cases
10726
+ * Examples of how to combine multiple interceptors for advanced caching, logging, and usage tracking
10712
10727
  */
10713
10728
 
10714
10729
  /**