@promptbook/remote-server 0.98.0-9 → 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 +0 -4
- package/esm/index.es.js +43 -43
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +61 -40
- package/umd/index.umd.js +43 -43
- package/umd/index.umd.js.map +1 -1
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/remote-server`
|
|
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
|
@@ -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.98.0
|
|
36
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.98.0';
|
|
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
|
|
@@ -6366,6 +6366,46 @@ function createPipelineExecutor(options) {
|
|
|
6366
6366
|
return pipelineExecutor;
|
|
6367
6367
|
}
|
|
6368
6368
|
|
|
6369
|
+
/**
|
|
6370
|
+
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
6371
|
+
*
|
|
6372
|
+
* Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
|
|
6373
|
+
*
|
|
6374
|
+
* @public exported from `@promptbook/utils`
|
|
6375
|
+
*/
|
|
6376
|
+
const $isRunningInBrowser = new Function(`
|
|
6377
|
+
try {
|
|
6378
|
+
return this === window;
|
|
6379
|
+
} catch (e) {
|
|
6380
|
+
return false;
|
|
6381
|
+
}
|
|
6382
|
+
`);
|
|
6383
|
+
/**
|
|
6384
|
+
* TODO: [🎺]
|
|
6385
|
+
*/
|
|
6386
|
+
|
|
6387
|
+
/**
|
|
6388
|
+
* Detects if the code is running in a web worker
|
|
6389
|
+
*
|
|
6390
|
+
* Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
|
|
6391
|
+
*
|
|
6392
|
+
* @public exported from `@promptbook/utils`
|
|
6393
|
+
*/
|
|
6394
|
+
const $isRunningInWebWorker = new Function(`
|
|
6395
|
+
try {
|
|
6396
|
+
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
|
6397
|
+
return true;
|
|
6398
|
+
} else {
|
|
6399
|
+
return false;
|
|
6400
|
+
}
|
|
6401
|
+
} catch (e) {
|
|
6402
|
+
return false;
|
|
6403
|
+
}
|
|
6404
|
+
`);
|
|
6405
|
+
/**
|
|
6406
|
+
* TODO: [🎺]
|
|
6407
|
+
*/
|
|
6408
|
+
|
|
6369
6409
|
/**
|
|
6370
6410
|
* Register for LLM tools.
|
|
6371
6411
|
*
|
|
@@ -6534,9 +6574,10 @@ function createLlmToolsFromConfiguration(configuration, options = {}) {
|
|
|
6534
6574
|
.list()
|
|
6535
6575
|
.find(({ packageName, className }) => llmConfiguration.packageName === packageName && llmConfiguration.className === className);
|
|
6536
6576
|
if (registeredItem === undefined) {
|
|
6537
|
-
console.log('
|
|
6577
|
+
// console.log('$llmToolsRegister.list()', $llmToolsRegister.list());
|
|
6538
6578
|
throw new Error(spaceTrim((block) => `
|
|
6539
6579
|
There is no constructor for LLM provider \`${llmConfiguration.className}\` from \`${llmConfiguration.packageName}\`
|
|
6580
|
+
Running in ${!$isRunningInBrowser() ? '' : 'browser environment'}${!$isRunningInNode() ? '' : 'node environment'}${!$isRunningInWebWorker() ? '' : 'worker environment'}
|
|
6540
6581
|
|
|
6541
6582
|
You have probably forgotten install and import the provider package.
|
|
6542
6583
|
To fix this issue, you can:
|
|
@@ -6654,24 +6695,6 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
|
|
|
6654
6695
|
* TODO: [🌺] Use some intermediate util splitWords
|
|
6655
6696
|
*/
|
|
6656
6697
|
|
|
6657
|
-
/**
|
|
6658
|
-
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
6659
|
-
*
|
|
6660
|
-
* Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
|
|
6661
|
-
*
|
|
6662
|
-
* @public exported from `@promptbook/utils`
|
|
6663
|
-
*/
|
|
6664
|
-
new Function(`
|
|
6665
|
-
try {
|
|
6666
|
-
return this === window;
|
|
6667
|
-
} catch (e) {
|
|
6668
|
-
return false;
|
|
6669
|
-
}
|
|
6670
|
-
`);
|
|
6671
|
-
/**
|
|
6672
|
-
* TODO: [🎺]
|
|
6673
|
-
*/
|
|
6674
|
-
|
|
6675
6698
|
/**
|
|
6676
6699
|
* Detects if the code is running in jest environment
|
|
6677
6700
|
*
|
|
@@ -6690,28 +6713,6 @@ new Function(`
|
|
|
6690
6713
|
* TODO: [🎺]
|
|
6691
6714
|
*/
|
|
6692
6715
|
|
|
6693
|
-
/**
|
|
6694
|
-
* Detects if the code is running in a web worker
|
|
6695
|
-
*
|
|
6696
|
-
* Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
|
|
6697
|
-
*
|
|
6698
|
-
* @public exported from `@promptbook/utils`
|
|
6699
|
-
*/
|
|
6700
|
-
new Function(`
|
|
6701
|
-
try {
|
|
6702
|
-
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
|
6703
|
-
return true;
|
|
6704
|
-
} else {
|
|
6705
|
-
return false;
|
|
6706
|
-
}
|
|
6707
|
-
} catch (e) {
|
|
6708
|
-
return false;
|
|
6709
|
-
}
|
|
6710
|
-
`);
|
|
6711
|
-
/**
|
|
6712
|
-
* TODO: [🎺]
|
|
6713
|
-
*/
|
|
6714
|
-
|
|
6715
6716
|
/**
|
|
6716
6717
|
* Makes first letter of a string uppercase
|
|
6717
6718
|
*
|
|
@@ -8303,7 +8304,6 @@ function startRemoteServer(options) {
|
|
|
8303
8304
|
catch (error) {
|
|
8304
8305
|
assertsError(error);
|
|
8305
8306
|
socket.emit('error', serializeError(error));
|
|
8306
|
-
// <- TODO: [🚋] There is a problem with the remote server handling errors and sending them back to the client
|
|
8307
8307
|
}
|
|
8308
8308
|
finally {
|
|
8309
8309
|
socket.disconnect();
|