@promptbook/core 0.72.0-14 → 0.72.0-15
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/README.md +1 -1
- package/esm/index.es.js +85 -90
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +22 -18
- package/esm/typings/src/_packages/node.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +10 -10
- package/esm/typings/src/_packages/utils.index.d.ts +2 -2
- package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +2 -2
- package/esm/typings/src/collection/collectionToJson.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +5 -5
- package/esm/typings/src/config.d.ts +21 -14
- package/esm/typings/src/execution/EmbeddingVector.d.ts +1 -1
- package/esm/typings/src/execution/Executables.d.ts +18 -0
- package/esm/typings/src/execution/ExecutionTools.d.ts +9 -3
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +2 -2
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +29 -6
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +2 -11
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +4 -13
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +9 -14
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -3
- package/esm/typings/src/execution/utils/addUsage.d.ts +1 -1
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +2 -2
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForCli.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +4 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +4 -5
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Response.d.ts +3 -3
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Response.d.ts +2 -2
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +4 -23
- package/esm/typings/src/prepare/prepareTemplates.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +1 -5
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/register/$provideExecutablesForNode.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +2 -2
- package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +2 -2
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +3 -3
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +2 -2
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +6 -3
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/website/utils/createShowdownConverter.d.ts +7 -0
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +1 -1
- package/esm/typings/src/types/Arrayable.d.ts +1 -1
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +7 -0
- package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +4 -4
- package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +2 -2
- package/esm/typings/src/types/Prompt.d.ts +1 -1
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +1 -1
- package/esm/typings/src/utils/$Register.d.ts +1 -1
- package/esm/typings/src/utils/FromtoItems.d.ts +1 -1
- package/esm/typings/src/utils/arrayableToArray.d.ts +1 -1
- package/esm/typings/src/utils/emojis.d.ts +1 -1
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -2
- package/esm/typings/src/utils/execCommand/{IExecCommandOptions.d.ts → ExecCommandOptions.d.ts} +2 -6
- package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +3 -3
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -1
- package/esm/typings/src/utils/normalization/IKeywords.d.ts +2 -2
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -2
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +2 -2
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +2 -2
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
- package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
- package/esm/typings/src/utils/random/$randomSeed.d.ts +1 -1
- package/esm/typings/src/utils/sets/intersection.d.ts +1 -1
- package/esm/typings/src/utils/sets/union.d.ts +1 -1
- package/esm/typings/src/utils/unwrapResult.d.ts +4 -4
- package/package.json +3 -2
- package/umd/index.umd.js +95 -98
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +0 -29
- package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +0 -12
- /package/esm/typings/src/scrapers/website/utils/{markdownConverter.test.d.ts → createShowdownConverter.test.d.ts} +0 -0
package/README.md
CHANGED
package/esm/index.es.js
CHANGED
|
@@ -14,7 +14,7 @@ import moment from 'moment';
|
|
|
14
14
|
/**
|
|
15
15
|
* The version of the Promptbook library
|
|
16
16
|
*/
|
|
17
|
-
var PROMPTBOOK_VERSION = '0.72.0-
|
|
17
|
+
var PROMPTBOOK_VERSION = '0.72.0-14';
|
|
18
18
|
// TODO: [main] !!!! List here all the versions and annotate + put into script
|
|
19
19
|
|
|
20
20
|
/*! *****************************************************************************
|
|
@@ -221,7 +221,6 @@ function pipelineJsonToString(pipelineJson) {
|
|
|
221
221
|
pipelineString += '\n\n';
|
|
222
222
|
pipelineString += description;
|
|
223
223
|
}
|
|
224
|
-
// TODO:> const commands: Array<Command>
|
|
225
224
|
var commands = [];
|
|
226
225
|
if (pipelineUrl) {
|
|
227
226
|
commands.push("PIPELINE URL ".concat(pipelineUrl));
|
|
@@ -277,7 +276,6 @@ function pipelineJsonToString(pipelineJson) {
|
|
|
277
276
|
pipelineString += '\n\n';
|
|
278
277
|
pipelineString += description_1;
|
|
279
278
|
}
|
|
280
|
-
// TODO:> const commands: Array<Command>
|
|
281
279
|
var commands_1 = [];
|
|
282
280
|
var contentLanguage = 'text';
|
|
283
281
|
if (templateType === 'PROMPT_TEMPLATE') {
|
|
@@ -637,7 +635,7 @@ var GENERATOR_WARNING = "\u26A0\uFE0F WARNING: This code has been generated so t
|
|
|
637
635
|
*
|
|
638
636
|
* @public exported from `@promptbook/core`
|
|
639
637
|
*/
|
|
640
|
-
var CLAIM = "
|
|
638
|
+
var CLAIM = "Build responsible, controlled and transparent applications on top of LLM models!";
|
|
641
639
|
// <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
|
|
642
640
|
/**
|
|
643
641
|
* The maximum number of iterations for a loops
|
|
@@ -652,37 +650,44 @@ var LOOP_LIMIT = 1000;
|
|
|
652
650
|
*/
|
|
653
651
|
var IMMEDIATE_TIME = 10;
|
|
654
652
|
/**
|
|
655
|
-
* The maximum
|
|
653
|
+
* The maximum length of the (generated) filename
|
|
656
654
|
*
|
|
657
655
|
* @public exported from `@promptbook/core`
|
|
658
656
|
*/
|
|
659
|
-
var
|
|
657
|
+
var MAX_FILENAME_LENGTH = 30;
|
|
660
658
|
/**
|
|
661
|
-
*
|
|
659
|
+
* Strategy for caching the intermediate results for knowledge sources
|
|
662
660
|
*
|
|
663
661
|
* @public exported from `@promptbook/core`
|
|
664
662
|
*/
|
|
665
|
-
var
|
|
663
|
+
var DEFAULT_INTERMEDIATE_FILES_STRATEGY = 'HIDE_AND_KEEP';
|
|
664
|
+
// <- TODO: [😡] Change to 'VISIBLE'
|
|
666
665
|
/**
|
|
667
|
-
* The maximum
|
|
666
|
+
* The maximum number of (LLM) tasks running in parallel
|
|
668
667
|
*
|
|
669
668
|
* @public exported from `@promptbook/core`
|
|
670
669
|
*/
|
|
671
|
-
var
|
|
670
|
+
var DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [🤹♂️]
|
|
671
|
+
/**
|
|
672
|
+
* The maximum number of attempts to execute LLM task before giving up
|
|
673
|
+
*
|
|
674
|
+
* @public exported from `@promptbook/core`
|
|
675
|
+
*/
|
|
676
|
+
var DEFAULT_MAX_EXECUTION_ATTEMPTS = 3; // <- TODO: [🤹♂️]
|
|
672
677
|
/**
|
|
673
678
|
* @@@
|
|
674
679
|
* TODO: [🐝][main] !!! Use
|
|
675
680
|
*
|
|
676
681
|
* @public exported from `@promptbook/core`
|
|
677
682
|
*/
|
|
678
|
-
var
|
|
683
|
+
var DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
|
|
679
684
|
/**
|
|
680
685
|
* @@@
|
|
681
686
|
* TODO: [🐝][main] !!! Use
|
|
682
687
|
*
|
|
683
688
|
* @public exported from `@promptbook/core`
|
|
684
689
|
*/
|
|
685
|
-
var
|
|
690
|
+
var DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
|
|
686
691
|
/**
|
|
687
692
|
* Where to store the cache of executions for promptbook CLI
|
|
688
693
|
*
|
|
@@ -690,7 +695,7 @@ var MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
|
|
|
690
695
|
*
|
|
691
696
|
* @public exported from `@promptbook/core`
|
|
692
697
|
*/
|
|
693
|
-
var
|
|
698
|
+
var DEFAULT_EXECUTIONS_CACHE_DIRNAME = '/.promptbook/executions-cache';
|
|
694
699
|
/**
|
|
695
700
|
* Where to store the scrape cache
|
|
696
701
|
*
|
|
@@ -698,13 +703,13 @@ var EXECUTIONS_CACHE_DIRNAME = '/.promptbook/executions-cache';
|
|
|
698
703
|
*
|
|
699
704
|
* @public exported from `@promptbook/core`
|
|
700
705
|
*/
|
|
701
|
-
var
|
|
706
|
+
var DEFAULT_SCRAPE_CACHE_DIRNAME = '/.promptbook/scrape-cache';
|
|
702
707
|
/**
|
|
703
708
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
704
709
|
*
|
|
705
710
|
* @public exported from `@promptbook/core`
|
|
706
711
|
*/
|
|
707
|
-
var
|
|
712
|
+
var DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME = "index";
|
|
708
713
|
/**
|
|
709
714
|
* Nonce which is used for replacing things in strings
|
|
710
715
|
*
|
|
@@ -777,13 +782,13 @@ var DEFAULT_CSV_SETTINGS = Object.freeze({
|
|
|
777
782
|
*
|
|
778
783
|
* @public exported from `@promptbook/core`
|
|
779
784
|
*/
|
|
780
|
-
var
|
|
785
|
+
var DEFAULT_IS_VERBOSE = false;
|
|
781
786
|
/**
|
|
782
787
|
* @@@
|
|
783
788
|
*
|
|
784
789
|
* @public exported from `@promptbook/core`
|
|
785
790
|
*/
|
|
786
|
-
var
|
|
791
|
+
var DEFAULT_IS_AUTO_INSTALLED = false;
|
|
787
792
|
/**
|
|
788
793
|
* @@@
|
|
789
794
|
*
|
|
@@ -1532,7 +1537,7 @@ function createCollectionFromUrl(url, options) {
|
|
|
1532
1537
|
return __generator(this, function (_d) {
|
|
1533
1538
|
switch (_d.label) {
|
|
1534
1539
|
case 0:
|
|
1535
|
-
_a = options || {}, _b = _a.isVerbose, isVerbose = _b === void 0 ?
|
|
1540
|
+
_a = options || {}, _b = _a.isVerbose, isVerbose = _b === void 0 ? DEFAULT_IS_VERBOSE : _b, _c = _a.isLazyLoaded, isLazyLoaded = _c === void 0 ? false : _c;
|
|
1536
1541
|
collection = createCollectionFromPromise(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1537
1542
|
return __generator(this, function (_a) {
|
|
1538
1543
|
if (isVerbose) {
|
|
@@ -1818,8 +1823,7 @@ var PipelineExecutionError = /** @class */ (function (_super) {
|
|
|
1818
1823
|
* Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
|
|
1819
1824
|
*
|
|
1820
1825
|
* Note: Internal utility of `joinLlmExecutionTools` but exposed type
|
|
1821
|
-
* @public exported from `@promptbook/
|
|
1822
|
-
* TODO: !!!!!! Export as runtime class not just type
|
|
1826
|
+
* @public exported from `@promptbook/core`
|
|
1823
1827
|
*/
|
|
1824
1828
|
var MultipleLlmExecutionTools = /** @class */ (function () {
|
|
1825
1829
|
/**
|
|
@@ -2435,6 +2439,7 @@ function assertsExecutionSuccessful(executionResult) {
|
|
|
2435
2439
|
}
|
|
2436
2440
|
}
|
|
2437
2441
|
/**
|
|
2442
|
+
* TODO: [🐚] This function should be removed OR changed OR be completely rewritten
|
|
2438
2443
|
* TODO: [🧠] Can this return type be better typed than void
|
|
2439
2444
|
*/
|
|
2440
2445
|
|
|
@@ -3763,12 +3768,11 @@ function isPassingExpectations(expectations, value) {
|
|
|
3763
3768
|
*/
|
|
3764
3769
|
function executeAttempts(options) {
|
|
3765
3770
|
return __awaiter(this, void 0, void 0, function () {
|
|
3766
|
-
var jokerParameterNames, priority, maxAttempts, preparedContent, parameters, template, preparedPipeline, tools,
|
|
3771
|
+
var jokerParameterNames, priority, maxAttempts, preparedContent, parameters, template, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, $ongoingTemplateResult, _llms, llmTools, _loop_1, attempt, state_1;
|
|
3767
3772
|
return __generator(this, function (_a) {
|
|
3768
3773
|
switch (_a.label) {
|
|
3769
3774
|
case 0:
|
|
3770
|
-
jokerParameterNames = options.jokerParameterNames, priority = options.priority, maxAttempts = options.maxAttempts, preparedContent = options.preparedContent, parameters = options.parameters, template = options.template, preparedPipeline = options.preparedPipeline, tools = options.tools,
|
|
3771
|
-
maxExecutionAttempts = settings.maxExecutionAttempts;
|
|
3775
|
+
jokerParameterNames = options.jokerParameterNames, priority = options.priority, maxAttempts = options.maxAttempts, preparedContent = options.preparedContent, parameters = options.parameters, template = options.template, preparedPipeline = options.preparedPipeline, tools = options.tools, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification, maxExecutionAttempts = options.maxExecutionAttempts;
|
|
3772
3776
|
$ongoingTemplateResult = {
|
|
3773
3777
|
$result: null,
|
|
3774
3778
|
$resultString: null,
|
|
@@ -4134,12 +4138,12 @@ function executeAttempts(options) {
|
|
|
4134
4138
|
*/
|
|
4135
4139
|
function executeFormatSubvalues(options) {
|
|
4136
4140
|
return __awaiter(this, void 0, void 0, function () {
|
|
4137
|
-
var template, jokerParameterNames, parameters, priority,
|
|
4141
|
+
var template, jokerParameterNames, parameters, priority, csvSettings, pipelineIdentification, parameterValue, formatDefinition, subvalueDefinition, formatSettings, resultString;
|
|
4138
4142
|
var _this = this;
|
|
4139
4143
|
return __generator(this, function (_a) {
|
|
4140
4144
|
switch (_a.label) {
|
|
4141
4145
|
case 0:
|
|
4142
|
-
template = options.template, jokerParameterNames = options.jokerParameterNames, parameters = options.parameters, priority = options.priority,
|
|
4146
|
+
template = options.template, jokerParameterNames = options.jokerParameterNames, parameters = options.parameters, priority = options.priority, csvSettings = options.csvSettings, pipelineIdentification = options.pipelineIdentification;
|
|
4143
4147
|
if (template.foreach === undefined) {
|
|
4144
4148
|
return [2 /*return*/, /* not await */ executeAttempts(options)];
|
|
4145
4149
|
}
|
|
@@ -4169,7 +4173,7 @@ function executeFormatSubvalues(options) {
|
|
|
4169
4173
|
.join('\n')), "\n\n [\u26F7] This should never happen because subformat name should be validated during parsing\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
4170
4174
|
}
|
|
4171
4175
|
if (formatDefinition.formatName === 'CSV') {
|
|
4172
|
-
formatSettings =
|
|
4176
|
+
formatSettings = csvSettings;
|
|
4173
4177
|
// <- TODO: [🤹♂️] More universal, make simmilar pattern for other formats for example \n vs \r\n in text
|
|
4174
4178
|
}
|
|
4175
4179
|
return [4 /*yield*/, subvalueDefinition.mapValues(parameterValue, template.foreach.outputSubparameterName, formatSettings, function (subparameters, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -4322,13 +4326,12 @@ function getReservedParametersForTemplate(options) {
|
|
|
4322
4326
|
*/
|
|
4323
4327
|
function executeTemplate(options) {
|
|
4324
4328
|
return __awaiter(this, void 0, void 0, function () {
|
|
4325
|
-
var currentTemplate, preparedPipeline, parametersToPass, tools, onProgress,
|
|
4326
|
-
var e_1,
|
|
4327
|
-
return __generator(this, function (
|
|
4328
|
-
switch (
|
|
4329
|
+
var currentTemplate, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, _a, maxExecutionAttempts, name, title, priority, usedParameterNames, dependentParameterNames, definedParameters, _b, _c, _d, definedParameterNames, parameters, _loop_1, _e, _f, parameterName, maxAttempts, jokerParameterNames, preparedContent, resultString;
|
|
4330
|
+
var e_1, _g, _h;
|
|
4331
|
+
return __generator(this, function (_j) {
|
|
4332
|
+
switch (_j.label) {
|
|
4329
4333
|
case 0:
|
|
4330
|
-
currentTemplate = options.currentTemplate, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress,
|
|
4331
|
-
maxExecutionAttempts = settings.maxExecutionAttempts;
|
|
4334
|
+
currentTemplate = options.currentTemplate, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification, _a = options.maxExecutionAttempts, maxExecutionAttempts = _a === void 0 ? DEFAULT_MAX_EXECUTION_ATTEMPTS : _a;
|
|
4332
4335
|
name = "pipeline-executor-frame-".concat(currentTemplate.name);
|
|
4333
4336
|
title = currentTemplate.title;
|
|
4334
4337
|
priority = preparedPipeline.templates.length - preparedPipeline.templates.indexOf(currentTemplate);
|
|
@@ -4343,7 +4346,7 @@ function executeTemplate(options) {
|
|
|
4343
4346
|
// <- [🍸]
|
|
4344
4347
|
})];
|
|
4345
4348
|
case 1:
|
|
4346
|
-
|
|
4349
|
+
_j.sent();
|
|
4347
4350
|
usedParameterNames = extractParameterNamesFromTemplate(currentTemplate);
|
|
4348
4351
|
dependentParameterNames = new Set(currentTemplate.dependentParameterNames);
|
|
4349
4352
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
@@ -4354,15 +4357,15 @@ function executeTemplate(options) {
|
|
|
4354
4357
|
.map(function (name) { return "{".concat(name, "}"); })
|
|
4355
4358
|
.join(', '), "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
4356
4359
|
}
|
|
4357
|
-
|
|
4358
|
-
|
|
4360
|
+
_c = (_b = Object).freeze;
|
|
4361
|
+
_d = [{}];
|
|
4359
4362
|
return [4 /*yield*/, getReservedParametersForTemplate({
|
|
4360
4363
|
preparedPipeline: preparedPipeline,
|
|
4361
4364
|
template: currentTemplate,
|
|
4362
4365
|
pipelineIdentification: pipelineIdentification,
|
|
4363
4366
|
})];
|
|
4364
4367
|
case 2:
|
|
4365
|
-
definedParameters =
|
|
4368
|
+
definedParameters = _c.apply(_b, [__assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), parametersToPass])]);
|
|
4366
4369
|
definedParameterNames = new Set(Object.keys(definedParameters));
|
|
4367
4370
|
parameters = {};
|
|
4368
4371
|
_loop_1 = function (parameterName) {
|
|
@@ -4382,15 +4385,15 @@ function executeTemplate(options) {
|
|
|
4382
4385
|
try {
|
|
4383
4386
|
// Note: [2] Check that all used parameters are defined and removing unused parameters for this template
|
|
4384
4387
|
// TODO: [👩🏾🤝👩🏻] Use here `mapAvailableToExpectedParameters`
|
|
4385
|
-
for (
|
|
4386
|
-
parameterName =
|
|
4388
|
+
for (_e = __values(Array.from(union(definedParameterNames, usedParameterNames, dependentParameterNames))), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
4389
|
+
parameterName = _f.value;
|
|
4387
4390
|
_loop_1(parameterName);
|
|
4388
4391
|
}
|
|
4389
4392
|
}
|
|
4390
4393
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4391
4394
|
finally {
|
|
4392
4395
|
try {
|
|
4393
|
-
if (
|
|
4396
|
+
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
|
|
4394
4397
|
}
|
|
4395
4398
|
finally { if (e_1) throw e_1.error; }
|
|
4396
4399
|
}
|
|
@@ -4410,12 +4413,11 @@ function executeTemplate(options) {
|
|
|
4410
4413
|
template: currentTemplate,
|
|
4411
4414
|
preparedPipeline: preparedPipeline,
|
|
4412
4415
|
tools: tools,
|
|
4413
|
-
settings: settings,
|
|
4414
4416
|
$executionReport: $executionReport,
|
|
4415
4417
|
pipelineIdentification: pipelineIdentification,
|
|
4416
4418
|
})];
|
|
4417
4419
|
case 3:
|
|
4418
|
-
resultString =
|
|
4420
|
+
resultString = _j.sent();
|
|
4419
4421
|
return [4 /*yield*/, onProgress({
|
|
4420
4422
|
name: name,
|
|
4421
4423
|
title: title,
|
|
@@ -4427,12 +4429,12 @@ function executeTemplate(options) {
|
|
|
4427
4429
|
// <- [🍸]
|
|
4428
4430
|
})];
|
|
4429
4431
|
case 4:
|
|
4430
|
-
|
|
4431
|
-
return [2 /*return*/, Object.freeze((
|
|
4432
|
-
|
|
4432
|
+
_j.sent();
|
|
4433
|
+
return [2 /*return*/, Object.freeze((_h = {},
|
|
4434
|
+
_h[currentTemplate.resultingParameterName] =
|
|
4433
4435
|
// <- Note: [👩👩👧] No need to detect parameter collision here because pipeline checks logic consistency during construction
|
|
4434
4436
|
resultString,
|
|
4435
|
-
|
|
4437
|
+
_h))];
|
|
4436
4438
|
}
|
|
4437
4439
|
});
|
|
4438
4440
|
});
|
|
@@ -4491,13 +4493,12 @@ function filterJustOutputParameters(options) {
|
|
|
4491
4493
|
*/
|
|
4492
4494
|
function executePipeline(options) {
|
|
4493
4495
|
return __awaiter(this, void 0, void 0, function () {
|
|
4494
|
-
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification,
|
|
4496
|
+
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, _a, isVerbose, preparedPipeline, errors, warnings, executionReport, isReturned, _b, _c, parameter, e_1_1, _loop_1, _d, _e, parameterName, state_1, e_2_1, parametersToPass, resovedParameterNames_1, unresovedTemplates_1, resolving_1, loopLimit, _loop_2, error_1, usage_1, outputParameters_1, usage, outputParameters;
|
|
4495
4497
|
var e_1, _f, e_2, _g;
|
|
4496
4498
|
return __generator(this, function (_h) {
|
|
4497
4499
|
switch (_h.label) {
|
|
4498
4500
|
case 0:
|
|
4499
|
-
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification,
|
|
4500
|
-
maxParallelCount = settings.maxParallelCount, rootDirname = settings.rootDirname, _a = settings.isVerbose, isVerbose = _a === void 0 ? IS_VERBOSE : _a;
|
|
4501
|
+
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname, _a = options.isVerbose, isVerbose = _a === void 0 ? DEFAULT_IS_VERBOSE : _a;
|
|
4501
4502
|
preparedPipeline = options.preparedPipeline;
|
|
4502
4503
|
if (!(preparedPipeline === undefined)) return [3 /*break*/, 2];
|
|
4503
4504
|
return [4 /*yield*/, preparePipeline(pipeline, tools, {
|
|
@@ -4682,12 +4683,7 @@ function executePipeline(options) {
|
|
|
4682
4683
|
return [3 /*break*/, 4];
|
|
4683
4684
|
case 3:
|
|
4684
4685
|
unresovedTemplates_1 = unresovedTemplates_1.filter(function (template) { return template !== currentTemplate; });
|
|
4685
|
-
work_1 = executeTemplate({
|
|
4686
|
-
currentTemplate: currentTemplate,
|
|
4687
|
-
preparedPipeline: preparedPipeline,
|
|
4688
|
-
parametersToPass: parametersToPass,
|
|
4689
|
-
tools: tools,
|
|
4690
|
-
onProgress: function (progress) {
|
|
4686
|
+
work_1 = executeTemplate(__assign(__assign({}, options), { currentTemplate: currentTemplate, preparedPipeline: preparedPipeline, parametersToPass: parametersToPass, tools: tools, onProgress: function (progress) {
|
|
4691
4687
|
if (isReturned) {
|
|
4692
4688
|
throw new UnexpectedError(spaceTrim$1(function (block) { return "\n Can not call `onProgress` after pipeline execution is finished\n\n ".concat(block(pipelineIdentification), "\n\n ").concat(block(JSON.stringify(progress, null, 4)
|
|
4693
4689
|
.split('\n')
|
|
@@ -4697,11 +4693,7 @@ function executePipeline(options) {
|
|
|
4697
4693
|
if (onProgress) {
|
|
4698
4694
|
onProgress(progress);
|
|
4699
4695
|
}
|
|
4700
|
-
},
|
|
4701
|
-
settings: settings,
|
|
4702
|
-
$executionReport: executionReport,
|
|
4703
|
-
pipelineIdentification: spaceTrim$1(function (block) { return "\n ".concat(block(pipelineIdentification), "\n Template name: ").concat(currentTemplate.name, "\n Template title: ").concat(currentTemplate.title, "\n "); }),
|
|
4704
|
-
})
|
|
4696
|
+
}, $executionReport: executionReport, pipelineIdentification: spaceTrim$1(function (block) { return "\n ".concat(block(pipelineIdentification), "\n Template name: ").concat(currentTemplate.name, "\n Template title: ").concat(currentTemplate.title, "\n "); }) }))
|
|
4705
4697
|
.then(function (newParametersToPass) {
|
|
4706
4698
|
parametersToPass = __assign(__assign({}, newParametersToPass), parametersToPass);
|
|
4707
4699
|
resovedParameterNames_1 = __spreadArray(__spreadArray([], __read(resovedParameterNames_1), false), [currentTemplate.resultingParameterName], false);
|
|
@@ -4805,8 +4797,7 @@ function executePipeline(options) {
|
|
|
4805
4797
|
*/
|
|
4806
4798
|
function createPipelineExecutor(options) {
|
|
4807
4799
|
var _this = this;
|
|
4808
|
-
var pipeline = options.pipeline, tools = options.tools, _a = options.
|
|
4809
|
-
var _b = settings.maxExecutionAttempts, maxExecutionAttempts = _b === void 0 ? MAX_EXECUTION_ATTEMPTS : _b, _c = settings.maxParallelCount, maxParallelCount = _c === void 0 ? MAX_PARALLEL_COUNT : _c, _d = settings.csvSettings, csvSettings = _d === void 0 ? DEFAULT_CSV_SETTINGS : _d, _e = settings.isVerbose, isVerbose = _e === void 0 ? IS_VERBOSE : _e, _f = settings.isNotPreparedWarningSupressed, isNotPreparedWarningSupressed = _f === void 0 ? false : _f, _g = settings.rootDirname, rootDirname = _g === void 0 ? null : _g;
|
|
4800
|
+
var pipeline = options.pipeline, tools = options.tools, _a = options.maxExecutionAttempts, maxExecutionAttempts = _a === void 0 ? DEFAULT_MAX_EXECUTION_ATTEMPTS : _a, _b = options.maxParallelCount, maxParallelCount = _b === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _b, _c = options.csvSettings, csvSettings = _c === void 0 ? DEFAULT_CSV_SETTINGS : _c, _d = options.isVerbose, isVerbose = _d === void 0 ? DEFAULT_IS_VERBOSE : _d, _e = options.isNotPreparedWarningSupressed, isNotPreparedWarningSupressed = _e === void 0 ? false : _e, _f = options.rootDirname, rootDirname = _f === void 0 ? null : _f;
|
|
4810
4801
|
validatePipeline(pipeline);
|
|
4811
4802
|
var pipelineIdentification = (function () {
|
|
4812
4803
|
// Note: This is a 😐 implementation of [🚞]
|
|
@@ -4840,14 +4831,12 @@ function createPipelineExecutor(options) {
|
|
|
4840
4831
|
tools: tools,
|
|
4841
4832
|
onProgress: onProgress,
|
|
4842
4833
|
pipelineIdentification: spaceTrim$1(function (block) { return "\n ".concat(block(pipelineIdentification), "\n ").concat(runCount === 1 ? '' : "Run #".concat(runCount), "\n "); }),
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
rootDirname: rootDirname,
|
|
4850
|
-
},
|
|
4834
|
+
maxExecutionAttempts: maxExecutionAttempts,
|
|
4835
|
+
maxParallelCount: maxParallelCount,
|
|
4836
|
+
csvSettings: csvSettings,
|
|
4837
|
+
isVerbose: isVerbose,
|
|
4838
|
+
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
4839
|
+
rootDirname: rootDirname,
|
|
4851
4840
|
})];
|
|
4852
4841
|
});
|
|
4853
4842
|
}); };
|
|
@@ -4870,7 +4859,7 @@ function preparePersona(personaDescription, tools, options) {
|
|
|
4870
4859
|
return __generator(this, function (_d) {
|
|
4871
4860
|
switch (_d.label) {
|
|
4872
4861
|
case 0:
|
|
4873
|
-
_a = options.isVerbose, isVerbose = _a === void 0 ?
|
|
4862
|
+
_a = options.isVerbose, isVerbose = _a === void 0 ? DEFAULT_IS_VERBOSE : _a;
|
|
4874
4863
|
if (tools === undefined || tools.llm === undefined) {
|
|
4875
4864
|
throw new MissingToolsError('LLM tools are required for preparing persona');
|
|
4876
4865
|
}
|
|
@@ -5052,7 +5041,7 @@ var $Register = /** @class */ (function () {
|
|
|
5052
5041
|
this.storage = globalScope[storageName];
|
|
5053
5042
|
}
|
|
5054
5043
|
$Register.prototype.list = function () {
|
|
5055
|
-
// <- TODO: ReadonlyDeep<
|
|
5044
|
+
// <- TODO: ReadonlyDeep<ReadonlyArray<TRegistered>>
|
|
5056
5045
|
return this.storage;
|
|
5057
5046
|
};
|
|
5058
5047
|
$Register.prototype.register = function (registered) {
|
|
@@ -5104,7 +5093,7 @@ var $scrapersRegister = new $Register('scraper_constructors');
|
|
|
5104
5093
|
* TODO: [®] DRY Register logic
|
|
5105
5094
|
*/
|
|
5106
5095
|
|
|
5107
|
-
// TODO: !!!!!! Maybe delete this function
|
|
5096
|
+
// TODO: !!!!!!last - Maybe delete this function
|
|
5108
5097
|
/**
|
|
5109
5098
|
* Creates a message with all registered scrapers
|
|
5110
5099
|
*
|
|
@@ -5271,7 +5260,6 @@ function normalizeToKebabCase(text) {
|
|
|
5271
5260
|
* @private within the repository
|
|
5272
5261
|
*/
|
|
5273
5262
|
function sourceContentToName(sourceContent) {
|
|
5274
|
-
// TODO: !!!!!! Better name for source than gibberish hash
|
|
5275
5263
|
var hash = SHA256(hexEncoder.parse(JSON.stringify(sourceContent)))
|
|
5276
5264
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
5277
5265
|
.toString( /* hex */)
|
|
@@ -5384,7 +5372,7 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
5384
5372
|
case 0:
|
|
5385
5373
|
sourceContent = knowledgeSource.sourceContent;
|
|
5386
5374
|
name = knowledgeSource.name;
|
|
5387
|
-
_b = options || {}, _c = _b.rootDirname, rootDirname = _c === void 0 ? null : _c, _d = _b.isVerbose, isVerbose = _d === void 0 ?
|
|
5375
|
+
_b = options || {}, _c = _b.rootDirname, rootDirname = _c === void 0 ? null : _c, _d = _b.isVerbose, isVerbose = _d === void 0 ? DEFAULT_IS_VERBOSE : _d;
|
|
5388
5376
|
TODO_USE(isVerbose);
|
|
5389
5377
|
if (!name) {
|
|
5390
5378
|
name = sourceContentToName(sourceContent);
|
|
@@ -5474,7 +5462,7 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
5474
5462
|
content = _a.sent();
|
|
5475
5463
|
return [2 /*return*/, new Blob([
|
|
5476
5464
|
content,
|
|
5477
|
-
// <- TODO: !!!!!!
|
|
5465
|
+
// <- TODO: !!!!!! Test that this is working
|
|
5478
5466
|
], { type: mimeType_1 })];
|
|
5479
5467
|
}
|
|
5480
5468
|
});
|
|
@@ -5537,7 +5525,7 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
|
5537
5525
|
return __generator(this, function (_c) {
|
|
5538
5526
|
switch (_c.label) {
|
|
5539
5527
|
case 0:
|
|
5540
|
-
_a = options.maxParallelCount, maxParallelCount = _a === void 0 ?
|
|
5528
|
+
_a = options.maxParallelCount, maxParallelCount = _a === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _a, rootDirname = options.rootDirname, _b = options.isVerbose, isVerbose = _b === void 0 ? DEFAULT_IS_VERBOSE : _b;
|
|
5541
5529
|
knowledgePreparedUnflatten = new Array(knowledgeSources.length);
|
|
5542
5530
|
return [4 /*yield*/, forEachAsync(knowledgeSources, { maxParallelCount: maxParallelCount }, function (knowledgeSource, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
5543
5531
|
var partialPieces, sourceHandler, _a, _b, scraper, partialPiecesUnchecked, e_1_1, pieces;
|
|
@@ -5566,7 +5554,8 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
|
5566
5554
|
case 4:
|
|
5567
5555
|
partialPiecesUnchecked = _d.sent();
|
|
5568
5556
|
if (partialPiecesUnchecked !== null) {
|
|
5569
|
-
partialPieces = partialPiecesUnchecked;
|
|
5557
|
+
partialPieces = __spreadArray([], __read(partialPiecesUnchecked), false);
|
|
5558
|
+
// <- TODO: [🪓] Here should be no need for spreading new array, just `partialPieces = partialPiecesUnchecked`
|
|
5570
5559
|
return [3 /*break*/, 6];
|
|
5571
5560
|
}
|
|
5572
5561
|
_d.label = 5;
|
|
@@ -5614,7 +5603,7 @@ TODO: [🧊] This is how it can look in future
|
|
|
5614
5603
|
> /**
|
|
5615
5604
|
> * Unprepared knowledge
|
|
5616
5605
|
> * /
|
|
5617
|
-
> readonly knowledgeSources:
|
|
5606
|
+
> readonly knowledgeSources: ReadonlyArray<KnowledgeSourceJson>;
|
|
5618
5607
|
> };
|
|
5619
5608
|
>
|
|
5620
5609
|
> export async function prepareKnowledgePieces(
|
|
@@ -5672,7 +5661,7 @@ function prepareTemplates(pipeline, tools, options) {
|
|
|
5672
5661
|
return __generator(this, function (_b) {
|
|
5673
5662
|
switch (_b.label) {
|
|
5674
5663
|
case 0:
|
|
5675
|
-
_a = options.maxParallelCount, maxParallelCount = _a === void 0 ?
|
|
5664
|
+
_a = options.maxParallelCount, maxParallelCount = _a === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _a;
|
|
5676
5665
|
templates = pipeline.templates, parameters = pipeline.parameters, knowledgePiecesCount = pipeline.knowledgePiecesCount;
|
|
5677
5666
|
// TODO: [main] !!!!! Apply samples to each template (if missing and is for the template defined)
|
|
5678
5667
|
TODO_USE(parameters);
|
|
@@ -5734,7 +5723,7 @@ function preparePipeline(pipeline, tools, options) {
|
|
|
5734
5723
|
if (isPipelinePrepared(pipeline)) {
|
|
5735
5724
|
return [2 /*return*/, pipeline];
|
|
5736
5725
|
}
|
|
5737
|
-
rootDirname = options.rootDirname, _a = options.maxParallelCount, maxParallelCount = _a === void 0 ?
|
|
5726
|
+
rootDirname = options.rootDirname, _a = options.maxParallelCount, maxParallelCount = _a === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _a, _b = options.isVerbose, isVerbose = _b === void 0 ? DEFAULT_IS_VERBOSE : _b;
|
|
5738
5727
|
parameters = pipeline.parameters, templates = pipeline.templates, knowledgeSources = pipeline.knowledgeSources, personas = pipeline.personas;
|
|
5739
5728
|
if (tools === undefined || tools.llm === undefined) {
|
|
5740
5729
|
throw new MissingToolsError('LLM tools are required for preparing the pipeline');
|
|
@@ -5792,7 +5781,9 @@ function preparePipeline(pipeline, tools, options) {
|
|
|
5792
5781
|
// ----- /Templates preparation -----
|
|
5793
5782
|
// Note: Count total usage
|
|
5794
5783
|
currentPreparation.usage = llmToolsWithUsage.getTotalUsage();
|
|
5795
|
-
return [2 /*return*/, $asDeeplyFrozenSerializableJson('Prepared PipelineJson', __assign(__assign({}, clonePipeline(pipeline)), { templates:
|
|
5784
|
+
return [2 /*return*/, $asDeeplyFrozenSerializableJson('Prepared PipelineJson', __assign(__assign({}, clonePipeline(pipeline)), { templates: __spreadArray([], __read(templatesPrepared), false),
|
|
5785
|
+
// <- TODO: [🪓] Here should be no need for spreading new array, just ` templates: templatesPrepared`
|
|
5786
|
+
knowledgeSources: knowledgeSourcesPrepared, knowledgePieces: knowledgePiecesPrepared, personas: preparedPersonas, preparations: __spreadArray([], __read(preparations), false) }))];
|
|
5796
5787
|
}
|
|
5797
5788
|
});
|
|
5798
5789
|
});
|
|
@@ -8962,7 +8953,7 @@ function $registeredLlmToolsMessage() {
|
|
|
8962
8953
|
*/
|
|
8963
8954
|
function createLlmToolsFromConfiguration(configuration, options) {
|
|
8964
8955
|
if (options === void 0) { options = {}; }
|
|
8965
|
-
var _a = options.isVerbose, isVerbose = _a === void 0 ?
|
|
8956
|
+
var _a = options.isVerbose, isVerbose = _a === void 0 ? DEFAULT_IS_VERBOSE : _a, userId = options.userId;
|
|
8966
8957
|
var llmTools = configuration.map(function (llmConfiguration) {
|
|
8967
8958
|
var registeredItem = $llmToolsRegister
|
|
8968
8959
|
.list()
|
|
@@ -9063,7 +9054,7 @@ function $currentDate() {
|
|
|
9063
9054
|
function cacheLlmTools(llmTools, options) {
|
|
9064
9055
|
var _this = this;
|
|
9065
9056
|
if (options === void 0) { options = {}; }
|
|
9066
|
-
var _a = options.storage, storage = _a === void 0 ? new MemoryStorage() : _a, _b = options.
|
|
9057
|
+
var _a = options.storage, storage = _a === void 0 ? new MemoryStorage() : _a, _b = options.isCacheReloaded, isCacheReloaded = _b === void 0 ? false : _b;
|
|
9067
9058
|
var proxyTools = __assign(__assign({}, llmTools), {
|
|
9068
9059
|
// <- Note: [🥫]
|
|
9069
9060
|
get title() {
|
|
@@ -9085,7 +9076,7 @@ function cacheLlmTools(llmTools, options) {
|
|
|
9085
9076
|
key = titleToName(prompt.title.substring(0, MAX_FILENAME_LENGTH - 10) +
|
|
9086
9077
|
'-' +
|
|
9087
9078
|
sha256(hexEncoder.parse(JSON.stringify(prompt.parameters))).toString( /* hex */));
|
|
9088
|
-
if (!!
|
|
9079
|
+
if (!!isCacheReloaded) return [3 /*break*/, 2];
|
|
9089
9080
|
return [4 /*yield*/, storage.getItem(key)];
|
|
9090
9081
|
case 1:
|
|
9091
9082
|
_a = _c.sent();
|
|
@@ -9394,7 +9385,11 @@ var legacyDocumentScraperMetadata = $deepFreeze({
|
|
|
9394
9385
|
mimeTypes: ['application/msword', 'text/rtf'],
|
|
9395
9386
|
documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/@@',
|
|
9396
9387
|
isAvilableInBrowser: false,
|
|
9397
|
-
requiredExecutables: [
|
|
9388
|
+
requiredExecutables: [
|
|
9389
|
+
'Pandoc',
|
|
9390
|
+
'LibreOffice',
|
|
9391
|
+
// <- TODO: [🧠] Should be 'LibreOffice' here, its dependency of dependency
|
|
9392
|
+
],
|
|
9398
9393
|
}); /* <- TODO: [🤛] */
|
|
9399
9394
|
/**
|
|
9400
9395
|
* Registration of known scraper metadata
|
|
@@ -9418,7 +9413,7 @@ var documentScraperMetadata = $deepFreeze({
|
|
|
9418
9413
|
mimeTypes: ['application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
|
|
9419
9414
|
documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/@@',
|
|
9420
9415
|
isAvilableInBrowser: false,
|
|
9421
|
-
requiredExecutables: ['
|
|
9416
|
+
requiredExecutables: ['Pandoc'],
|
|
9422
9417
|
}); /* <- TODO: [🤛] */
|
|
9423
9418
|
/**
|
|
9424
9419
|
* Registration of known scraper metadata
|
|
@@ -9442,7 +9437,7 @@ var markdownScraperMetadata = $deepFreeze({
|
|
|
9442
9437
|
mimeTypes: ['text/markdown', 'text/plain'],
|
|
9443
9438
|
documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/@@',
|
|
9444
9439
|
isAvilableInBrowser: true,
|
|
9445
|
-
requiredExecutables: [
|
|
9440
|
+
requiredExecutables: [],
|
|
9446
9441
|
}); /* <- TODO: [🤛] */
|
|
9447
9442
|
/**
|
|
9448
9443
|
* Registration of known scraper metadata
|
|
@@ -9466,7 +9461,7 @@ var pdfScraperMetadata = $deepFreeze({
|
|
|
9466
9461
|
mimeTypes: ['application/pdf'],
|
|
9467
9462
|
documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/@@',
|
|
9468
9463
|
isAvilableInBrowser: true,
|
|
9469
|
-
requiredExecutables: [
|
|
9464
|
+
requiredExecutables: [],
|
|
9470
9465
|
}); /* <- TODO: [🤛] */
|
|
9471
9466
|
/**
|
|
9472
9467
|
* Registration of known scraper metadata
|
|
@@ -9490,7 +9485,7 @@ var websiteScraperMetadata = $deepFreeze({
|
|
|
9490
9485
|
mimeTypes: ['text/html'],
|
|
9491
9486
|
documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/@@',
|
|
9492
9487
|
isAvilableInBrowser: false,
|
|
9493
|
-
requiredExecutables: [
|
|
9488
|
+
requiredExecutables: [],
|
|
9494
9489
|
}); /* <- TODO: [🤛] */
|
|
9495
9490
|
/**
|
|
9496
9491
|
* Registration of known scraper metadata
|
|
@@ -9852,5 +9847,5 @@ function executionReportJsonToString(executionReportJson, options) {
|
|
|
9852
9847
|
* TODO: [🧠] Should be in generated file GENERATOR_WARNING
|
|
9853
9848
|
*/
|
|
9854
9849
|
|
|
9855
|
-
export { $llmToolsMetadataRegister, $llmToolsRegister, $scrapersMetadataRegister, $scrapersRegister, AbstractFormatError, CLAIM, CallbackInterfaceTools, CollectionError, CsvFormatDefinition, CsvFormatError, DEFAULT_CSV_SETTINGS,
|
|
9850
|
+
export { $llmToolsMetadataRegister, $llmToolsRegister, $scrapersMetadataRegister, $scrapersRegister, AbstractFormatError, CLAIM, CallbackInterfaceTools, CollectionError, CsvFormatDefinition, CsvFormatError, DEFAULT_CSV_SETTINGS, DEFAULT_EXECUTIONS_CACHE_DIRNAME, DEFAULT_INTERMEDIATE_FILES_STRATEGY, DEFAULT_IS_AUTO_INSTALLED, DEFAULT_IS_VERBOSE, DEFAULT_MAX_EXECUTION_ATTEMPTS, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, DEFAULT_MAX_PARALLEL_COUNT, DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME, DEFAULT_REMOTE_URL, DEFAULT_REMOTE_URL_PATH, DEFAULT_SCRAPE_CACHE_DIRNAME, ERRORS, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, KnowledgeScrapeError, LimitReachedError, MANDATORY_CSV_SETTINGS, MAX_FILENAME_LENGTH, MODEL_VARIANTS, MemoryStorage, MissingToolsError, MultipleLlmExecutionTools, NotFoundError, NotYetImplementedError, PROMPTBOOK_VERSION, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, RESERVED_PARAMETER_NAMES, TemplateTypes, TextFormatDefinition, UNCERTAIN_USAGE, UnexpectedError, ZERO_USAGE, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _DocumentScraperMetadataRegistration, _LegacyDocumentScraperMetadataRegistration, _MarkdownScraperMetadataRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiMetadataRegistration, _PdfScraperMetadataRegistration, _WebsiteScraperMetadataRegistration, addUsage, assertsExecutionSuccessful, cacheLlmTools, collectionToJson, countTotalUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, isPipelinePrepared, joinLlmExecutionTools, limitTotalUsage, makeKnowledgeSourceHandler, pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTemplates, prettifyPipelineString, stringifyPipelineJson, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline };
|
|
9856
9851
|
//# sourceMappingURL=index.es.js.map
|