@promptbook/remote-server 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
|
@@ -33,7 +33,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
33
33
|
* @generated
|
|
34
34
|
* @see https://github.com/webgptorg/promptbook
|
|
35
35
|
*/
|
|
36
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
36
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-19';
|
|
37
37
|
/**
|
|
38
38
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
39
39
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1785,12 +1785,18 @@ function isPipelinePrepared(pipeline) {
|
|
|
1785
1785
|
// Note: Ignoring `pipeline.preparations` @@@
|
|
1786
1786
|
// Note: Ignoring `pipeline.knowledgePieces` @@@
|
|
1787
1787
|
if (pipeline.title === undefined || pipeline.title === '' || pipeline.title === DEFAULT_BOOK_TITLE) {
|
|
1788
|
+
// TODO: !!! Comment this out
|
|
1789
|
+
console.log('Pipeline is not prepared because title is undefined or empty', pipeline);
|
|
1788
1790
|
return false;
|
|
1789
1791
|
}
|
|
1790
1792
|
if (!pipeline.personas.every((persona) => persona.modelsRequirements !== undefined)) {
|
|
1793
|
+
// TODO: !!! Comment this out
|
|
1794
|
+
console.log('Pipeline is not prepared because personas are not prepared', pipeline.personas);
|
|
1791
1795
|
return false;
|
|
1792
1796
|
}
|
|
1793
1797
|
if (!pipeline.knowledgeSources.every((knowledgeSource) => knowledgeSource.preparationIds !== undefined)) {
|
|
1798
|
+
// TODO: !!! Comment this out
|
|
1799
|
+
console.log('Pipeline is not prepared because knowledge sources are not prepared', pipeline.knowledgeSources);
|
|
1794
1800
|
return false;
|
|
1795
1801
|
}
|
|
1796
1802
|
/*
|
|
@@ -5583,7 +5589,7 @@ function knowledgePiecesToString(knowledgePieces) {
|
|
|
5583
5589
|
* @private internal utility of `createPipelineExecutor`
|
|
5584
5590
|
*/
|
|
5585
5591
|
async function getKnowledgeForTask(options) {
|
|
5586
|
-
const { tools, preparedPipeline, task } = options;
|
|
5592
|
+
const { tools, preparedPipeline, task, parameters } = options;
|
|
5587
5593
|
const firstKnowlegePiece = preparedPipeline.knowledgePieces[0];
|
|
5588
5594
|
const firstKnowlegeIndex = firstKnowlegePiece === null || firstKnowlegePiece === void 0 ? void 0 : firstKnowlegePiece.index[0];
|
|
5589
5595
|
// <- TODO: Do not use just first knowledge piece and first index to determine embedding model, use also keyword search
|
|
@@ -5601,9 +5607,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5601
5607
|
modelName: firstKnowlegeIndex.modelName,
|
|
5602
5608
|
},
|
|
5603
5609
|
content: task.content,
|
|
5604
|
-
parameters
|
|
5605
|
-
/* !!!! */
|
|
5606
|
-
},
|
|
5610
|
+
parameters,
|
|
5607
5611
|
};
|
|
5608
5612
|
const taskEmbeddingResult = await llmTools.callEmbeddingModel(taskEmbeddingPrompt);
|
|
5609
5613
|
const knowledgePiecesWithRelevance = preparedPipeline.knowledgePieces.map((knowledgePiece) => {
|
|
@@ -5655,9 +5659,9 @@ async function getKnowledgeForTask(options) {
|
|
|
5655
5659
|
* @private internal utility of `createPipelineExecutor`
|
|
5656
5660
|
*/
|
|
5657
5661
|
async function getReservedParametersForTask(options) {
|
|
5658
|
-
const { tools, preparedPipeline, task, pipelineIdentification } = options;
|
|
5662
|
+
const { tools, preparedPipeline, task, parameters, pipelineIdentification } = options;
|
|
5659
5663
|
const context = await getContextForTask(); // <- [🏍]
|
|
5660
|
-
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task });
|
|
5664
|
+
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task, parameters });
|
|
5661
5665
|
const examples = await getExamplesForTask();
|
|
5662
5666
|
const currentDate = new Date().toISOString(); // <- TODO: [🧠][💩] Better
|
|
5663
5667
|
const modelName = RESERVED_PARAMETER_MISSING_VALUE;
|
|
@@ -5699,7 +5703,7 @@ async function executeTask(options) {
|
|
|
5699
5703
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5700
5704
|
const dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5701
5705
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
5702
|
-
if (union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)).size !== 0) {
|
|
5706
|
+
if (difference(union(difference(usedParameterNames, dependentParameterNames), difference(dependentParameterNames, usedParameterNames)), new Set(RESERVED_PARAMETER_NAMES)).size !== 0) {
|
|
5703
5707
|
throw new UnexpectedError(spaceTrim$1((block) => `
|
|
5704
5708
|
Dependent parameters are not consistent with used parameters:
|
|
5705
5709
|
|
|
@@ -5723,6 +5727,7 @@ async function executeTask(options) {
|
|
|
5723
5727
|
preparedPipeline,
|
|
5724
5728
|
task: currentTask,
|
|
5725
5729
|
pipelineIdentification,
|
|
5730
|
+
parameters: parametersToPass,
|
|
5726
5731
|
})),
|
|
5727
5732
|
...parametersToPass,
|
|
5728
5733
|
});
|