@promptbook/node 0.81.0-16 → 0.81.0-17
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 +29 -21
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +9 -4
- package/esm/typings/src/formfactors/image-generator/ImageGeneratorFormfactorDefinition.d.ts +1 -1
- package/esm/typings/src/formfactors/index.d.ts +10 -5
- package/esm/typings/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +3 -0
- package/esm/typings/src/utils/markdown/{removeContentComments.d.ts → removeMarkdownComments.d.ts} +2 -2
- package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +29 -21
- package/umd/index.umd.js.map +1 -1
- /package/esm/typings/src/utils/markdown/{removeContentComments.test.d.ts → removeMarkdownComments.test.d.ts} +0 -0
package/esm/index.es.js
CHANGED
|
@@ -28,7 +28,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
28
28
|
* @generated
|
|
29
29
|
* @see https://github.com/webgptorg/promptbook
|
|
30
30
|
*/
|
|
31
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.81.0-
|
|
31
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.81.0-16';
|
|
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
|
|
@@ -525,7 +525,6 @@ function checkSerializableAsJson(options) {
|
|
|
525
525
|
function deepClone(objectValue) {
|
|
526
526
|
return JSON.parse(JSON.stringify(objectValue));
|
|
527
527
|
/*
|
|
528
|
-
!!!!!!!!
|
|
529
528
|
TODO: [🧠] Is there a better implementation?
|
|
530
529
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
531
530
|
> for (const propertyName of propertyNames) {
|
|
@@ -6992,20 +6991,24 @@ var ChatbotFormfactorDefinition = {
|
|
|
6992
6991
|
*/
|
|
6993
6992
|
var GeneratorFormfactorDefinition = {
|
|
6994
6993
|
name: 'GENERATOR',
|
|
6995
|
-
description: "
|
|
6994
|
+
description: "Generates any kind (in HTML with possible scripts and css format) of content from input message",
|
|
6996
6995
|
documentationUrl: "https://github.com/webgptorg/promptbook/discussions/184",
|
|
6997
6996
|
pipelineInterface: {
|
|
6998
6997
|
inputParameters: [
|
|
6999
|
-
/* @@@ */
|
|
7000
6998
|
{
|
|
7001
|
-
name: '
|
|
7002
|
-
description:
|
|
6999
|
+
name: 'inputMessage',
|
|
7000
|
+
description: "Input message to be image made from",
|
|
7003
7001
|
isInput: true,
|
|
7004
7002
|
isOutput: false,
|
|
7005
7003
|
},
|
|
7006
7004
|
],
|
|
7007
7005
|
outputParameters: [
|
|
7008
|
-
|
|
7006
|
+
{
|
|
7007
|
+
name: 'result',
|
|
7008
|
+
description: "Result in HTML to be shown to user",
|
|
7009
|
+
isInput: false,
|
|
7010
|
+
isOutput: true,
|
|
7011
|
+
},
|
|
7009
7012
|
],
|
|
7010
7013
|
},
|
|
7011
7014
|
};
|
|
@@ -7044,7 +7047,7 @@ var GenericFormfactorDefinition = {
|
|
|
7044
7047
|
*/
|
|
7045
7048
|
var ImageGeneratorFormfactorDefinition = {
|
|
7046
7049
|
name: 'IMAGE_GENERATOR',
|
|
7047
|
-
description: "
|
|
7050
|
+
description: "Generates prompt for image generation from input message",
|
|
7048
7051
|
documentationUrl: "https://github.com/webgptorg/promptbook/discussions/184",
|
|
7049
7052
|
pipelineInterface: {
|
|
7050
7053
|
inputParameters: [
|
|
@@ -8478,7 +8481,7 @@ var QuickChatbotHla = {
|
|
|
8478
8481
|
isOutput: true,
|
|
8479
8482
|
exampleValues: ['Hello, I am a Pavol`s virtual avatar. How can I help you?'],
|
|
8480
8483
|
});
|
|
8481
|
-
// TODO:
|
|
8484
|
+
// TODO: Use spaceTrim in multiline strings
|
|
8482
8485
|
$pipelineJson.tasks.push({
|
|
8483
8486
|
taskType: 'PROMPT_TASK',
|
|
8484
8487
|
name: 'create-an-answer',
|
|
@@ -8486,8 +8489,11 @@ var QuickChatbotHla = {
|
|
|
8486
8489
|
content: 'Write a response to the user message:\n\n**Question from user**\n\n> {userMessage}\n\n**Previous conversation**\n\n> {previousConversationSummary}',
|
|
8487
8490
|
resultingParameterName: 'chatbotResponse',
|
|
8488
8491
|
personaName: personaName,
|
|
8489
|
-
dependentParameterNames: [
|
|
8490
|
-
|
|
8492
|
+
dependentParameterNames: [
|
|
8493
|
+
'userMessage',
|
|
8494
|
+
'previousConversationSummary' /* TODO: [🧠][📛], 'knowledge'*/,
|
|
8495
|
+
],
|
|
8496
|
+
// TODO: [🧠][📛] preparedContent: '{content}\n\n## Knowledge\n\n{knowledge}',
|
|
8491
8497
|
}, {
|
|
8492
8498
|
taskType: 'PROMPT_TASK',
|
|
8493
8499
|
name: 'summarize-the-conversation',
|
|
@@ -8501,19 +8507,22 @@ var QuickChatbotHla = {
|
|
|
8501
8507
|
max: 10,
|
|
8502
8508
|
},
|
|
8503
8509
|
},
|
|
8504
|
-
dependentParameterNames: ['userMessage', 'chatbotResponse' /*
|
|
8505
|
-
//
|
|
8510
|
+
dependentParameterNames: ['userMessage', 'chatbotResponse' /* TODO: [🧠][📛], 'knowledge'*/],
|
|
8511
|
+
// TODO: [🧠][📛] preparedContent: '{content}\n\n## Knowledge\n\n{knowledge}',
|
|
8506
8512
|
}, {
|
|
8507
8513
|
taskType: 'SIMPLE_TASK',
|
|
8508
8514
|
name: 'title',
|
|
8509
8515
|
title: 'Title',
|
|
8510
8516
|
content: '{conversationSummary}',
|
|
8511
8517
|
resultingParameterName: 'title',
|
|
8512
|
-
dependentParameterNames: ['conversationSummary' /*
|
|
8513
|
-
//
|
|
8518
|
+
dependentParameterNames: ['conversationSummary' /* TODO: [🧠][📛], 'knowledge'*/],
|
|
8519
|
+
// TODO: [🧠][📛] preparedContent: '{content}\n\n## Knowledge\n\n{knowledge}',
|
|
8514
8520
|
});
|
|
8515
8521
|
},
|
|
8516
8522
|
};
|
|
8523
|
+
/**
|
|
8524
|
+
* TODO: [🧠][📛] Should this be here?
|
|
8525
|
+
*/
|
|
8517
8526
|
|
|
8518
8527
|
/**
|
|
8519
8528
|
* All high-level abstractions
|
|
@@ -8754,13 +8763,13 @@ function flattenMarkdown(markdown) {
|
|
|
8754
8763
|
*/
|
|
8755
8764
|
|
|
8756
8765
|
/**
|
|
8757
|
-
* Removes
|
|
8766
|
+
* Removes Markdown (or HTML) comments
|
|
8758
8767
|
*
|
|
8759
8768
|
* @param {string} content - The string to remove comments from.
|
|
8760
8769
|
* @returns {string} The input string with all comments removed.
|
|
8761
8770
|
* @public exported from `@promptbook/markdown-utils`
|
|
8762
8771
|
*/
|
|
8763
|
-
function
|
|
8772
|
+
function removeMarkdownComments(content) {
|
|
8764
8773
|
return spaceTrim$1(content.replace(/<!--(.*?)-->/gs, ''));
|
|
8765
8774
|
}
|
|
8766
8775
|
|
|
@@ -8845,7 +8854,7 @@ function precompilePipeline(pipelineString) {
|
|
|
8845
8854
|
}
|
|
8846
8855
|
pipelineString = restLines.join('\n');
|
|
8847
8856
|
}
|
|
8848
|
-
pipelineString =
|
|
8857
|
+
pipelineString = removeMarkdownComments(pipelineString);
|
|
8849
8858
|
pipelineString = spaceTrim$1(pipelineString);
|
|
8850
8859
|
// ==============
|
|
8851
8860
|
// Note: 1️⃣◽2️⃣ Process flat pipeline
|
|
@@ -9704,10 +9713,9 @@ function $provideLlmToolsConfigurationFromEnv() {
|
|
|
9704
9713
|
case 1:
|
|
9705
9714
|
if (!(i < LOOP_LIMIT)) return [3 /*break*/, 4];
|
|
9706
9715
|
envFilename = join(rootDirname, '.env' /* <- TODO: [🕝] Make here more candidates */);
|
|
9707
|
-
console.log({ rootDirname: rootDirname, envFilename: envFilename });
|
|
9708
9716
|
return [4 /*yield*/, isFileExisting(envFilename, $provideFilesystemForNode())];
|
|
9709
9717
|
case 2:
|
|
9710
|
-
//
|
|
9718
|
+
// console.log({ rootDirname, envFilename });
|
|
9711
9719
|
if (_a.sent()) {
|
|
9712
9720
|
dotenv.config({ path: envFilename });
|
|
9713
9721
|
return [3 /*break*/, 4];
|
|
@@ -10145,7 +10153,7 @@ function normalizeWhitespaces(sentence) {
|
|
|
10145
10153
|
return sentence.replace(/\s+/gs, ' ').trim();
|
|
10146
10154
|
}
|
|
10147
10155
|
|
|
10148
|
-
// <- TODO:
|
|
10156
|
+
// <- TODO: Auto convert to type `import { ... } from 'type-fest';`
|
|
10149
10157
|
/**
|
|
10150
10158
|
* Tests if the value is [🚉] serializable as JSON
|
|
10151
10159
|
*
|