@promptbook/pdf 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
|
@@ -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-33';
|
|
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
|
|
@@ -2514,6 +2514,7 @@ function assertsTaskSuccessful(executionResult) {
|
|
|
2514
2514
|
*/
|
|
2515
2515
|
function createTask(options) {
|
|
2516
2516
|
const { taskType, taskProcessCallback } = options;
|
|
2517
|
+
let { title } = options;
|
|
2517
2518
|
// TODO: [π] DRY
|
|
2518
2519
|
const taskId = `${taskType.toLowerCase().substring(0, 4)}-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid simmilar char conflicts */)}`;
|
|
2519
2520
|
let status = 'RUNNING';
|
|
@@ -2525,6 +2526,10 @@ function createTask(options) {
|
|
|
2525
2526
|
const partialResultSubject = new Subject();
|
|
2526
2527
|
// <- Note: Not using `BehaviorSubject` because on error we can't access the last value
|
|
2527
2528
|
const finalResultPromise = /* not await */ taskProcessCallback((newOngoingResult) => {
|
|
2529
|
+
if (newOngoingResult.title) {
|
|
2530
|
+
title = newOngoingResult.title;
|
|
2531
|
+
}
|
|
2532
|
+
updatedAt = new Date();
|
|
2528
2533
|
Object.assign(currentValue, newOngoingResult);
|
|
2529
2534
|
// <- TODO: assign deep
|
|
2530
2535
|
partialResultSubject.next(newOngoingResult);
|
|
@@ -2570,17 +2575,24 @@ function createTask(options) {
|
|
|
2570
2575
|
return {
|
|
2571
2576
|
taskType,
|
|
2572
2577
|
taskId,
|
|
2578
|
+
get promptbookVersion() {
|
|
2579
|
+
return PROMPTBOOK_ENGINE_VERSION;
|
|
2580
|
+
},
|
|
2581
|
+
get title() {
|
|
2582
|
+
return title;
|
|
2583
|
+
// <- Note: [1] Theese must be getters to allow changing the value in the future
|
|
2584
|
+
},
|
|
2573
2585
|
get status() {
|
|
2574
2586
|
return status;
|
|
2575
|
-
// <- Note: [1]
|
|
2587
|
+
// <- Note: [1] --||--
|
|
2576
2588
|
},
|
|
2577
2589
|
get createdAt() {
|
|
2578
2590
|
return createdAt;
|
|
2579
|
-
// <- Note: [1]
|
|
2591
|
+
// <- Note: [1] --||--
|
|
2580
2592
|
},
|
|
2581
2593
|
get updatedAt() {
|
|
2582
2594
|
return updatedAt;
|
|
2583
|
-
// <- Note: [1]
|
|
2595
|
+
// <- Note: [1] --||--
|
|
2584
2596
|
},
|
|
2585
2597
|
asPromise,
|
|
2586
2598
|
asObservable() {
|
|
@@ -2588,15 +2600,15 @@ function createTask(options) {
|
|
|
2588
2600
|
},
|
|
2589
2601
|
get errors() {
|
|
2590
2602
|
return errors;
|
|
2591
|
-
// <- Note: [1]
|
|
2603
|
+
// <- Note: [1] --||--
|
|
2592
2604
|
},
|
|
2593
2605
|
get warnings() {
|
|
2594
2606
|
return warnings;
|
|
2595
|
-
// <- Note: [1]
|
|
2607
|
+
// <- Note: [1] --||--
|
|
2596
2608
|
},
|
|
2597
2609
|
get currentValue() {
|
|
2598
2610
|
return currentValue;
|
|
2599
|
-
// <- Note: [1]
|
|
2611
|
+
// <- Note: [1] --||--
|
|
2600
2612
|
},
|
|
2601
2613
|
};
|
|
2602
2614
|
}
|
|
@@ -5364,7 +5376,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5364
5376
|
});
|
|
5365
5377
|
const knowledgePiecesSorted = knowledgePiecesWithRelevance.sort((a, b) => a.relevance - b.relevance);
|
|
5366
5378
|
const knowledgePiecesLimited = knowledgePiecesSorted.slice(0, 5);
|
|
5367
|
-
console.log('!!! Embedding', {
|
|
5379
|
+
console.log('!!! `getKnowledgeForTask` Embedding', {
|
|
5368
5380
|
task,
|
|
5369
5381
|
taskEmbeddingPrompt,
|
|
5370
5382
|
taskEmbeddingResult,
|
|
@@ -5400,6 +5412,7 @@ async function getKnowledgeForTask(options) {
|
|
|
5400
5412
|
*/
|
|
5401
5413
|
async function getReservedParametersForTask(options) {
|
|
5402
5414
|
const { tools, preparedPipeline, task, parameters, pipelineIdentification } = options;
|
|
5415
|
+
console.log('!!! getReservedParametersForTask', options);
|
|
5403
5416
|
const context = await getContextForTask(); // <- [π]
|
|
5404
5417
|
const knowledge = await getKnowledgeForTask({ tools, preparedPipeline, task, parameters });
|
|
5405
5418
|
const examples = await getExamplesForTask();
|
|
@@ -5436,6 +5449,7 @@ async function getReservedParametersForTask(options) {
|
|
|
5436
5449
|
*/
|
|
5437
5450
|
async function executeTask(options) {
|
|
5438
5451
|
const { currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSupressed, } = options;
|
|
5452
|
+
console.log('!!! executeTask', options);
|
|
5439
5453
|
const priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
5440
5454
|
// Note: Check consistency of used and dependent parameters which was also done in `validatePipeline`, but itβs good to doublecheck
|
|
5441
5455
|
const usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
@@ -5459,14 +5473,15 @@ async function executeTask(options) {
|
|
|
5459
5473
|
|
|
5460
5474
|
`));
|
|
5461
5475
|
}
|
|
5476
|
+
const reservedParameters = await getReservedParametersForTask({
|
|
5477
|
+
tools,
|
|
5478
|
+
preparedPipeline,
|
|
5479
|
+
task: currentTask,
|
|
5480
|
+
pipelineIdentification,
|
|
5481
|
+
parameters: parametersToPass,
|
|
5482
|
+
});
|
|
5462
5483
|
const definedParameters = Object.freeze({
|
|
5463
|
-
...
|
|
5464
|
-
tools,
|
|
5465
|
-
preparedPipeline,
|
|
5466
|
-
task: currentTask,
|
|
5467
|
-
pipelineIdentification,
|
|
5468
|
-
parameters: parametersToPass,
|
|
5469
|
-
})),
|
|
5484
|
+
...reservedParameters,
|
|
5470
5485
|
...parametersToPass,
|
|
5471
5486
|
});
|
|
5472
5487
|
const definedParameterNames = new Set(Object.keys(definedParameters));
|
|
@@ -5913,6 +5928,7 @@ function createPipelineExecutor(options) {
|
|
|
5913
5928
|
};
|
|
5914
5929
|
const pipelineExecutor = (inputParameters) => createTask({
|
|
5915
5930
|
taskType: 'EXECUTION',
|
|
5931
|
+
title: pipeline.title,
|
|
5916
5932
|
taskProcessCallback(updateOngoingResult) {
|
|
5917
5933
|
return pipelineExecutorWithCallback(inputParameters, async (newOngoingResult) => {
|
|
5918
5934
|
updateOngoingResult(newOngoingResult);
|