@promptbook/core 0.92.0-11 → 0.92.0-13

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.
Files changed (24) hide show
  1. package/esm/index.es.js +296 -273
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +6 -4
  5. package/esm/typings/src/_packages/types.index.d.ts +2 -2
  6. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +3 -1
  7. package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
  8. package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
  9. package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +3 -3
  10. package/esm/typings/src/formats/_common/{FormatSubvalueDefinition.d.ts → FormatSubvalueParser.d.ts} +1 -1
  11. package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
  12. package/esm/typings/src/formats/index.d.ts +2 -2
  13. package/esm/typings/src/formats/json/{JsonFormatDefinition.d.ts → JsonFormatParser.d.ts} +6 -6
  14. package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
  15. package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
  16. package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +1 -1
  17. package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +10 -0
  18. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +7 -0
  19. package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
  20. package/package.json +1 -1
  21. package/umd/index.umd.js +301 -277
  22. package/umd/index.umd.js.map +1 -1
  23. package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
  24. package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
package/esm/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import spaceTrim, { spaceTrim as spaceTrim$1 } from 'spacetrim';
2
2
  import { format } from 'prettier';
3
3
  import parserHtml from 'prettier/parser-html';
4
- import { Subject } from 'rxjs';
5
4
  import { randomBytes } from 'crypto';
5
+ import { Subject } from 'rxjs';
6
6
  import { forTime } from 'waitasecond';
7
7
  import { parse, unparse } from 'papaparse';
8
8
  import hexEncoder from 'crypto-js/enc-hex';
