@promptbook/node 0.98.0-8 → 0.98.0

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/README.md CHANGED
@@ -25,10 +25,6 @@ Write AI applications using plain human language across multiple models and plat
25
25
 
26
26
 
27
27
 
28
- <blockquote style="color: #ff8811">
29
- <b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
30
- </blockquote>
31
-
32
28
  ## 📦 Package `@promptbook/node`
33
29
 
34
30
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
package/esm/index.es.js CHANGED
@@ -30,7 +30,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
30
30
  * @generated
31
31
  * @see https://github.com/webgptorg/promptbook
32
32
  */
33
- const PROMPTBOOK_ENGINE_VERSION = '0.98.0-8';
33
+ const PROMPTBOOK_ENGINE_VERSION = '0.98.0';
34
34
  /**
35
35
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
36
36
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -10178,6 +10178,46 @@ async function $provideLlmToolsConfigurationFromEnv() {
10178
10178
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
10179
10179
  */
10180
10180
 
10181
+ /**
10182
+ * Detects if the code is running in a browser environment in main thread (Not in a web worker)
10183
+ *
10184
+ * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
10185
+ *
10186
+ * @public exported from `@promptbook/utils`
10187
+ */
10188
+ const $isRunningInBrowser = new Function(`
10189
+ try {
10190
+ return this === window;
10191
+ } catch (e) {
10192
+ return false;
10193
+ }
10194
+ `);
10195
+ /**
10196
+ * TODO: [🎺]
10197
+ */
10198
+
10199
+ /**
10200
+ * Detects if the code is running in a web worker
10201
+ *
10202
+ * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
10203
+ *
10204
+ * @public exported from `@promptbook/utils`
10205
+ */
10206
+ const $isRunningInWebWorker = new Function(`
10207
+ try {
10208
+ if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
10209
+ return true;
10210
+ } else {
10211
+ return false;
10212
+ }
10213
+ } catch (e) {
10214
+ return false;
10215
+ }
10216
+ `);
10217
+ /**
10218
+ * TODO: [🎺]
10219
+ */
10220
+
10181
10221
  /**
10182
10222
  * Creates LLM execution tools from provided configuration objects
10183
10223
  *
@@ -10198,8 +10238,10 @@ function createLlmToolsFromConfiguration(configuration, options = {}) {
10198
10238
  .list()
10199
10239
  .find(({ packageName, className }) => llmConfiguration.packageName === packageName && llmConfiguration.className === className);
10200
10240
  if (registeredItem === undefined) {
10241
+ // console.log('$llmToolsRegister.list()', $llmToolsRegister.list());
10201
10242
  throw new Error(spaceTrim((block) => `
10202
10243
  There is no constructor for LLM provider \`${llmConfiguration.className}\` from \`${llmConfiguration.packageName}\`
10244
+ Running in ${!$isRunningInBrowser() ? '' : 'browser environment'}${!$isRunningInNode() ? '' : 'node environment'}${!$isRunningInWebWorker() ? '' : 'worker environment'}
10203
10245
 
10204
10246
  You have probably forgotten install and import the provider package.
10205
10247
  To fix this issue, you can:
@@ -10326,24 +10368,6 @@ async function $provideScrapersForNode(tools, options) {
10326
10368
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
10327
10369
  */
10328
10370
 
10329
- /**
10330
- * Detects if the code is running in a browser environment in main thread (Not in a web worker)
10331
- *
10332
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
10333
- *
10334
- * @public exported from `@promptbook/utils`
10335
- */
10336
- new Function(`
10337
- try {
10338
- return this === window;
10339
- } catch (e) {
10340
- return false;
10341
- }
10342
- `);
10343
- /**
10344
- * TODO: [🎺]
10345
- */
10346
-
10347
10371
  /**
10348
10372
  * Detects if the code is running in jest environment
10349
10373
  *
@@ -10362,28 +10386,6 @@ new Function(`
10362
10386
  * TODO: [🎺]
10363
10387
  */
10364
10388
 
10365
- /**
10366
- * Detects if the code is running in a web worker
10367
- *
10368
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
10369
- *
10370
- * @public exported from `@promptbook/utils`
10371
- */
10372
- new Function(`
10373
- try {
10374
- if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
10375
- return true;
10376
- } else {
10377
- return false;
10378
- }
10379
- } catch (e) {
10380
- return false;
10381
- }
10382
- `);
10383
- /**
10384
- * TODO: [🎺]
10385
- */
10386
-
10387
10389
  /**
10388
10390
  * Makes first letter of a string uppercase
10389
10391
  *