@promptbook/markdown-utils 0.92.0-17 → 0.92.0-19
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 +13 -8
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +7 -0
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +7 -0
- package/package.json +1 -1
- package/umd/index.umd.js +13 -8
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -25,7 +25,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-19';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1771,12 +1771,18 @@ function isPipelinePrepared(pipeline) {
|
|
|
1771
1771
|
// Note: Ignoring `pipeline.preparations` @@@
|
|
1772
1772
|
// Note: Ignoring `pipeline.knowledgePieces` @@@
|
|
1773
1773
|
if (pipeline.title === undefined || pipeline.title === '' || pipeline.title === DEFAULT_BOOK_TITLE) {
|
|
1774
|
+
// TODO: !!! Comment this out
|
|
1775
|
+
console.log('Pipeline is not prepared because title is undefined or empty', pipeline);
|
|
1774
1776
|
return false;
|
|
1775
1777
|
}
|
|
1776
1778
|
if (!pipeline.personas.every((persona) => persona.modelsRequirements !== undefined)) {
|
|
1779
|
+
// TODO: !!! Comment this out
|
|
1780
|
+
console.log('Pipeline is not prepared because personas are not prepared', pipeline.personas);
|
|
1777
1781
|
return false;
|
|
1778
1782
|
}
|
|
1779
1783
|
if (!pipeline.knowledgeSources.every((knowledgeSource) => knowledgeSource.preparationIds !== undefined)) {
|
|
1784
|
+
// TODO: !!! Comment this out
|
|
1785
|
+
console.log('Pipeline is not prepared because knowledge sources are not prepared', pipeline.knowledgeSources);
|
|
1780
1786
|
return false;
|
|
1781
1787
|
}
|
|
1782
1788
|
/*
|
|
@@ -5218,7 +5224,7 @@ function knowledgePiecesToString(knowledgePieces) {
|
|
|
5218
5224
|
* @private internal utility of `createPipelineExecutor`
|
|
5219
5225
|
*/
|
|
5220
5226
|
async function getKnowledgeForTask(options) {
|
|
5221
|
-
const { tools, preparedPipeline, task } = options;
|
|
5227
|
+
const { tools, preparedPipeline, task, parameters } = options;
|
|
5222
5228
|
const firstKnowlegePiece = preparedPipeline.knowledgePieces[0];
|
|
5223
5229
|
const firstKnowlegeIndex = firstKnowlegePiece === null || firstKnowlegePiece === void 0 ? void 0 : firstKnowlegePiece.index[0];
|
|
5224
5230
|
// <- TODO: Do not use just first knowledge piece and first index to determine embedding model, use also keyword search
|
|
@@ -5236,9 +5242,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5236
5242
|
modelName: firstKnowlegeIndex.modelName,
|
|
5237
5243
|
},
|
|
5238
5244
|
content: task.content,
|
|
5239
|
-
parameters
|
|
5240
|
-
/* !!!! */
|
|
5241
|
-
},
|
|
5245
|
+
parameters,
|
|
5242
5246
|
};
|
|
5243
5247
|
const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
|
|
5244
5248
|
const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
|
|
@@ -5290,9 +5294,9 @@ async function getKnowledgeForTask(options) {
|
|
|
5290
5294
|
* @private internal utility of `createPipelineExecutor`
|
|
5291
5295
|
*/
|
|
5292
5296
|
async function getReservedParametersForTask(options) {
|
|
5293
|
-
const { tools, preparedPipeline, task, pipelineIdentification } = options;
|
|
5297
|
+
const { tools, preparedPipeline, task, parameters, pipelineIdentification } = options;
|
|
5294
5298
|
const context = await getContextForTask(); // <- [🏍]
|
|
5295
|
-
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task });
|
|
5299
|
+
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task, parameters });
|
|
5296
5300
|
const examples = await getExamplesForTask();
|
|
5297
5301
|
const currentDate = new Date().toISOString(); // <- TODO: [🧠][💩] Better
|
|
5298
5302
|
const modelName = RESERVED_PARAMETER_MISSING_VALUE;
|
|
@@ -5334,7 +5338,7 @@ async function executeTask(options) {
|
|
|
5334
5338
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5335
5339
|
const dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5336
5340
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
5337
|
-
if (union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)).size !== 0) {
|
|
5341
|
+
if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
|
|
5338
5342
|
throw new UnexpectedError(spaceTrim$1((block) => `
|
|
5339
5343
|
Dependent parameters are not consistent with used parameters:
|
|
5340
5344
|
|
|
@@ -5358,6 +5362,7 @@ async function executeTask(options) {
|
|
|
5358
5362
|
preparedPipeline,
|
|
5359
5363
|
task: currentTask,
|
|
5360
5364
|
pipelineIdentification,
|
|
5365
|
+
parameters: parametersToPass,
|
|
5361
5366
|
})),
|
|
5362
5367
|
...parametersToPass,
|
|
5363
5368
|
});
|