@promptbook/pdf 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 +2 -2
- package/umd/index.umd.js +13 -8
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -26,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
26
26
|
* @generated
|
|
27
27
|
* @see https://github.com/webgptorg/promptbook
|
|
28
28
|
*/
|
|
29
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
29
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-19';
|
|
30
30
|
/**
|
|
31
31
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
32
32
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2111,12 +2111,18 @@ function isPipelinePrepared(pipeline) {
|
|
|
2111
2111
|
// Note: Ignoring `pipeline.preparations` @@@
|
|
2112
2112
|
// Note: Ignoring `pipeline.knowledgePieces` @@@
|
|
2113
2113
|
if (pipeline.title === undefined || pipeline.title === '' || pipeline.title === DEFAULT_BOOK_TITLE) {
|
|
2114
|
+
// TODO: !!! Comment this out
|
|
2115
|
+
console.log('Pipeline is not prepared because title is undefined or empty', pipeline);
|
|
2114
2116
|
return false;
|
|
2115
2117
|
}
|
|
2116
2118
|
if (!pipeline.personas.every((persona) => persona.modelsRequirements !== undefined)) {
|
|
2119
|
+
// TODO: !!! Comment this out
|
|
2120
|
+
console.log('Pipeline is not prepared because personas are not prepared', pipeline.personas);
|
|
2117
2121
|
return false;
|
|
2118
2122
|
}
|
|
2119
2123
|
if (!pipeline.knowledgeSources.every((knowledgeSource) => knowledgeSource.preparationIds !== undefined)) {
|
|
2124
|
+
// TODO: !!! Comment this out
|
|
2125
|
+
console.log('Pipeline is not prepared because knowledge sources are not prepared', pipeline.knowledgeSources);
|
|
2120
2126
|
return false;
|
|
2121
2127
|
}
|
|
2122
2128
|
/*
|
|
@@ -5248,7 +5254,7 @@ function knowledgePiecesToString(knowledgePieces) {
|
|
|
5248
5254
|
* @private internal utility of `createPipelineExecutor`
|
|
5249
5255
|
*/
|
|
5250
5256
|
async function getKnowledgeForTask(options) {
|
|
5251
|
-
const { tools, preparedPipeline, task } = options;
|
|
5257
|
+
const { tools, preparedPipeline, task, parameters } = options;
|
|
5252
5258
|
const firstKnowlegePiece = preparedPipeline.knowledgePieces[0];
|
|
5253
5259
|
const firstKnowlegeIndex = firstKnowlegePiece === null || firstKnowlegePiece === void 0 ? void 0 : firstKnowlegePiece.index[0];
|
|
5254
5260
|
// <- TODO: Do not use just first knowledge piece and first index to determine embedding model, use also keyword search
|
|
@@ -5266,9 +5272,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5266
5272
|
modelName: firstKnowlegeIndex.modelName,
|
|
5267
5273
|
},
|
|
5268
5274
|
content: task.content,
|
|
5269
|
-
parameters
|
|
5270
|
-
/* !!!! */
|
|
5271
|
-
},
|
|
5275
|
+
parameters,
|
|
5272
5276
|
};
|
|
5273
5277
|
const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
|
|
5274
5278
|
const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
|
|
@@ -5320,9 +5324,9 @@ async function getKnowledgeForTask(options) {
|
|
|
5320
5324
|
* @private internal utility of `createPipelineExecutor`
|
|
5321
5325
|
*/
|
|
5322
5326
|
async function getReservedParametersForTask(options) {
|
|
5323
|
-
const { tools, preparedPipeline, task, pipelineIdentification } = options;
|
|
5327
|
+
const { tools, preparedPipeline, task, parameters, pipelineIdentification } = options;
|
|
5324
5328
|
const context = await getContextForTask(); // <- [🏍]
|
|
5325
|
-
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task });
|
|
5329
|
+
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task, parameters });
|
|
5326
5330
|
const examples = await getExamplesForTask();
|
|
5327
5331
|
const currentDate = new Date().toISOString(); // <- TODO: [🧠][💩] Better
|
|
5328
5332
|
const modelName = RESERVED_PARAMETER_MISSING_VALUE;
|
|
@@ -5364,7 +5368,7 @@ async function executeTask(options) {
|
|
|
5364
5368
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5365
5369
|
const dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5366
5370
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
5367
|
-
if (union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)).size !== 0) {
|
|
5371
|
+
if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
|
|
5368
5372
|
throw new UnexpectedError(spaceTrim$1((block) => `
|
|
5369
5373
|
Dependent parameters are not consistent with used parameters:
|
|
5370
5374
|
|
|
@@ -5388,6 +5392,7 @@ async function executeTask(options) {
|
|
|
5388
5392
|
preparedPipeline,
|
|
5389
5393
|
task: currentTask,
|
|
5390
5394
|
pipelineIdentification,
|
|
5395
|
+
parameters: parametersToPass,
|
|
5391
5396
|
})),
|
|
5392
5397
|
...parametersToPass,
|
|
5393
5398
|
});
|