@promptbook/website-crawler 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
|
@@ -29,7 +29,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
29
29
|
* @generated
|
|
30
30
|
* @see https://github.com/webgptorg/promptbook
|
|
31
31
|
*/
|
|
32
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
32
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-19';
|
|
33
33
|
/**
|
|
34
34
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
35
35
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2249,12 +2249,18 @@ function isPipelinePrepared(pipeline) {
|
|
|
2249
2249
|
// Note: Ignoring `pipeline.preparations` @@@
|
|
2250
2250
|
// Note: Ignoring `pipeline.knowledgePieces` @@@
|
|
2251
2251
|
if (pipeline.title === undefined || pipeline.title === '' || pipeline.title === DEFAULT_BOOK_TITLE) {
|
|
2252
|
+
// TODO: !!! Comment this out
|
|
2253
|
+
console.log('Pipeline is not prepared because title is undefined or empty', pipeline);
|
|
2252
2254
|
return false;
|
|
2253
2255
|
}
|
|
2254
2256
|
if (!pipeline.personas.every((persona) => persona.modelsRequirements !== undefined)) {
|
|
2257
|
+
// TODO: !!! Comment this out
|
|
2258
|
+
console.log('Pipeline is not prepared because personas are not prepared', pipeline.personas);
|
|
2255
2259
|
return false;
|
|
2256
2260
|
}
|
|
2257
2261
|
if (!pipeline.knowledgeSources.every((knowledgeSource) => knowledgeSource.preparationIds !== undefined)) {
|
|
2262
|
+
// TODO: !!! Comment this out
|
|
2263
|
+
console.log('Pipeline is not prepared because knowledge sources are not prepared', pipeline.knowledgeSources);
|
|
2258
2264
|
return false;
|
|
2259
2265
|
}
|
|
2260
2266
|
/*
|
|
@@ -5249,7 +5255,7 @@ function knowledgePiecesToString(knowledgePieces) {
|
|
|
5249
5255
|
* @private internal utility of `createPipelineExecutor`
|
|
5250
5256
|
*/
|
|
5251
5257
|
async function getKnowledgeForTask(options) {
|
|
5252
|
-
const { tools, preparedPipeline, task } = options;
|
|
5258
|
+
const { tools, preparedPipeline, task, parameters } = options;
|
|
5253
5259
|
const firstKnowlegePiece = preparedPipeline.knowledgePieces[0];
|
|
5254
5260
|
const firstKnowlegeIndex = firstKnowlegePiece === null || firstKnowlegePiece === void 0 ? void 0 : firstKnowlegePiece.index[0];
|
|
5255
5261
|
// <- TODO: Do not use just first knowledge piece and first index to determine embedding model, use also keyword search
|
|
@@ -5267,9 +5273,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5267
5273
|
modelName: firstKnowlegeIndex.modelName,
|
|
5268
5274
|
},
|
|
5269
5275
|
content: task.content,
|
|
5270
|
-
parameters
|
|
5271
|
-
/* !!!! */
|
|
5272
|
-
},
|
|
5276
|
+
parameters,
|
|
5273
5277
|
};
|
|
5274
5278
|
const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
|
|
5275
5279
|
const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
|
|
@@ -5321,9 +5325,9 @@ async function getKnowledgeForTask(options) {
|
|
|
5321
5325
|
* @private internal utility of `createPipelineExecutor`
|
|
5322
5326
|
*/
|
|
5323
5327
|
async function getReservedParametersForTask(options) {
|
|
5324
|
-
const { tools, preparedPipeline, task, pipelineIdentification } = options;
|
|
5328
|
+
const { tools, preparedPipeline, task, parameters, pipelineIdentification } = options;
|
|
5325
5329
|
const context = await getContextForTask(); // <- [🏍]
|
|
5326
|
-
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task });
|
|
5330
|
+
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task, parameters });
|
|
5327
5331
|
const examples = await getExamplesForTask();
|
|
5328
5332
|
const currentDate = new Date().toISOString(); // <- TODO: [🧠][💩] Better
|
|
5329
5333
|
const modelName = RESERVED_PARAMETER_MISSING_VALUE;
|
|
@@ -5365,7 +5369,7 @@ async function executeTask(options) {
|
|
|
5365
5369
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5366
5370
|
const dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5367
5371
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
5368
|
-
if (union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)).size !== 0) {
|
|
5372
|
+
if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
|
|
5369
5373
|
throw new UnexpectedError(spaceTrim((block) => `
|
|
5370
5374
|
Dependent parameters are not consistent with used parameters:
|
|
5371
5375
|
|
|
@@ -5389,6 +5393,7 @@ async function executeTask(options) {
|
|
|
5389
5393
|
preparedPipeline,
|
|
5390
5394
|
task: currentTask,
|
|
5391
5395
|
pipelineIdentification,
|
|
5396
|
+
parameters: parametersToPass,
|
|
5392
5397
|
})),
|
|
5393
5398
|
...parametersToPass,
|
|
5394
5399
|
});
|