@promptbook/node 0.104.0 → 0.105.0-1
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 +4 -0
- package/esm/index.es.js +6 -3
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +17 -0
- package/esm/typings/src/commitments/IMPORT/IMPORT.d.ts +34 -0
- package/esm/typings/src/commitments/index.d.ts +2 -1
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/errors/utils/deserializeError.d.ts +1 -1
- package/esm/typings/src/execution/PromptResult.d.ts +24 -1
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +5 -0
- package/esm/typings/src/types/LlmToolDefinition.d.ts +8 -1
- package/esm/typings/src/types/Prompt.d.ts +13 -0
- package/esm/typings/src/utils/misc/parseNumber.d.ts +1 -1
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +4 -0
- package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +2 -1
- package/esm/typings/src/utils/random/$randomAgentRule.d.ts +14 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +6 -3
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,10 @@ Turn your company's scattered knowledge into AI ready Books
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
<blockquote style="color: #ff8811">
|
|
31
|
+
<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>.
|
|
32
|
+
</blockquote>
|
|
33
|
+
|
|
30
34
|
## 📦 Package `@promptbook/node`
|
|
31
35
|
|
|
32
36
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
package/esm/index.es.js
CHANGED
|
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
28
28
|
* @generated
|
|
29
29
|
* @see https://github.com/webgptorg/promptbook
|
|
30
30
|
*/
|
|
31
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
31
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-1';
|
|
32
32
|
/**
|
|
33
33
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
34
34
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2971,7 +2971,7 @@ function jsonStringsToJsons(object) {
|
|
|
2971
2971
|
*
|
|
2972
2972
|
* @public exported from `@promptbook/utils`
|
|
2973
2973
|
*/
|
|
2974
|
-
function deserializeError(error) {
|
|
2974
|
+
function deserializeError(error, isStackAddedToMessage = true) {
|
|
2975
2975
|
const { name, stack, id } = error; // Added id
|
|
2976
2976
|
let { message } = error;
|
|
2977
2977
|
let ErrorClass = ALL_ERRORS[error.name];
|
|
@@ -2979,7 +2979,7 @@ function deserializeError(error) {
|
|
|
2979
2979
|
ErrorClass = Error;
|
|
2980
2980
|
message = `${name}: ${message}`;
|
|
2981
2981
|
}
|
|
2982
|
-
if (stack !== undefined && stack !== '') {
|
|
2982
|
+
if (isStackAddedToMessage && stack !== undefined && stack !== '') {
|
|
2983
2983
|
message = spaceTrim$2((block) => `
|
|
2984
2984
|
${block(message)}
|
|
2985
2985
|
|
|
@@ -7790,6 +7790,9 @@ const EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRA
|
|
|
7790
7790
|
* @public exported from `@promptbook/utils`
|
|
7791
7791
|
*/
|
|
7792
7792
|
function parseNumber(value) {
|
|
7793
|
+
if (value === null || value === undefined) {
|
|
7794
|
+
return 0;
|
|
7795
|
+
}
|
|
7793
7796
|
const originalValue = value;
|
|
7794
7797
|
if (typeof value === 'number') {
|
|
7795
7798
|
value = value.toString(); // <- TODO: Maybe more efficient way to do this
|