@@ -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-11';
30
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-13';
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
@@ -1878,109 +1878,6 @@ function isPipelinePrepared(pipeline) {
1878
1878
  * - [♨] Are tasks prepared
1879
1879
  */
1880
1880
 
1881
- /**
1882
- * Generates random token
1883
- *
1884
- * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
1885
- *
1886
- * @private internal helper function
1887
- * @returns secure random token
1888
- */
1889
- function $randomToken(randomness) {
1890
- return randomBytes(randomness).toString('hex');
1891
- }
1892
- /**
1893
- * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
1894
- */
1895
-
1896
- /**
1897
- * Converts a JavaScript Object Notation (JSON) string into an object.
1898
- *
1899
- * Note: This is wrapper around `JSON.parse()` with better error and type handling
1900
- *
1901
- * @public exported from `@promptbook/utils`
1902
- */
1903
- function jsonParse(value) {
1904
- if (value === undefined) {
1905
- throw new Error(`Can not parse JSON from undefined value.`);
1906
- }
1907
- else if (typeof value !== 'string') {
1908
- console.error('Can not parse JSON from non-string value.', { text: value });
1909
- throw new Error(spaceTrim(`
1910
- Can not parse JSON from non-string value.
1911
-
1912
- The value type: ${typeof value}
1913
- See more in console.
1914
- `));
1915
- }
1916
- try {
1917
- return JSON.parse(value);
1918
- }
1919
- catch (error) {
1920
- if (!(error instanceof Error)) {
1921
- throw error;
1922
- }
1923
- throw new Error(spaceTrim((block) => `
1924
- ${block(error.message)}
1925
-
1926
- The JSON text:
1927
- ${block(value)}
1928
- `));
1929
- }
1930
- }
1931
- /**
1932
- * TODO: !!!! Use in Promptbook.studio
1933
- */
1934
-
1935
- /**
1936
- * Recursively converts JSON strings to JSON objects
1937
-
1938
- * @public exported from `@promptbook/utils`
1939
- */
1940
- function jsonStringsToJsons(object) {
1941
- if (object === null) {
1942
- return object;
1943
- }
1944
- if (Array.isArray(object)) {
1945
- return object.map(jsonStringsToJsons);
1946
- }
1947
- if (typeof object !== 'object') {
1948
- return object;
1949
- }
1950
- const newObject = { ...object };
1951
- for (const [key, value] of Object.entries(object)) {
1952
- if (typeof value === 'string' && isValidJsonString(value)) {
1953
- newObject[key] = jsonParse(value);
1954
- }
1955
- else {
1956
- newObject[key] = jsonStringsToJsons(value);
1957
- }
1958
- }
1959
- return newObject;
1960
- }
1961
- /**
1962
- * TODO: Type the return type correctly
1963
- */
1964
-
1965
- /**
1966
- * This error indicates errors during the execution of the pipeline
1967
- *
1968
- * @public exported from `@promptbook/core`
1969
- */
1970
- class PipelineExecutionError extends Error {
1971
- constructor(message) {
1972
- // Added id parameter
1973
- super(message);
1974
- this.name = 'PipelineExecutionError';
1975
- // TODO: [🐙] DRY - Maybe $randomId
1976
- this.id = `error-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid simmilar char conflicts */)}`;
1977
- Object.setPrototypeOf(this, PipelineExecutionError.prototype);
1978
- }
1979
- }
1980
- /**
1981
- * TODO: [🧠][🌂] Add id to all errors
1982
- */
1983
-
1984
1881
  /**
1985
1882
  * This error indicates problems parsing the format value
1986
1883
  *
@@ -2115,6 +2012,40 @@ class NotYetImplementedError extends Error {
2115
2012
  }
2116
2013
  }
2117
2014
 
2015
+ /**
2016
+ * Generates random token
2017
+ *
2018
+ * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
2019
+ *
2020
+ * @private internal helper function
2021
+ * @returns secure random token
2022
+ */
2023
+ function $randomToken(randomness) {
2024
+ return randomBytes(randomness).toString('hex');
2025
+ }
2026
+ /**
2027
+ * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
2028
+ */
2029
+
2030
+ /**
2031
+ * This error indicates errors during the execution of the pipeline
2032
+ *
2033
+ * @public exported from `@promptbook/core`
2034
+ */
2035
+ class PipelineExecutionError extends Error {
2036
+ constructor(message) {
2037
+ // Added id parameter
2038
+ super(message);
2039
+ this.name = 'PipelineExecutionError';
2040
+ // TODO: [🐙] DRY - Maybe $randomId
2041
+ this.id = `error-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid simmilar char conflicts */)}`;
2042
+ Object.setPrototypeOf(this, PipelineExecutionError.prototype);
2043
+ }
2044
+ }
2045
+ /**
2046
+ * TODO: [🧠][🌂] Add id to all errors
2047
+ */
2048
+
2118
2049
  /**
2119
2050
  * Error thrown when a fetch request fails
2120
2051
  *
@@ -2190,6 +2121,104 @@ const ALL_ERRORS = {
2190
2121
  * Note: [💞] Ignore a discrepancy between file name and entity name
2191
2122
  */
2192
2123
 
2124
+ /**
2125
+ * Serializes an error into a [🚉] JSON-serializable object
2126
+ *
2127
+ * @public exported from `@promptbook/utils`
2128
+ */
2129
+ function serializeError(error) {
2130
+ const { name, message, stack } = error;
2131
+ const { id } = error;
2132
+ if (!Object.keys(ALL_ERRORS).includes(name)) {
2133
+ console.error(spaceTrim((block) => `
2134
+
2135
+ Cannot serialize error with name "${name}"
2136
+
2137
+ Authors of Promptbook probably forgot to add this error into the list of errors:
2138
+ https://github.com/webgptorg/promptbook/blob/main/src/errors/0-index.ts
2139
+
2140
+
2141
+ ${block(stack || message)}
2142
+
2143
+ `));
2144
+ }
2145
+ return {
2146
+ name: name,
2147
+ message,
2148
+ stack,
2149
+ id, // Include id in the serialized object
2150
+ };
2151
+ }
2152
+
2153
+ /**
2154
+ * Converts a JavaScript Object Notation (JSON) string into an object.
2155
+ *
2156
+ * Note: This is wrapper around `JSON.parse()` with better error and type handling
2157
+ *
2158
+ * @public exported from `@promptbook/utils`
2159
+ */
2160
+ function jsonParse(value) {
2161
+ if (value === undefined) {
2162
+ throw new Error(`Can not parse JSON from undefined value.`);
2163
+ }
2164
+ else if (typeof value !== 'string') {
2165
+ console.error('Can not parse JSON from non-string value.', { text: value });
2166
+ throw new Error(spaceTrim(`
2167
+ Can not parse JSON from non-string value.
2168
+
2169
+ The value type: ${typeof value}
2170
+ See more in console.
2171
+ `));
2172
+ }
2173
+ try {
2174
+ return JSON.parse(value);
2175
+ }
2176
+ catch (error) {
2177
+ if (!(error instanceof Error)) {
2178
+ throw error;
2179
+ }
2180
+ throw new Error(spaceTrim((block) => `
2181
+ ${block(error.message)}
2182
+
2183
+ The JSON text:
2184
+ ${block(value)}
2185
+ `));
2186
+ }
2187
+ }
2188
+ /**
2189
+ * TODO: !!!! Use in Promptbook.studio
2190
+ */
2191
+
2192
+ /**
2193
+ * Recursively converts JSON strings to JSON objects
2194
+
2195
+ * @public exported from `@promptbook/utils`
2196
+ */
2197
+ function jsonStringsToJsons(object) {
2198
+ if (object === null) {
2199
+ return object;
2200
+ }
2201
+ if (Array.isArray(object)) {
2202
+ return object.map(jsonStringsToJsons);
2203
+ }
2204
+ if (typeof object !== 'object') {
2205
+ return object;
2206
+ }
2207
+ const newObject = { ...object };
2208
+ for (const [key, value] of Object.entries(object)) {
2209
+ if (typeof value === 'string' && isValidJsonString(value)) {
2210
+ newObject[key] = jsonParse(value);
2211
+ }
2212
+ else {
2213
+ newObject[key] = jsonStringsToJsons(value);
2214
+ }
2215
+ }
2216
+ return newObject;
2217
+ }
2218
+ /**
2219
+ * TODO: Type the return type correctly
2220
+ */
2221
+
2193
2222
  /**
2194
2223
  * Deserializes the error object
2195
2224
  *
@@ -2356,33 +2385,72 @@ function createTask(options) {
2356
2385
  */
2357
2386
 
2358
2387
  /**
2359
- * Serializes an error into a [🚉] JSON-serializable object
2388
+ * Represents the uncertain value
2360
2389
  *
2361
- * @public exported from `@promptbook/utils`
2390
+ * @public exported from `@promptbook/core`
2391
+ */
2392
+ const ZERO_VALUE = $deepFreeze({ value: 0 });
2393
+ /**
2394
+ * Represents the uncertain value
2395
+ *
2396
+ * @public exported from `@promptbook/core`
2397
+ */
2398
+ const UNCERTAIN_ZERO_VALUE = $deepFreeze({ value: 0, isUncertain: true });
2399
+ /**
2400
+ * Represents the usage with no resources consumed
2401
+ *
2402
+ * @public exported from `@promptbook/core`
2403
+ */
2404
+ const ZERO_USAGE = $deepFreeze({
2405
+ price: ZERO_VALUE,
2406
+ input: {
2407
+ tokensCount: ZERO_VALUE,
2408
+ charactersCount: ZERO_VALUE,
2409
+ wordsCount: ZERO_VALUE,
2410
+ sentencesCount: ZERO_VALUE,
2411
+ linesCount: ZERO_VALUE,
2412
+ paragraphsCount: ZERO_VALUE,
2413
+ pagesCount: ZERO_VALUE,
2414
+ },
2415
+ output: {
2416
+ tokensCount: ZERO_VALUE,
2417
+ charactersCount: ZERO_VALUE,
2418
+ wordsCount: ZERO_VALUE,
2419
+ sentencesCount: ZERO_VALUE,
2420
+ linesCount: ZERO_VALUE,
2421
+ paragraphsCount: ZERO_VALUE,
2422
+ pagesCount: ZERO_VALUE,
2423
+ },
2424
+ });
2425
+ /**
2426
+ * Represents the usage with unknown resources consumed
2427
+ *
2428
+ * @public exported from `@promptbook/core`
2429
+ */
2430
+ const UNCERTAIN_USAGE = $deepFreeze({
2431
+ price: UNCERTAIN_ZERO_VALUE,
2432
+ input: {
2433
+ tokensCount: UNCERTAIN_ZERO_VALUE,
2434
+ charactersCount: UNCERTAIN_ZERO_VALUE,
2435
+ wordsCount: UNCERTAIN_ZERO_VALUE,
2436
+ sentencesCount: UNCERTAIN_ZERO_VALUE,
2437
+ linesCount: UNCERTAIN_ZERO_VALUE,
2438
+ paragraphsCount: UNCERTAIN_ZERO_VALUE,
2439
+ pagesCount: UNCERTAIN_ZERO_VALUE,
2440
+ },
2441
+ output: {
2442
+ tokensCount: UNCERTAIN_ZERO_VALUE,
2443
+ charactersCount: UNCERTAIN_ZERO_VALUE,
2444
+ wordsCount: UNCERTAIN_ZERO_VALUE,
2445
+ sentencesCount: UNCERTAIN_ZERO_VALUE,
2446
+ linesCount: UNCERTAIN_ZERO_VALUE,
2447
+ paragraphsCount: UNCERTAIN_ZERO_VALUE,
2448
+ pagesCount: UNCERTAIN_ZERO_VALUE,
2449
+ },
2450
+ });
2451
+ /**
2452
+ * Note: [💞] Ignore a discrepancy between file name and entity name
2362
2453
  */
2363
- function serializeError(error) {
2364
- const { name, message, stack } = error;
2365
- const { id } = error;
2366
- if (!Object.keys(ALL_ERRORS).includes(name)) {
2367
- console.error(spaceTrim((block) => `
2368
-
2369
- Cannot serialize error with name "${name}"
2370
-
2371
- Authors of Promptbook probably forgot to add this error into the list of errors:
2372
- https://github.com/webgptorg/promptbook/blob/main/src/errors/0-index.ts
2373
-
2374
-
2375
- ${block(stack || message)}
2376
-
2377
- `));
2378
- }
2379
- return {
2380
- name: name,
2381
- message,
2382
- stack,
2383
- id, // Include id in the serialized object
2384
- };
2385
- }
2386
2454
 
2387
2455
  /**
2388
2456
  * Format either small or big number
@@ -2465,74 +2533,6 @@ function valueToString(value) {
2465
2533
  }
2466
2534
  }
2467
2535
 
2468
- /**
2469
- * Represents the uncertain value
2470
- *
2471
- * @public exported from `@promptbook/core`
2472
- */
2473
- const ZERO_VALUE = $deepFreeze({ value: 0 });
2474
- /**
2475
- * Represents the uncertain value
2476
- *
2477
- * @public exported from `@promptbook/core`
2478
- */
2479
- const UNCERTAIN_ZERO_VALUE = $deepFreeze({ value: 0, isUncertain: true });
2480
- /**
2481
- * Represents the usage with no resources consumed
2482
- *
2483
- * @public exported from `@promptbook/core`
2484
- */
2485
- const ZERO_USAGE = $deepFreeze({
2486
- price: ZERO_VALUE,
2487
- input: {
2488
- tokensCount: ZERO_VALUE,
2489
- charactersCount: ZERO_VALUE,
2490
- wordsCount: ZERO_VALUE,
2491
- sentencesCount: ZERO_VALUE,
2492
- linesCount: ZERO_VALUE,
2493
- paragraphsCount: ZERO_VALUE,
2494
- pagesCount: ZERO_VALUE,
2495
- },
2496
- output: {
2497
- tokensCount: ZERO_VALUE,
2498
- charactersCount: ZERO_VALUE,
2499
- wordsCount: ZERO_VALUE,
2500
- sentencesCount: ZERO_VALUE,
2501
- linesCount: ZERO_VALUE,
2502
- paragraphsCount: ZERO_VALUE,
2503
- pagesCount: ZERO_VALUE,
2504
- },
2505
- });
2506
- /**
2507
- * Represents the usage with unknown resources consumed
2508
- *
2509
- * @public exported from `@promptbook/core`
2510
- */
2511
- const UNCERTAIN_USAGE = $deepFreeze({
2512
- price: UNCERTAIN_ZERO_VALUE,
2513
- input: {
2514
- tokensCount: UNCERTAIN_ZERO_VALUE,
2515
- charactersCount: UNCERTAIN_ZERO_VALUE,
2516
- wordsCount: UNCERTAIN_ZERO_VALUE,
2517
- sentencesCount: UNCERTAIN_ZERO_VALUE,
2518
- linesCount: UNCERTAIN_ZERO_VALUE,
2519
- paragraphsCount: UNCERTAIN_ZERO_VALUE,
2520
- pagesCount: UNCERTAIN_ZERO_VALUE,
2521
- },
2522
- output: {
2523
- tokensCount: UNCERTAIN_ZERO_VALUE,
2524
- charactersCount: UNCERTAIN_ZERO_VALUE,
2525
- wordsCount: UNCERTAIN_ZERO_VALUE,
2526
- sentencesCount: UNCERTAIN_ZERO_VALUE,
2527
- linesCount: UNCERTAIN_ZERO_VALUE,
2528
- paragraphsCount: UNCERTAIN_ZERO_VALUE,
2529
- pagesCount: UNCERTAIN_ZERO_VALUE,
2530
- },
2531
- });
2532
- /**
2533
- * Note: [💞] Ignore a discrepancy between file name and entity name
2534
- */
2535
-
2536
2536
  /**
2537
2537
  * Function `addUsage` will add multiple usages into one
2538
2538
  *
@@ -2750,6 +2750,24 @@ const MANDATORY_CSV_SETTINGS = Object.freeze({
2750
2750
  // encoding: 'utf-8',
2751
2751
  });
2752
2752
 
2753
+ /**
2754
+ * Converts a CSV string into an object
2755
+ *
2756
+ * Note: This is wrapper around `papaparse.parse()` with better autohealing
2757
+ *
2758
+ * @private - for now until `@promptbook/csv` is released
2759
+ */
2760
+ function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO: Make CSV Schemas */) {
2761
+ settings = { ...settings, ...MANDATORY_CSV_SETTINGS };
2762
+ // Note: Autoheal invalid '\n' characters
2763
+ if (settings.newline && !settings.newline.includes('\r') && value.includes('\r')) {
2764
+ console.warn('CSV string contains carriage return characters, but in the CSV settings the `newline` setting does not include them. Autohealing the CSV string.');
2765
+ value = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
2766
+ }
2767
+ const csv = parse(value, settings);
2768
+ return csv;
2769
+ }
2770
+
2753
2771
  /**
2754
2772
  * Function to check if a string is valid CSV
2755
2773
  *
@@ -2772,31 +2790,13 @@ function isValidCsvString(value) {
2772
2790
  }
2773
2791
  }
2774
2792
 
2775
- /**
2776
- * Converts a CSV string into an object
2777
- *
2778
- * Note: This is wrapper around `papaparse.parse()` with better autohealing
2779
- *
2780
- * @private - for now until `@promptbook/csv` is released
2781
- */
2782
- function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO: Make CSV Schemas */) {
2783
- settings = { ...settings, ...MANDATORY_CSV_SETTINGS };
2784
- // Note: Autoheal invalid '\n' characters
2785
- if (settings.newline && !settings.newline.includes('\r') && value.includes('\r')) {
2786
- console.warn('CSV string contains carriage return characters, but in the CSV settings the `newline` setting does not include them. Autohealing the CSV string.');
2787
- value = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
2788
- }
2789
- const csv = parse(value, settings);
2790
- return csv;
2791
- }
2792
-
2793
2793
  /**
2794
2794
  * Definition for CSV spreadsheet
2795
2795
  *
2796
2796
  * @public exported from `@promptbook/core`
2797
2797
  * <- TODO: [🏢] Export from package `@promptbook/csv`
2798
2798
  */
