@promptbook/website-crawler 0.92.0-32 β 0.92.0-33
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 +31 -15
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/execution/ExecutionTask.d.ts +19 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +4 -4
- package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/utils/IndexedDbStorageOptions.d.ts +14 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +2 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +31 -15
- 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-33';
|
|
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
|
|
@@ -2630,6 +2630,7 @@ function assertsTaskSuccessful(executionResult) {
|
|
|
2630
2630
|
*/
|
|
2631
2631
|
function createTask(options) {
|
|
2632
2632
|
const { taskType, taskProcessCallback } = options;
|
|
2633
|
+
let { title } = options;
|
|
2633
2634
|
// TODO: [π] DRY
|
|
2634
2635
|
const taskId = `${taskType.toLowerCase().substring(0, 4)}-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid simmilar char conflicts */)}`;
|
|
2635
2636
|
let status = 'RUNNING';
|
|
@@ -2641,6 +2642,10 @@ function createTask(options) {
|
|
|
2641
2642
|
const partialResultSubject = new Subject();
|
|
2642
2643
|
// <- Note: Not using `BehaviorSubject` because on error we can't access the last value
|
|
2643
2644
|
const finalResultPromise = /* not await */ taskProcessCallback((newOngoingResult) => {
|
|
2645
|
+
if (newOngoingResult.title) {
|
|
2646
|
+
title = newOngoingResult.title;
|
|
2647
|
+
}
|
|
2648
|
+
updatedAt = new Date();
|
|
2644
2649
|
Object.assign(currentValue, newOngoingResult);
|
|
2645
2650
|
// <- TODO: assign deep
|
|
2646
2651
|
partialResultSubject.next(newOngoingResult);
|
|
@@ -2686,17 +2691,24 @@ function createTask(options) {
|
|
|
2686
2691
|
return {
|
|
2687
2692
|
taskType,
|
|
2688
2693
|
taskId,
|
|
2694
|
+
get promptbookVersion() {
|
|
2695
|
+
return PROMPTBOOK_ENGINE_VERSION;
|
|
2696
|
+
},
|
|
2697
|
+
get title() {
|
|
2698
|
+
return title;
|
|
2699
|
+
// <- Note: [1] Theese must be getters to allow changing the value in the future
|
|
2700
|
+
},
|
|
2689
2701
|
get status() {
|
|
2690
2702
|
return status;
|
|
2691
|
-
// <- Note: [1]
|
|
2703
|
+
// <- Note: [1] --||--
|
|
2692
2704
|
},
|
|
2693
2705
|
get createdAt() {
|
|
2694
2706
|
return createdAt;
|
|
2695
|
-
// <- Note: [1]
|
|
2707
|
+
// <- Note: [1] --||--
|
|
2696
2708
|
},
|
|
2697
2709
|
get updatedAt() {
|
|
2698
2710
|
return updatedAt;
|
|
2699
|
-
// <- Note: [1]
|
|
2711
|
+
// <- Note: [1] --||--
|
|
2700
2712
|
},
|
|
2701
2713
|
asPromise,
|
|
2702
2714
|
asObservable() {
|
|
@@ -2704,15 +2716,15 @@ function createTask(options) {
|
|
|
2704
2716
|
},
|
|
2705
2717
|
get errors() {
|
|
2706
2718
|
return errors;
|
|
2707
|
-
// <- Note: [1]
|
|
2719
|
+
// <- Note: [1] --||--
|
|
2708
2720
|
},
|
|
2709
2721
|
get warnings() {
|
|
2710
2722
|
return warnings;
|
|
2711
|
-
// <- Note: [1]
|
|
2723
|
+
// <- Note: [1] --||--
|
|
2712
2724
|
},
|
|
2713
2725
|
get currentValue() {
|
|
2714
2726
|
return currentValue;
|
|
2715
|
-
// <- Note: [1]
|
|
2727
|
+
// <- Note: [1] --||--
|
|
2716
2728
|
},
|
|
2717
2729
|
};
|
|
2718
2730
|
}
|
|
@@ -5365,7 +5377,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5365
5377
|
});
|
|
5366
5378
|
const knowledgePiecesSorted = knowledgePiecesWithRelevance.sort((a, b) => a.relevance - b.relevance);
|
|
5367
5379
|
const knowledgePiecesLimited = knowledgePiecesSorted.slice(0, 5);
|
|
5368
|
-
console.log('!!! Embedding', {
|
|
5380
|
+
console.log('!!! `getKnowledgeForTask` Embedding', {
|
|
5369
5381
|
task,
|
|
5370
5382
|
taskEmbeddingPrompt,
|
|
5371
5383
|
taskEmbeddingResult,
|
|
@@ -5401,6 +5413,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5401
5413
|
*/
|
|
5402
5414
|
async function getReservedParametersForTask(options) {
|
|
5403
5415
|
const { tools, preparedPipeline, task, parameters, pipelineIdentification } = options;
|
|
5416
|
+
console.log('!!! getReservedParametersForTask', options);
|
|
5404
5417
|
const context = await getContextForTask(); // <- [π]
|
|
5405
5418
|
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task, parameters });
|
|
5406
5419
|
const examples = await getExamplesForTask();
|
|
@@ -5437,6 +5450,7 @@ async function getReservedParametersForTask(options) {
|
|
|
5437
5450
|
*/
|
|
5438
5451
|
async function executeTask(options) {
|
|
5439
5452
|
const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSupressed, } = options;
|
|
5453
|
+
console.log('!!! executeTask', options);
|
|
5440
5454
|
const priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
5441
5455
|
// Note: Check consistency of used and dependent parameters which was also done in `validatePipeline`, but itβs good to doublecheck
|
|
5442
5456
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
@@ -5460,14 +5474,15 @@ async function executeTask(options) {
|
|
|
5460
5474
|
|
|
5461
5475
|
`));
|
|
5462
5476
|
}
|
|
5477
|
+
const reservedParameters = await getReservedParametersForTask({
|
|
5478
|
+
tools,
|
|
5479
|
+
preparedPipeline,
|
|
5480
|
+
task: currentTask,
|
|
5481
|
+
pipelineIdentification,
|
|
5482
|
+
parameters: parametersToPass,
|
|
5483
|
+
});
|
|
5463
5484
|
const definedParameters = Object.freeze({
|
|
5464
|
-
...
|
|
5465
|
-
tools,
|
|
5466
|
-
preparedPipeline,
|
|
5467
|
-
task: currentTask,
|
|
5468
|
-
pipelineIdentification,
|
|
5469
|
-
parameters: parametersToPass,
|
|
5470
|
-
})),
|
|
5485
|
+
...reservedParameters,
|
|
5471
5486
|
...parametersToPass,
|
|
5472
5487
|
});
|
|
5473
5488
|
const definedParameterNames = new Set(Object.keys(definedParameters));
|
|
@@ -5914,6 +5929,7 @@ function createPipelineExecutor(options) {
|
|
|
5914
5929
|
};
|
|
5915
5930
|
const pipelineExecutor = (inputParameters) => createTask({
|
|
5916
5931
|
taskType: 'EXECUTION',
|
|
5932
|
+
title: pipeline.title,
|
|
5917
5933
|
taskProcessCallback(updateOngoingResult) {
|
|
5918
5934
|
return pipelineExecutorWithCallback(inputParameters, async (newOngoingResult) => {
|
|
5919
5935
|
updateOngoingResult(newOngoingResult);
|