@promptbook/cli 0.92.0-28 → 0.92.0-29
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 +10 -7
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +10 -7
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -47,7 +47,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
47
47
|
* @generated
|
|
48
48
|
* @see https://github.com/webgptorg/promptbook
|
|
49
49
|
*/
|
|
50
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
50
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-29';
|
|
51
51
|
/**
|
|
52
52
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
53
53
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -11463,13 +11463,16 @@ async function compilePipeline(pipelineString, tools, options) {
|
|
|
11463
11463
|
*/
|
|
11464
11464
|
function renderPromptbookMermaid(pipelineJson, options) {
|
|
11465
11465
|
const { linkTask = () => null } = options || {};
|
|
11466
|
+
const MERMAID_PREFIX = 'mermaid_';
|
|
11467
|
+
const KNOWLEDGE_NAME = MERMAID_PREFIX + 'knowledge';
|
|
11468
|
+
const RESERVED_NAME = MERMAID_PREFIX + 'reserved';
|
|
11466
11469
|
const parameterNameToTaskName = (parameterName) => {
|
|
11467
11470
|
if (parameterName === 'knowledge') {
|
|
11468
|
-
return
|
|
11471
|
+
return KNOWLEDGE_NAME;
|
|
11469
11472
|
// <- TODO: !!!! Check that this works
|
|
11470
11473
|
}
|
|
11471
11474
|
else if (RESERVED_PARAMETER_NAMES.includes(parameterName)) {
|
|
11472
|
-
return
|
|
11475
|
+
return RESERVED_NAME;
|
|
11473
11476
|
}
|
|
11474
11477
|
const parameter = pipelineJson.parameters.find((parameter) => parameter.name === parameterName);
|
|
11475
11478
|
if (!parameter) {
|
|
@@ -11477,13 +11480,13 @@ function renderPromptbookMermaid(pipelineJson, options) {
|
|
|
11477
11480
|
// <- TODO: !!6 This causes problems when {knowledge} and other reserved parameters are used
|
|
11478
11481
|
}
|
|
11479
11482
|
if (parameter.isInput) {
|
|
11480
|
-
return 'input';
|
|
11483
|
+
return MERMAID_PREFIX + 'input';
|
|
11481
11484
|
}
|
|
11482
11485
|
const task = pipelineJson.tasks.find((task) => task.resultingParameterName === parameterName);
|
|
11483
11486
|
if (!task) {
|
|
11484
11487
|
throw new Error(`Could not find task for {${parameterName}}`);
|
|
11485
11488
|
}
|
|
11486
|
-
return task.name || normalizeTo_camelCase('task-' + titleToName(task.title));
|
|
11489
|
+
return MERMAID_PREFIX + (task.name || normalizeTo_camelCase('task-' + titleToName(task.title)));
|
|
11487
11490
|
};
|
|
11488
11491
|
const promptbookMermaid = spaceTrim$1((block) => `
|
|
11489
11492
|
|
|
@@ -11495,8 +11498,8 @@ function renderPromptbookMermaid(pipelineJson, options) {
|
|
|
11495
11498
|
direction TB
|
|
11496
11499
|
|
|
11497
11500
|
input((Input)):::input
|
|
11498
|
-
|
|
11499
|
-
|
|
11501
|
+
${RESERVED_NAME}((Other)):::${RESERVED_NAME}
|
|
11502
|
+
${KNOWLEDGE_NAME}((Knowledgebase)):::${KNOWLEDGE_NAME}
|
|
11500
11503
|
${block(pipelineJson.tasks
|
|
11501
11504
|
.flatMap(({ title, dependentParameterNames, resultingParameterName }) => [
|
|
11502
11505
|
`${parameterNameToTaskName(resultingParameterName)}("${title}")`,
|