2799
- const CsvFormatDefinition = {
2799
+ const CsvFormatParser = {
2800
2800
  formatName: 'CSV',
2801
2801
  aliases: ['SPREADSHEET', 'TABLE'],
2802
2802
  isValid(value, settings, schema) {
@@ -2808,7 +2808,7 @@ const CsvFormatDefinition = {
2808
2808
  heal(value, settings, schema) {
2809
2809
  throw new Error('Not implemented');
2810
2810
  },
2811
- subvalueDefinitions: [
2811
+ subvalueParsers: [
2812
2812
  {
2813
2813
  subvalueName: 'ROW',
2814
2814
  async mapValues(value, outputParameterName, settings, mapCallback) {
@@ -2869,10 +2869,10 @@ const CsvFormatDefinition = {
2869
2869
  ],
2870
2870
  };
2871
2871
  /**
2872
- * TODO: [🍓] In `CsvFormatDefinition` implement simple `isValid`
2873
- * TODO: [🍓] In `CsvFormatDefinition` implement partial `canBeValid`
2874
- * TODO: [🍓] In `CsvFormatDefinition` implement `heal
2875
- * TODO: [🍓] In `CsvFormatDefinition` implement `subvalueDefinitions`
2872
+ * TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
2873
+ * TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
2874
+ * TODO: [🍓] In `CsvFormatParser` implement `heal
2875
+ * TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
2876
2876
  * TODO: [🏢] Allow to expect something inside CSV objects and other formats
2877
2877
  */
2878
2878
 
@@ -2881,7 +2881,7 @@ const CsvFormatDefinition = {
2881
2881
  *
2882
2882
  * @private still in development [🏢]
2883
2883
  */
2884
- const JsonFormatDefinition = {
2884
+ const JsonFormatParser = {
2885
2885
  formatName: 'JSON',
2886
2886
  mimeType: 'application/json',
2887
2887
  isValid(value, settings, schema) {
@@ -2893,28 +2893,28 @@ const JsonFormatDefinition = {
2893
2893
  heal(value, settings, schema) {
2894
2894
  throw new Error('Not implemented');
2895
2895
  },
2896
- subvalueDefinitions: [],
2896
+ subvalueParsers: [],
2897
2897
  };
2898
2898
  /**
2899
2899
  * TODO: [🧠] Maybe propper instance of object
2900
2900
  * TODO: [0] Make string_serialized_json
2901
2901
  * TODO: [1] Make type for JSON Settings and Schema
2902
2902
  * TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
2903
- * TODO: [🍓] In `JsonFormatDefinition` implement simple `isValid`
2904
- * TODO: [🍓] In `JsonFormatDefinition` implement partial `canBeValid`
2905
- * TODO: [🍓] In `JsonFormatDefinition` implement `heal
2906
- * TODO: [🍓] In `JsonFormatDefinition` implement `subvalueDefinitions`
2903
+ * TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
2904
+ * TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
2905
+ * TODO: [🍓] In `JsonFormatParser` implement `heal
2906
+ * TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
2907
2907
  * TODO: [🏢] Allow to expect something inside JSON objects and other formats
2908
2908
  */
2909
2909
 
2910
2910
  /**
2911
2911
  * Definition for any text - this will be always valid
2912
2912
  *
2913
- * Note: This is not useful for validation, but for splitting and mapping with `subvalueDefinitions`
2913
+ * Note: This is not useful for validation, but for splitting and mapping with `subvalueParsers`
2914
2914
  *
2915
2915
  * @public exported from `@promptbook/core`
2916
2916
  */
2917
- const TextFormatDefinition = {
2917
+ const TextFormatParser = {
2918
2918
  formatName: 'TEXT',
2919
2919
  isValid(value) {
2920
2920
  return typeof value === 'string';
@@ -2923,9 +2923,9 @@ const TextFormatDefinition = {
2923
2923
  return typeof partialValue === 'string';
2924
2924
  },
2925
2925
  heal() {
2926
- throw new UnexpectedError('It does not make sense to call `TextFormatDefinition.heal`');
2926
+ throw new UnexpectedError('It does not make sense to call `TextFormatParser.heal`');
2927
2927
  },
2928
- subvalueDefinitions: [
2928
+ subvalueParsers: [
2929
2929
  {
2930
2930
  subvalueName: 'LINE',
2931
2931
  async mapValues(value, outputParameterName, settings, mapCallback) {
@@ -2945,10 +2945,10 @@ const TextFormatDefinition = {
2945
2945
  /**
2946
2946
  * TODO: [1] Make type for XML Text and Schema
2947
2947
  * TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
2948
- * TODO: [🍓] In `TextFormatDefinition` implement simple `isValid`
2949
- * TODO: [🍓] In `TextFormatDefinition` implement partial `canBeValid`
2950
- * TODO: [🍓] In `TextFormatDefinition` implement `heal
2951
- * TODO: [🍓] In `TextFormatDefinition` implement `subvalueDefinitions`
2948
+ * TODO: [🍓] In `TextFormatParser` implement simple `isValid`
2949
+ * TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
2950
+ * TODO: [🍓] In `TextFormatParser` implement `heal
2951
+ * TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
2952
2952
  * TODO: [🏢] Allow to expect something inside each item of list and other formats
2953
2953
  */
2954
2954
 
@@ -2981,7 +2981,7 @@ function isValidXmlString(value) {
2981
2981
  *
2982
2982
  * @private still in development [🏢]
2983
2983
  */
2984
- const XmlFormatDefinition = {
2984
+ const XmlFormatParser = {
2985
2985
  formatName: 'XML',
2986
2986
  mimeType: 'application/xml',
2987
2987
  isValid(value, settings, schema) {
@@ -2993,17 +2993,17 @@ const XmlFormatDefinition = {
2993
2993
  heal(value, settings, schema) {
2994
2994
  throw new Error('Not implemented');
2995
2995
  },
2996
- subvalueDefinitions: [],
2996
+ subvalueParsers: [],
2997
2997
  };
2998
2998
  /**
2999
2999
  * TODO: [🧠] Maybe propper instance of object
3000
3000
  * TODO: [0] Make string_serialized_xml
3001
3001
  * TODO: [1] Make type for XML Settings and Schema
3002
3002
  * TODO: [🧠] What to use for validating XMLs - XSD,...
3003
- * TODO: [🍓] In `XmlFormatDefinition` implement simple `isValid`
3004
- * TODO: [🍓] In `XmlFormatDefinition` implement partial `canBeValid`
3005
- * TODO: [🍓] In `XmlFormatDefinition` implement `heal
3006
- * TODO: [🍓] In `XmlFormatDefinition` implement `subvalueDefinitions`
3003
+ * TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
3004
+ * TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
3005
+ * TODO: [🍓] In `XmlFormatParser` implement `heal
3006
+ * TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
3007
3007
  * TODO: [🏢] Allow to expect something inside XML and other formats
3008
3008
  */
3009
3009
 
@@ -3012,12 +3012,7 @@ const XmlFormatDefinition = {
3012
3012
  *
3013
3013
  * @private internal index of `...` <- TODO [🏢]
3014
3014
  */
3015
- const FORMAT_DEFINITIONS = [
3016
- JsonFormatDefinition,
3017
- XmlFormatDefinition,
3018
- TextFormatDefinition,
3019
- CsvFormatDefinition,
3020
- ];
3015
+ const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
3021
3016
  /**
3022
3017
  * Note: [💞] Ignore a discrepancy between file name and entity name
3023
3018
  */
@@ -3379,7 +3374,7 @@ function extractJsonBlock(markdown) {
3379
3374
  }
3380
3375
  /**
3381
3376
  * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
3382
- * TODO: [🏢] Make this logic part of `JsonFormatDefinition` or `isValidJsonString`
3377
+ * TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
3383
3378
  */
3384
3379
 
3385
3380
  /**
@@ -3878,7 +3873,7 @@ const CountUtils = {
3878
3873
  PAGES: countPages,
3879
3874
  };
3880
3875
  /**
3881
- * TODO: [🧠][🤠] This should be probbably as part of `TextFormatDefinition`
3876
+ * TODO: [🧠][🤠] This should be probbably as part of `TextFormatParser`
3882
3877
  * Note: [💞] Ignore a discrepancy between file name and entity name
3883
3878
  */
3884
3879
 
@@ -3928,7 +3923,7 @@ function isPassingExpectations(expectations, value) {
3928
3923
  }
3929
3924
  /**
3930
3925
  * TODO: [💝] Unite object for expecting amount and format
3931
- * TODO: [🧠][🤠] This should be part of `TextFormatDefinition`
3926
+ * TODO: [🧠][🤠] This should be part of `TextFormatParser`
3932
3927
  * Note: [💝] and [🤠] are interconnected together
3933
3928
  */
3934
3929
 
@@ -4156,7 +4151,7 @@ async function executeAttempts(options) {
4156
4151
  if (task.format) {
4157
4152
  if (task.format === 'JSON') {
4158
4153
  if (!isValidJsonString($ongoingTaskResult.$resultString || '')) {
4159
- // TODO: [🏢] Do more universally via `FormatDefinition`
4154
+ // TODO: [🏢] Do more universally via `FormatParser`
4160
4155
  try {
4161
4156
  $ongoingTaskResult.$resultString = extractJsonBlock($ongoingTaskResult.$resultString || '');
4162
4157
  }
@@ -4294,16 +4289,16 @@ async function executeFormatSubvalues(options) {
4294
4289
  ${block(pipelineIdentification)}
4295
4290
  `));
4296
4291
  }
4297
- const subvalueDefinition = formatDefinition.subvalueDefinitions.find((subvalueDefinition) => [subvalueDefinition.subvalueName, ...(subvalueDefinition.aliases || [])].includes(task.foreach.subformatName));
4298
- if (subvalueDefinition === undefined) {
4292
+ const subvalueParser = formatDefinition.subvalueParsers.find((subvalueParser) => [subvalueParser.subvalueName, ...(subvalueParser.aliases || [])].includes(task.foreach.subformatName));
4293
+ if (subvalueParser === undefined) {
4299
4294
  throw new UnexpectedError(
4300
4295
  // <- TODO: [🧠][🧐] Should be formats fixed per promptbook version or behave as plugins (=> change UnexpectedError)
4301
4296
  spaceTrim((block) => `
4302
4297
  Unsupported subformat name "${task.foreach.subformatName}" for format "${task.foreach.formatName}"
4303
4298
 
4304
4299
  Available subformat names for format "${formatDefinition.formatName}":
4305
- ${block(formatDefinition.subvalueDefinitions
4306
- .map((subvalueDefinition) => subvalueDefinition.subvalueName)
4300
+ ${block(formatDefinition.subvalueParsers
4301
+ .map((subvalueParser) => subvalueParser.subvalueName)
4307
4302
  .map((subvalueName) => `- ${subvalueName}`)
4308
4303
  .join('\n'))}
4309
4304
 
@@ -4317,7 +4312,7 @@ async function executeFormatSubvalues(options) {
4317
4312
  formatSettings = csvSettings;
4318
4313
  // <- TODO: [🤹‍♂️] More universal, make simmilar pattern for other formats for example \n vs \r\n in text
4319
4314
  }
4320
- const resultString = await subvalueDefinition.mapValues(parameterValue, task.foreach.outputSubparameterName, formatSettings, async (subparameters, index) => {
4315
+ const resultString = await subvalueParser.mapValues(parameterValue, task.foreach.outputSubparameterName, formatSettings, async (subparameters, index) => {
4321
4316
  let mappedParameters;
4322
4317
  // TODO: [🤹‍♂️][🪂] Limit to N concurrent executions
4323
4318
  // TODO: When done [🐚] Report progress also for each subvalue here
@@ -4379,6 +4374,27 @@ async function getExamplesForTask(task) {
4379
4374
  return RESERVED_PARAMETER_MISSING_VALUE /* <- TODO: [♨] Implement */;
4380
4375
  }
4381
4376
 
4377
+ /**
4378
+ * Computes the cosine similarity between two embedding vectors
4379
+ *
4380
+ * Note: This is helping function for RAG (retrieval-augmented generation)
4381
+ *
4382
+ * @param embeddingVector1
4383
+ * @param embeddingVector2
4384
+ * @returns Cosine similarity between the two vectors
4385
+ *
4386
+ * @public exported from `@promptbook/core`
4387
+ */
4388
+ function computeCosineSimilarity(embeddingVector1, embeddingVector2) {
4389
+ if (embeddingVector1.length !== embeddingVector2.length) {
4390
+ throw new TypeError('Embedding vectors must have the same length');
4391
+ }
4392
+ const dotProduct = embeddingVector1.reduce((sum, value, index) => sum + value * embeddingVector2[index], 0);
4393
+ const magnitude1 = Math.sqrt(embeddingVector1.reduce((sum, value) => sum + value * value, 0));
4394
+ const magnitude2 = Math.sqrt(embeddingVector2.reduce((sum, value) => sum + value * value, 0));
4395
+ return 1 - dotProduct / (magnitude1 * magnitude2);
4396
+ }
4397
+
4382
4398
  /**
4383
4399
  * @@@
4384
4400
  *
@@ -4405,7 +4421,7 @@ async function getKnowledgeForTask(options) {
4405
4421
  },
4406
4422
  content: task.content,
4407
4423
  parameters: {
4408
- /* !!!!!!!! */
4424
+ /* !!!! */
4409
4425
  },
4410
4426
  };
4411
4427
  const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
@@ -4440,16 +4456,6 @@ async function getKnowledgeForTask(options) {
4440
4456
  return knowledgePiecesLimited.map(({ content }) => `- ${content}`).join('\n');
4441
4457
  // <- TODO: [🧠] Some smart aggregation of knowledge pieces, single-line vs multi-line vs mixed
4442
4458
  }
4443
- // TODO: !!!!!! Annotate + to new file
4444
- function computeCosineSimilarity(embeddingVector1, embeddingVector2) {
4445
- if (embeddingVector1.length !== embeddingVector2.length) {
4446
- throw new TypeError('Embedding vectors must have the same length');
4447
- }
4448
- const dotProduct = embeddingVector1.reduce((sum, value, index) => sum + value * embeddingVector2[index], 0);
4449
- const magnitude1 = Math.sqrt(embeddingVector1.reduce((sum, value) => sum + value * value, 0));
4450
- const magnitude2 = Math.sqrt(embeddingVector2.reduce((sum, value) => sum + value * value, 0));
4451
- return 1 - dotProduct / (magnitude1 * magnitude2);
4452
- }
4453
4459
  /**
4454
4460
  * TODO: !!!! Verify if this is working
4455
4461
  * TODO: [♨] Implement Better - use keyword search
@@ -4658,6 +4664,7 @@ async function executePipeline(options) {
4658
4664
  * Note: This is a flag to prevent `onProgress` call after the pipeline execution is finished
4659
4665
  */
4660
4666
  let isReturned = false;
4667
+ console.log(`!!! preparedPipeline`, preparedPipeline);
4661
4668
  // Note: Check that all input input parameters are defined
4662
4669
  for (const parameter of preparedPipeline.parameters.filter(({ isInput }) => isInput)) {
4663
4670
  if (inputParameters[parameter.name] === undefined) {
@@ -4952,6 +4959,22 @@ function createPipelineExecutor(options) {
4952
4959
  cacheDirname,
4953
4960
  intermediateFilesStrategy,
4954
4961
  isAutoInstalled,
4962
+ }).catch((error) => {
4963
+ assertsError(error);
4964
+ return exportJson({
4965
+ name: 'pipelineExecutorResult',
4966
+ message: `Unuccessful PipelineExecutorResult, last catch`,
4967
+ order: [],
4968
+ value: {
4969
+ isSuccessful: false,
4970
+ errors: [serializeError(error)],
4971
+ warnings: [],
4972
+ usage: UNCERTAIN_USAGE,
4973
+ executionReport: null,
4974
+ outputParameters: {},
4975
+ preparedPipeline,
4976
+ },
4977
+ });
4955
4978
  });
4956
4979
  };
4957
4980
  const pipelineExecutor = (inputParameters) => createTask({
@@ -6942,14 +6965,14 @@ const foreachCommandParser = {
6942
6965
  `));
6943
6966
  // <- TODO: [🏢] List all supported format names
6944
6967
  }
6945
- const subvalueDefinition = formatDefinition.subvalueDefinitions.find((subvalueDefinition) => [subvalueDefinition.subvalueName, ...(subvalueDefinition.aliases || [])].includes(subformatName));
6946
- if (subvalueDefinition === undefined) {
6968
+ const subvalueParser = formatDefinition.subvalueParsers.find((subvalueParser) => [subvalueParser.subvalueName, ...(subvalueParser.aliases || [])].includes(subformatName));
6969
+ if (subvalueParser === undefined) {
6947
6970
  throw new ParseError(spaceTrim((block) => `
6948
6971
  Unsupported subformat name "${subformatName}" for format "${formatName}"
6949
6972
 
6950
6973
  Available subformat names for format "${formatDefinition.formatName}":
6951
- ${block(formatDefinition.subvalueDefinitions
6952
- .map((subvalueDefinition) => subvalueDefinition.subvalueName)
6974
+ ${block(formatDefinition.subvalueParsers
6975
+ .map((subvalueParser) => subvalueParser.subvalueName)
6953
6976
  .map((subvalueName) => `- ${subvalueName}`)
6954
6977
  .join('\n'))}
6955
6978
  `));
@@ -11327,5 +11350,5 @@ class PrefixStorage {
11327
11350
  }
11328
11351
  }
11329
11352
 
11330
- export { $llmToolsMetadataRegister, $llmToolsRegister, $scrapersMetadataRegister, $scrapersRegister, ADMIN_EMAIL, ADMIN_GITHUB_NAME, AbstractFormatError, AuthenticationError, BOOK_LANGUAGE_VERSION, BlackholeStorage, BoilerplateError, BoilerplateFormfactorDefinition, CLAIM, CLI_APP_ID, CallbackInterfaceTools, ChatbotFormfactorDefinition, CollectionError, CsvFormatDefinition, CsvFormatError, DEFAULT_BOOKS_DIRNAME, DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, DEFAULT_BOOK_TITLE, DEFAULT_CSV_SETTINGS, DEFAULT_DOWNLOAD_CACHE_DIRNAME, DEFAULT_EXECUTION_CACHE_DIRNAME, DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME, DEFAULT_INTERMEDIATE_FILES_STRATEGY, DEFAULT_IS_AUTO_INSTALLED, DEFAULT_IS_VERBOSE, DEFAULT_MAX_EXECUTION_ATTEMPTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, DEFAULT_MAX_PARALLEL_COUNT, DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME, DEFAULT_PROMPT_TASK_TITLE, DEFAULT_REMOTE_SERVER_URL, DEFAULT_SCRAPE_CACHE_DIRNAME, DEFAULT_TASK_TITLE, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, FORMFACTOR_DEFINITIONS, GENERIC_PIPELINE_INTERFACE, GeneratorFormfactorDefinition, GenericFormfactorDefinition, ImageGeneratorFormfactorDefinition, KnowledgeScrapeError, LimitReachedError, MANDATORY_CSV_SETTINGS, MAX_FILENAME_LENGTH, MODEL_ORDER, MODEL_TRUST_LEVEL, MODEL_VARIANTS, MatcherFormfactorDefinition, MemoryStorage, MissingToolsError, MultipleLlmExecutionTools, NAME, NonTaskSectionTypes, NotFoundError, NotYetImplementedError, ORDER_OF_PIPELINE_JSON, PLAYGROUND_APP_ID, PROMPTBOOK_ENGINE_VERSION, PROMPTBOOK_ERRORS, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, PromptbookFetchError, REMOTE_SERVER_URLS, RESERVED_PARAMETER_NAMES, SET_IS_VERBOSE, SectionTypes, SheetsFormfactorDefinition, TaskTypes, TextFormatDefinition, TranslatorFormfactorDefinition, UNCERTAIN_USAGE, UNCERTAIN_ZERO_VALUE, UnexpectedError, WrappedError, ZERO_USAGE, ZERO_VALUE, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _BoilerplateScraperMetadataRegistration, _DeepseekMetadataRegistration, _DocumentScraperMetadataRegistration, _GoogleMetadataRegistration, _LegacyDocumentScraperMetadataRegistration, _MarkdownScraperMetadataRegistration, _MarkitdownScraperMetadataRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiMetadataRegistration, _PdfScraperMetadataRegistration, _WebsiteScraperMetadataRegistration, addUsage, book, cacheLlmTools, collectionToJson, compilePipeline, countUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, extractParameterNamesFromTask, filterModels, getPipelineInterface, identificationToPromptbookToken, isPassingExpectations, isPipelineImplementingInterface, isPipelineInterfacesEqual, isPipelinePrepared, isValidPipelineString, joinLlmExecutionTools, limitTotalUsage, makeKnowledgeSourceHandler, parsePipeline, pipelineJsonToString, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTasks, prettifyPipelineString, promptbookFetch, promptbookTokenToIdentification, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline, validatePipelineString };
11353
+ export { $llmToolsMetadataRegister, $llmToolsRegister, $scrapersMetadataRegister, $scrapersRegister, ADMIN_EMAIL, ADMIN_GITHUB_NAME, AbstractFormatError, AuthenticationError, BOOK_LANGUAGE_VERSION, BlackholeStorage, BoilerplateError, BoilerplateFormfactorDefinition, CLAIM, CLI_APP_ID, CallbackInterfaceTools, ChatbotFormfactorDefinition, CollectionError, CsvFormatError, CsvFormatParser, DEFAULT_BOOKS_DIRNAME, DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, DEFAULT_BOOK_TITLE, DEFAULT_CSV_SETTINGS, DEFAULT_DOWNLOAD_CACHE_DIRNAME, DEFAULT_EXECUTION_CACHE_DIRNAME, DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME, DEFAULT_INTERMEDIATE_FILES_STRATEGY, DEFAULT_IS_AUTO_INSTALLED, DEFAULT_IS_VERBOSE, DEFAULT_MAX_EXECUTION_ATTEMPTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, DEFAULT_MAX_PARALLEL_COUNT, DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME, DEFAULT_PROMPT_TASK_TITLE, DEFAULT_REMOTE_SERVER_URL, DEFAULT_SCRAPE_CACHE_DIRNAME, DEFAULT_TASK_TITLE, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, FORMFACTOR_DEFINITIONS, GENERIC_PIPELINE_INTERFACE, GeneratorFormfactorDefinition, GenericFormfactorDefinition, ImageGeneratorFormfactorDefinition, KnowledgeScrapeError, LimitReachedError, MANDATORY_CSV_SETTINGS, MAX_FILENAME_LENGTH, MODEL_ORDER, MODEL_TRUST_LEVEL, MODEL_VARIANTS, MatcherFormfactorDefinition, MemoryStorage, MissingToolsError, MultipleLlmExecutionTools, NAME, NonTaskSectionTypes, NotFoundError, NotYetImplementedError, ORDER_OF_PIPELINE_JSON, PLAYGROUND_APP_ID, PROMPTBOOK_ENGINE_VERSION, PROMPTBOOK_ERRORS, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, PromptbookFetchError, REMOTE_SERVER_URLS, RESERVED_PARAMETER_NAMES, SET_IS_VERBOSE, SectionTypes, SheetsFormfactorDefinition, TaskTypes, TextFormatParser, TranslatorFormfactorDefinition, UNCERTAIN_USAGE, UNCERTAIN_ZERO_VALUE, UnexpectedError, WrappedError, ZERO_USAGE, ZERO_VALUE, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _BoilerplateScraperMetadataRegistration, _DeepseekMetadataRegistration, _DocumentScraperMetadataRegistration, _GoogleMetadataRegistration, _LegacyDocumentScraperMetadataRegistration, _MarkdownScraperMetadataRegistration, _MarkitdownScraperMetadataRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiMetadataRegistration, _PdfScraperMetadataRegistration, _WebsiteScraperMetadataRegistration, addUsage, book, cacheLlmTools, collectionToJson, compilePipeline, computeCosineSimilarity, countUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, extractParameterNamesFromTask, filterModels, getPipelineInterface, identificationToPromptbookToken, isPassingExpectations, isPipelineImplementingInterface, isPipelineInterfacesEqual, isPipelinePrepared, isValidPipelineString, joinLlmExecutionTools, limitTotalUsage, makeKnowledgeSourceHandler, parsePipeline, pipelineJsonToString, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTasks, prettifyPipelineString, promptbookFetch, promptbookTokenToIdentification, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline, validatePipelineString };
11331
11354
  //# sourceMappingURL=index.es.js.map