@promptbook/markdown-utils 0.92.0-9 → 0.93.0
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 +140 -88
- package/esm/index.es.js +585 -404
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +26 -14
- package/esm/typings/src/_packages/types.index.d.ts +6 -2
- package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
- package/esm/typings/src/config.d.ts +41 -11
- package/esm/typings/src/constants.d.ts +43 -2
- package/esm/typings/src/conversion/parsePipeline.d.ts +2 -2
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
- package/esm/typings/src/errors/CollectionError.d.ts +1 -1
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
- package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
- package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
- package/esm/typings/src/executables/locateApp.d.ts +2 -2
- package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
- package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
- package/esm/typings/src/execution/CommonToolsOptions.d.ts +3 -3
- package/esm/typings/src/execution/ExecutionTask.d.ts +19 -1
- package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +4 -2
- package/esm/typings/src/execution/PromptbookFetch.d.ts +1 -1
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +13 -10
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -3
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +21 -15
- package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
- package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +18 -5
- package/esm/typings/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +9 -0
- package/esm/typings/src/execution/execution-report/ExecutionReportJson.d.ts +1 -1
- package/esm/typings/src/execution/execution-report/ExecutionReportString.d.ts +1 -1
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +3 -3
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +3 -2
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +1 -1
- package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +8 -6
- package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +66 -0
- package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
- package/esm/typings/src/formats/csv/utils/csvParse.d.ts +12 -0
- package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
- package/esm/typings/src/formats/index.d.ts +2 -2
- package/esm/typings/src/formats/json/JsonFormatParser.d.ts +19 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
- package/esm/typings/src/formats/json/utils/jsonParse.d.ts +0 -3
- package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
- package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
- package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +16 -7
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -1
- package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +29 -0
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/index.d.ts +33 -8
- package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +4 -2
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/high-level-abstractions/index.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +4 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +18 -5
- package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +11 -4
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +21 -42
- package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +9 -2
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +13 -4
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +10 -5
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +11 -3
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +6 -0
- 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/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +4 -4
- package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
- package/esm/typings/src/migrations/migratePipeline.d.ts +9 -0
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +10 -7
- package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +3 -2
- package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
- package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +1 -1
- package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +2 -2
- package/esm/typings/src/prepare/prepareTasks.d.ts +8 -5
- package/esm/typings/src/remote-server/openapi.d.ts +1 -1
- package/esm/typings/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +1 -1
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -1
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +7 -6
- package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
- package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
- package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -1
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +11 -0
- package/esm/typings/src/storage/local-storage/utils/IndexedDbStorageOptions.d.ts +14 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +8 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
- package/esm/typings/src/types/ModelRequirements.d.ts +2 -2
- package/esm/typings/src/types/ModelVariant.d.ts +5 -5
- package/esm/typings/src/types/typeAliases.d.ts +22 -19
- package/esm/typings/src/utils/$Register.d.ts +8 -7
- package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
- package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
- package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -2
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
- package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
- package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
- package/esm/typings/src/utils/organization/just.d.ts +1 -1
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
- package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
- package/esm/typings/src/utils/removeQuotes.d.ts +2 -2
- package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
- package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
- package/esm/typings/src/utils/trimCodeBlock.d.ts +1 -1
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +1 -1
- package/esm/typings/src/utils/unwrapResult.d.ts +2 -2
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +1 -1
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +1 -1
- package/esm/typings/src/version.d.ts +2 -1
- package/esm/typings/src/wizzard/wizzard.d.ts +1 -1
- package/package.json +14 -2
- package/umd/index.umd.js +585 -404
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +0 -31
- package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +0 -19
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/MultipleLlmExecutionTools.d.ts +0 -0
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/joinLlmExecutionTools.d.ts +0 -0
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/playground/playground.d.ts +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
2
|
import { SimplePromptInterfaceTools } from '../dialogs/simple-prompt/SimplePromptInterfaceTools';
|
|
3
3
|
import { $provideScrapersForBrowser } from '../scrapers/_common/register/$provideScrapersForBrowser';
|
|
4
|
+
import { getIndexedDbStorage } from '../storage/local-storage/getIndexedDbStorage';
|
|
4
5
|
import { getLocalStorage } from '../storage/local-storage/getLocalStorage';
|
|
5
6
|
import { getSessionStorage } from '../storage/local-storage/getSessionStorage';
|
|
6
7
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
7
8
|
export { SimplePromptInterfaceTools };
|
|
8
9
|
export { $provideScrapersForBrowser };
|
|
10
|
+
export { getIndexedDbStorage };
|
|
9
11
|
export { getLocalStorage };
|
|
10
12
|
export { getSessionStorage };
|
|
@@ -13,6 +13,9 @@ import { DEFAULT_TASK_TITLE } from '../config';
|
|
|
13
13
|
import { DEFAULT_PROMPT_TASK_TITLE } from '../config';
|
|
14
14
|
import { DEFAULT_BOOK_OUTPUT_PARAMETER_NAME } from '../config';
|
|
15
15
|
import { DEFAULT_MAX_FILE_SIZE } from '../config';
|
|
16
|
+
import { BIG_DATASET_TRESHOLD } from '../config';
|
|
17
|
+
import { FAILED_VALUE_PLACEHOLDER } from '../config';
|
|
18
|
+
import { PENDING_VALUE_PLACEHOLDER } from '../config';
|
|
16
19
|
import { MAX_FILENAME_LENGTH } from '../config';
|
|
17
20
|
import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
|
|
18
21
|
import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
|
|
@@ -32,6 +35,9 @@ import { DEFAULT_IS_VERBOSE } from '../config';
|
|
|
32
35
|
import { SET_IS_VERBOSE } from '../config';
|
|
33
36
|
import { DEFAULT_IS_AUTO_INSTALLED } from '../config';
|
|
34
37
|
import { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME } from '../config';
|
|
38
|
+
import { DEFAULT_MAX_REQUESTS_PER_MINUTE } from '../config';
|
|
39
|
+
import { MODEL_TRUST_LEVELS } from '../constants';
|
|
40
|
+
import { MODEL_ORDERS } from '../constants';
|
|
35
41
|
import { ORDER_OF_PIPELINE_JSON } from '../constants';
|
|
36
42
|
import { RESERVED_PARAMETER_NAMES } from '../constants';
|
|
37
43
|
import { compilePipeline } from '../conversion/compilePipeline';
|
|
@@ -62,6 +68,7 @@ import { PromptbookFetchError } from '../errors/PromptbookFetchError';
|
|
|
62
68
|
import { UnexpectedError } from '../errors/UnexpectedError';
|
|
63
69
|
import { WrappedError } from '../errors/WrappedError';
|
|
64
70
|
import { createPipelineExecutor } from '../execution/createPipelineExecutor/00-createPipelineExecutor';
|
|
71
|
+
import { computeCosineSimilarity } from '../execution/createPipelineExecutor/computeCosineSimilarity';
|
|
65
72
|
import { embeddingVectorToString } from '../execution/embeddingVectorToString';
|
|
66
73
|
import { executionReportJsonToString } from '../execution/execution-report/executionReportJsonToString';
|
|
67
74
|
import type { ExecutionReportStringOptions } from '../execution/execution-report/ExecutionReportStringOptions';
|
|
@@ -74,12 +81,13 @@ import { ZERO_USAGE } from '../execution/utils/usage-constants';
|
|
|
74
81
|
import { UNCERTAIN_USAGE } from '../execution/utils/usage-constants';
|
|
75
82
|
import { usageToHuman } from '../execution/utils/usageToHuman';
|
|
76
83
|
import { usageToWorktime } from '../execution/utils/usageToWorktime';
|
|
77
|
-
import { CsvFormatDefinition } from '../formats/csv/CsvFormatDefinition';
|
|
78
84
|
import { CsvFormatError } from '../formats/csv/CsvFormatError';
|
|
85
|
+
import { CsvFormatParser } from '../formats/csv/CsvFormatParser';
|
|
79
86
|
import { MANDATORY_CSV_SETTINGS } from '../formats/csv/CsvSettings';
|
|
80
|
-
import {
|
|
87
|
+
import { TextFormatParser } from '../formats/text/TextFormatParser';
|
|
81
88
|
import { BoilerplateFormfactorDefinition } from '../formfactors/_boilerplate/BoilerplateFormfactorDefinition';
|
|
82
89
|
import { ChatbotFormfactorDefinition } from '../formfactors/chatbot/ChatbotFormfactorDefinition';
|
|
90
|
+
import { CompletionFormfactorDefinition } from '../formfactors/completion/CompletionFormfactorDefinition';
|
|
83
91
|
import { GeneratorFormfactorDefinition } from '../formfactors/generator/GeneratorFormfactorDefinition';
|
|
84
92
|
import { GenericFormfactorDefinition } from '../formfactors/generic/GenericFormfactorDefinition';
|
|
85
93
|
import { ImageGeneratorFormfactorDefinition } from '../formfactors/image-generator/ImageGeneratorFormfactorDefinition';
|
|
@@ -91,19 +99,18 @@ import { filterModels } from '../llm-providers/_common/filterModels';
|
|
|
91
99
|
import { $llmToolsMetadataRegister } from '../llm-providers/_common/register/$llmToolsMetadataRegister';
|
|
92
100
|
import { $llmToolsRegister } from '../llm-providers/_common/register/$llmToolsRegister';
|
|
93
101
|
import { createLlmToolsFromConfiguration } from '../llm-providers/_common/register/createLlmToolsFromConfiguration';
|
|
94
|
-
import { MODEL_TRUST_LEVEL } from '../llm-providers/_common/register/LlmToolsMetadata';
|
|
95
|
-
import { MODEL_ORDER } from '../llm-providers/_common/register/LlmToolsMetadata';
|
|
96
102
|
import { cacheLlmTools } from '../llm-providers/_common/utils/cache/cacheLlmTools';
|
|
97
103
|
import { countUsage } from '../llm-providers/_common/utils/count-total-usage/countUsage';
|
|
98
104
|
import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
|
|
105
|
+
import { joinLlmExecutionTools } from '../llm-providers/_multiple/joinLlmExecutionTools';
|
|
106
|
+
import { MultipleLlmExecutionTools } from '../llm-providers/_multiple/MultipleLlmExecutionTools';
|
|
99
107
|
import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
|
|
100
108
|
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
101
109
|
import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
|
|
102
110
|
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
103
|
-
import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
|
|
104
|
-
import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
|
|
105
111
|
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
106
112
|
import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
113
|
+
import { migratePipeline } from '../migrations/migratePipeline';
|
|
107
114
|
import { preparePersona } from '../personas/preparePersona';
|
|
108
115
|
import { book } from '../pipeline/book-notation';
|
|
109
116
|
import { isValidPipelineString } from '../pipeline/isValidPipelineString';
|
|
@@ -115,7 +122,6 @@ import { EXPECTATION_UNITS } from '../pipeline/PipelineJson/Expectations';
|
|
|
115
122
|
import { validatePipelineString } from '../pipeline/validatePipelineString';
|
|
116
123
|
import { isPipelinePrepared } from '../prepare/isPipelinePrepared';
|
|
117
124
|
import { preparePipeline } from '../prepare/preparePipeline';
|
|
118
|
-
import { prepareTasks } from '../prepare/prepareTasks';
|
|
119
125
|
import { unpreparePipeline } from '../prepare/unpreparePipeline';
|
|
120
126
|
import { identificationToPromptbookToken } from '../remote-server/socket-types/_subtypes/identificationToPromptbookToken';
|
|
121
127
|
import { promptbookTokenToIdentification } from '../remote-server/socket-types/_subtypes/promptbookTokenToIdentification';
|
|
@@ -154,6 +160,9 @@ export { DEFAULT_TASK_TITLE };
|
|
|
154
160
|
export { DEFAULT_PROMPT_TASK_TITLE };
|
|
155
161
|
export { DEFAULT_BOOK_OUTPUT_PARAMETER_NAME };
|
|
156
162
|
export { DEFAULT_MAX_FILE_SIZE };
|
|
163
|
+
export { BIG_DATASET_TRESHOLD };
|
|
164
|
+
export { FAILED_VALUE_PLACEHOLDER };
|
|
165
|
+
export { PENDING_VALUE_PLACEHOLDER };
|
|
157
166
|
export { MAX_FILENAME_LENGTH };
|
|
158
167
|
export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
|
|
159
168
|
export { DEFAULT_MAX_PARALLEL_COUNT };
|
|
@@ -173,6 +182,9 @@ export { DEFAULT_IS_VERBOSE };
|
|
|
173
182
|
export { SET_IS_VERBOSE };
|
|
174
183
|
export { DEFAULT_IS_AUTO_INSTALLED };
|
|
175
184
|
export { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME };
|
|
185
|
+
export { DEFAULT_MAX_REQUESTS_PER_MINUTE };
|
|
186
|
+
export { MODEL_TRUST_LEVELS };
|
|
187
|
+
export { MODEL_ORDERS };
|
|
176
188
|
export { ORDER_OF_PIPELINE_JSON };
|
|
177
189
|
export { RESERVED_PARAMETER_NAMES };
|
|
178
190
|
export { compilePipeline };
|
|
@@ -203,6 +215,7 @@ export { PromptbookFetchError };
|
|
|
203
215
|
export { UnexpectedError };
|
|
204
216
|
export { WrappedError };
|
|
205
217
|
export { createPipelineExecutor };
|
|
218
|
+
export { computeCosineSimilarity };
|
|
206
219
|
export { embeddingVectorToString };
|
|
207
220
|
export { executionReportJsonToString };
|
|
208
221
|
export type { ExecutionReportStringOptions };
|
|
@@ -215,12 +228,13 @@ export { ZERO_USAGE };
|
|
|
215
228
|
export { UNCERTAIN_USAGE };
|
|
216
229
|
export { usageToHuman };
|
|
217
230
|
export { usageToWorktime };
|
|
218
|
-
export { CsvFormatDefinition };
|
|
219
231
|
export { CsvFormatError };
|
|
232
|
+
export { CsvFormatParser };
|
|
220
233
|
export { MANDATORY_CSV_SETTINGS };
|
|
221
|
-
export {
|
|
234
|
+
export { TextFormatParser };
|
|
222
235
|
export { BoilerplateFormfactorDefinition };
|
|
223
236
|
export { ChatbotFormfactorDefinition };
|
|
237
|
+
export { CompletionFormfactorDefinition };
|
|
224
238
|
export { GeneratorFormfactorDefinition };
|
|
225
239
|
export { GenericFormfactorDefinition };
|
|
226
240
|
export { ImageGeneratorFormfactorDefinition };
|
|
@@ -232,19 +246,18 @@ export { filterModels };
|
|
|
232
246
|
export { $llmToolsMetadataRegister };
|
|
233
247
|
export { $llmToolsRegister };
|
|
234
248
|
export { createLlmToolsFromConfiguration };
|
|
235
|
-
export { MODEL_TRUST_LEVEL };
|
|
236
|
-
export { MODEL_ORDER };
|
|
237
249
|
export { cacheLlmTools };
|
|
238
250
|
export { countUsage };
|
|
239
251
|
export { limitTotalUsage };
|
|
252
|
+
export { joinLlmExecutionTools };
|
|
253
|
+
export { MultipleLlmExecutionTools };
|
|
240
254
|
export { _AnthropicClaudeMetadataRegistration };
|
|
241
255
|
export { _AzureOpenAiMetadataRegistration };
|
|
242
256
|
export { _DeepseekMetadataRegistration };
|
|
243
257
|
export { _GoogleMetadataRegistration };
|
|
244
|
-
export { joinLlmExecutionTools };
|
|
245
|
-
export { MultipleLlmExecutionTools };
|
|
246
258
|
export { _OpenAiMetadataRegistration };
|
|
247
259
|
export { _OpenAiAssistantMetadataRegistration };
|
|
260
|
+
export { migratePipeline };
|
|
248
261
|
export { preparePersona };
|
|
249
262
|
export { book };
|
|
250
263
|
export { isValidPipelineString };
|
|
@@ -256,7 +269,6 @@ export { EXPECTATION_UNITS };
|
|
|
256
269
|
export { validatePipelineString };
|
|
257
270
|
export { isPipelinePrepared };
|
|
258
271
|
export { preparePipeline };
|
|
259
|
-
export { prepareTasks };
|
|
260
272
|
export { unpreparePipeline };
|
|
261
273
|
export { identificationToPromptbookToken };
|
|
262
274
|
export { promptbookTokenToIdentification };
|
|
@@ -61,7 +61,8 @@ import type { Usage } from '../execution/Usage';
|
|
|
61
61
|
import type { UsageCounts } from '../execution/Usage';
|
|
62
62
|
import type { UserInterfaceTools } from '../execution/UserInterfaceTools';
|
|
63
63
|
import type { UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
|
|
64
|
-
import type {
|
|
64
|
+
import type { FormatSubvalueParser } from '../formats/_common/FormatSubvalueParser';
|
|
65
|
+
import type { FormatSubvalueParserMapValuesOptions } from '../formats/_common/FormatSubvalueParser';
|
|
65
66
|
import type { CsvSettings } from '../formats/csv/CsvSettings';
|
|
66
67
|
import type { AbstractFormfactorDefinition } from '../formfactors/_common/AbstractFormfactorDefinition';
|
|
67
68
|
import type { FormfactorDefinition } from '../formfactors/_common/FormfactorDefinition';
|
|
@@ -133,6 +134,7 @@ import type { JavascriptExecutionToolsOptions } from '../scripting/javascript/Ja
|
|
|
133
134
|
import type { PostprocessingFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
134
135
|
import type { PromptbookStorage } from '../storage/_common/PromptbookStorage';
|
|
135
136
|
import type { FileCacheStorageOptions } from '../storage/file-cache-storage/FileCacheStorageOptions';
|
|
137
|
+
import type { IndexedDbStorageOptions } from '../storage/local-storage/utils/IndexedDbStorageOptions';
|
|
136
138
|
import type { IntermediateFilesStrategy } from '../types/IntermediateFilesStrategy';
|
|
137
139
|
import type { ModelRequirements } from '../types/ModelRequirements';
|
|
138
140
|
import type { CompletionModelRequirements } from '../types/ModelRequirements';
|
|
@@ -357,7 +359,8 @@ export type { Usage };
|
|
|
357
359
|
export type { UsageCounts };
|
|
358
360
|
export type { UserInterfaceTools };
|
|
359
361
|
export type { UserInterfaceToolsPromptDialogOptions };
|
|
360
|
-
export type {
|
|
362
|
+
export type { FormatSubvalueParser };
|
|
363
|
+
export type { FormatSubvalueParserMapValuesOptions };
|
|
361
364
|
export type { CsvSettings };
|
|
362
365
|
export type { AbstractFormfactorDefinition };
|
|
363
366
|
export type { FormfactorDefinition };
|
|
@@ -429,6 +432,7 @@ export type { JavascriptExecutionToolsOptions };
|
|
|
429
432
|
export type { PostprocessingFunction };
|
|
430
433
|
export type { PromptbookStorage };
|
|
431
434
|
export type { FileCacheStorageOptions };
|
|
435
|
+
export type { IndexedDbStorageOptions };
|
|
432
436
|
export type { IntermediateFilesStrategy };
|
|
433
437
|
export type { ModelRequirements };
|
|
434
438
|
export type { CompletionModelRequirements };
|
|
@@ -4,8 +4,6 @@ import type { Prompt } from '../types/Prompt';
|
|
|
4
4
|
import type { string_pipeline_url } from '../types/typeAliases';
|
|
5
5
|
/**
|
|
6
6
|
* Collection that groups together pipelines, knowledge, personas, tools and actions
|
|
7
|
-
*
|
|
8
|
-
* @see @@@ https://github.com/webgptorg/pipeline#pipeline-collection
|
|
9
7
|
*/
|
|
10
8
|
export type PipelineCollection = {
|
|
11
9
|
/**
|
|
@@ -14,7 +14,7 @@ export declare class SimplePipelineCollection implements PipelineCollection {
|
|
|
14
14
|
/**
|
|
15
15
|
* Constructs a pipeline collection from pipelines
|
|
16
16
|
*
|
|
17
|
-
* @param pipelines
|
|
17
|
+
* @param pipelines Array of pipeline JSON objects to include in the collection
|
|
18
18
|
*
|
|
19
19
|
* Note: During the construction logic of all pipelines are validated
|
|
20
20
|
* Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import type { string_parameter_name } from '../../types/typeAliases';
|
|
2
2
|
import type { TODO_string } from '../../utils/organization/TODO_string';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Information for the FOREACH command, describing how to iterate over a parameter's subvalues in a pipeline task.
|
|
5
5
|
*/
|
|
6
6
|
export type ForeachJson = {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* The name of the format to use for parsing the parameter (e.g., 'CSV').
|
|
9
9
|
*/
|
|
10
10
|
readonly formatName: TODO_string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* The name of the subformat to use (e.g., CSV Rows).
|
|
13
13
|
*/
|
|
14
14
|
readonly subformatName: TODO_string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* The name of the parameter to iterate over.
|
|
17
17
|
*/
|
|
18
18
|
readonly parameterName: string_parameter_name;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* The names of the subparameters (e.g., name of the CSV rows)
|
|
21
21
|
*/
|
|
22
22
|
readonly inputSubparameterNames: Array<string_parameter_name>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* The name of the subparameters (e.g., name of the CSV rows)
|
|
25
25
|
*/
|
|
26
26
|
readonly outputSubparameterName: string_parameter_name;
|
|
27
27
|
};
|
|
@@ -3,8 +3,6 @@ import type { ForeachCommand } from './ForeachCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the foreach command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book` file
|
|
7
|
-
*
|
|
8
6
|
* @see `documentationUrl` for more details
|
|
9
7
|
* @public exported from `@promptbook/editable`
|
|
10
8
|
*/
|
|
@@ -3,7 +3,7 @@ import type { FormfactorCommand } from './FormfactorCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the formfactor command
|
|
5
5
|
*
|
|
6
|
-
* Note:
|
|
6
|
+
* Note: This command is used as a formfactor for new commands and defines the app type format - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @public exported from `@promptbook/editable`
|
|
@@ -3,7 +3,7 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the boilerplate command
|
|
5
5
|
*
|
|
6
|
-
* Note:
|
|
6
|
+
* Note: @@ This command is used as boilerplate for new commands - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @private within the commands folder
|
|
@@ -8,7 +8,8 @@ import type { string_SCREAMING_CASE } from '../../../utils/normalization/normali
|
|
|
8
8
|
import type { ___and___ } from '../../../utils/organization/___and___';
|
|
9
9
|
import type { CommandUsagePlace } from './CommandUsagePlaces';
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Base type for all command objects.
|
|
12
|
+
* Requires a `type` property which is a SCREAMING_CASE string.
|
|
12
13
|
*
|
|
13
14
|
* @private just abstract helper for command parsers
|
|
14
15
|
*/
|
|
@@ -16,47 +17,48 @@ export type CommandBase = {
|
|
|
16
17
|
type: string_name & string_SCREAMING_CASE;
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Represents a parser for a specific command used within a Promptbook pipeline.
|
|
21
|
+
* It can parse commands used in the pipeline head, tasks, or both.
|
|
20
22
|
*
|
|
21
23
|
* @public exported from `@promptbook/editable`
|
|
22
24
|
*/
|
|
23
25
|
export type CommandParser<TCommand extends CommandBase> = PipelineHeadCommandParser<TCommand> | PipelineTaskCommandParser<TCommand> | PipelineBothCommandParser<TCommand>;
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
27
|
+
* Common properties shared by all command parsers.
|
|
26
28
|
*
|
|
27
29
|
* @private just abstract the common properties of the command parsers
|
|
28
30
|
*/
|
|
29
31
|
export type CommonCommandParser<TCommand extends CommandBase> = {
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* The unique SCREAMING_CASE name of the command (e.g., 'MODEL', 'PARAMETER').
|
|
32
34
|
*/
|
|
33
35
|
readonly name: string_name & string_SCREAMING_CASE;
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
37
|
+
* Indicates if the command can be used in the pipeline's head section.
|
|
36
38
|
*/
|
|
37
39
|
readonly isUsedInPipelineHead: boolean;
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
41
|
+
* Indicates if the command can be used within a pipeline task.
|
|
40
42
|
*/
|
|
41
43
|
readonly isUsedInPipelineTask: boolean;
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
45
|
+
* Optional alternative names (aliases) for the command, also in SCREAMING_CASE.
|
|
44
46
|
*/
|
|
45
47
|
readonly aliasNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
49
|
+
* Optional list of deprecated names for the command, used for backward compatibility.
|
|
48
50
|
*/
|
|
49
51
|
readonly deprecatedNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
|
|
50
52
|
/**
|
|
51
|
-
*
|
|
53
|
+
* A brief description of the command's purpose, supporting simple Markdown.
|
|
52
54
|
*/
|
|
53
55
|
readonly description: string_markdown_text;
|
|
54
56
|
/**
|
|
55
|
-
*
|
|
57
|
+
* A URL pointing to the command's documentation.
|
|
56
58
|
*/
|
|
57
59
|
readonly documentationUrl: string_promptbook_documentation_url;
|
|
58
60
|
/**
|
|
59
|
-
*
|
|
61
|
+
* Examples demonstrating the usage of the command in Markdown format.
|
|
60
62
|
*/
|
|
61
63
|
readonly examples: ReadonlyArray<string_markdown_text>;
|
|
62
64
|
/**
|
|
@@ -72,23 +74,23 @@ export type CommonCommandParser<TCommand extends CommandBase> = {
|
|
|
72
74
|
stringify(command: TCommand): string_markdown_text;
|
|
73
75
|
};
|
|
74
76
|
/**
|
|
75
|
-
*
|
|
77
|
+
* Represents a command parser that can be used in both the pipeline head and tasks.
|
|
76
78
|
*
|
|
77
79
|
* @public exported from `@promptbook/editable`
|
|
78
80
|
*/
|
|
79
81
|
export type PipelineBothCommandParser<TCommand extends CommandBase> = ___and___ & Omit<PipelineHeadCommandParser<TCommand>, 'isUsedInPipelineTask'> & Omit<PipelineTaskCommandParser<TCommand>, 'isUsedInPipelineHead'>;
|
|
80
82
|
/**
|
|
81
|
-
*
|
|
83
|
+
* Represents a command parser specifically for the pipeline head section.
|
|
82
84
|
*
|
|
83
85
|
* @public exported from `@promptbook/editable`
|
|
84
86
|
*/
|
|
85
87
|
export type PipelineHeadCommandParser<TCommand extends CommandBase> = CommonCommandParser<TCommand> & {
|
|
86
88
|
/**
|
|
87
|
-
*
|
|
89
|
+
* Always true for pipeline head commands.
|
|
88
90
|
*/
|
|
89
91
|
readonly isUsedInPipelineHead: true;
|
|
90
92
|
/**
|
|
91
|
-
*
|
|
93
|
+
* Always false for pipeline head commands.
|
|
92
94
|
*/
|
|
93
95
|
readonly isUsedInPipelineTask: false;
|
|
94
96
|
/**
|
|
@@ -106,17 +108,17 @@ export type PipelineHeadCommandParser<TCommand extends CommandBase> = CommonComm
|
|
|
106
108
|
takeFromPipelineJson(pipelineJson: PipelineJson): ReadonlyArray<TCommand>;
|
|
107
109
|
};
|
|
108
110
|
/**
|
|
109
|
-
*
|
|
111
|
+
* Represents a command parser specifically for pipeline tasks.
|
|
110
112
|
*
|
|
111
113
|
* @public exported from `@promptbook/editable`
|
|
112
114
|
*/
|
|
113
115
|
export type PipelineTaskCommandParser<TCommand extends CommandBase> = CommonCommandParser<TCommand> & {
|
|
114
116
|
/**
|
|
115
|
-
*
|
|
117
|
+
* Always false for pipeline task commands.
|
|
116
118
|
*/
|
|
117
119
|
readonly isUsedInPipelineHead: false;
|
|
118
120
|
/**
|
|
119
|
-
*
|
|
121
|
+
* Always true for pipeline task commands.
|
|
120
122
|
*/
|
|
121
123
|
readonly isUsedInPipelineTask: true;
|
|
122
124
|
/**
|
|
@@ -133,58 +135,64 @@ export type PipelineTaskCommandParser<TCommand extends CommandBase> = CommonComm
|
|
|
133
135
|
takeFromTaskJson($taskJson: $TaskJson): ReadonlyArray<TCommand>;
|
|
134
136
|
};
|
|
135
137
|
/**
|
|
136
|
-
*
|
|
138
|
+
* Represents a mutable TaskJson object, used internally by command parsers during application.
|
|
137
139
|
*
|
|
138
|
-
* Note: `$`
|
|
140
|
+
* Note: `$` prefix indicates the object is intended for mutation.
|
|
139
141
|
*
|
|
140
142
|
* @private internal helper for command parsers
|
|
141
143
|
*/
|
|
142
144
|
export type $TaskJson = {
|
|
145
|
+
/**
|
|
146
|
+
* Flag indicating if the section type (e.g., `SIMPLE_TEMPLATE`) has been set for this task.
|
|
147
|
+
*/
|
|
143
148
|
isSectionTypeSet: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Flag indicating if this object represents a task (as opposed to other sections like parameters).
|
|
151
|
+
*/
|
|
144
152
|
isTask: boolean;
|
|
145
153
|
} & Partial<WritableDeep<TaskJson>>;
|
|
146
154
|
/**
|
|
147
|
-
*
|
|
155
|
+
* Represents a mutable PipelineJson object, used internally by command parsers during application.
|
|
148
156
|
*
|
|
149
|
-
*
|
|
157
|
+
* Note: `$` prefix indicates the object is intended for mutation.
|
|
150
158
|
*
|
|
151
159
|
* @private internal helper for command parsers
|
|
152
160
|
*/
|
|
153
161
|
export type $PipelineJson = WritableDeep<SetOptional<PipelineJson, 'formfactorName'>>;
|
|
154
162
|
/**
|
|
155
|
-
*
|
|
163
|
+
* Input object provided to the `parse` method of a CommandParser.
|
|
156
164
|
*/
|
|
157
165
|
export type CommandParserInput = {
|
|
158
166
|
/**
|
|
159
|
-
*
|
|
167
|
+
* Specifies where the command is being used (pipeline head or task).
|
|
160
168
|
*
|
|
161
169
|
* @example 'PIPELINE_HEAD'
|
|
162
170
|
* @example 'PIPELINE_TASK'
|
|
163
171
|
*/
|
|
164
172
|
readonly usagePlace: CommandUsagePlace;
|
|
165
173
|
/**
|
|
166
|
-
*
|
|
174
|
+
* The raw, unprocessed line containing the command and its arguments.
|
|
167
175
|
*
|
|
168
176
|
* @example 'promptbook version 0.62.0'
|
|
169
177
|
* @example 'FOREACH Text Line `{customers}` -> `{customer}`'
|
|
170
178
|
*/
|
|
171
179
|
readonly raw: string_markdown_text;
|
|
172
180
|
/**
|
|
173
|
-
*
|
|
181
|
+
* The arguments part of the raw command line, after the command name.
|
|
174
182
|
*
|
|
175
183
|
* @example '0.62.0'
|
|
176
184
|
* @example 'List Line `{customers}` -> `{customer}`'
|
|
177
185
|
*/
|
|
178
186
|
readonly rawArgs: string_markdown_text;
|
|
179
187
|
/**
|
|
180
|
-
*
|
|
188
|
+
* The normalized, SCREAMING_CASE representation of the command and its core arguments.
|
|
181
189
|
*
|
|
182
190
|
* @example 'PROMPTBOOK_ENGINE_VERSION_0_62_0'
|
|
183
191
|
* @example 'FOREACH_LIST_LINE_CUSTOMERS_CUSTOMER'
|
|
184
192
|
*/
|
|
185
193
|
readonly normalized: string_name & string_SCREAMING_CASE;
|
|
186
194
|
/**
|
|
187
|
-
*
|
|
195
|
+
* An array of arguments extracted from the line where the command is used.
|
|
188
196
|
*
|
|
189
197
|
* @example [ '0.62.0' ]
|
|
190
198
|
* @example [ 'List', 'Line', '{customers}', '', '{customer}' ]
|
|
@@ -68,6 +68,28 @@ export declare const DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = "result";
|
|
|
68
68
|
* @public exported from `@promptbook/core`
|
|
69
69
|
*/
|
|
70
70
|
export declare const DEFAULT_MAX_FILE_SIZE: number;
|
|
71
|
+
/**
|
|
72
|
+
* Threshold value that determines when a dataset is considered "big"
|
|
73
|
+
* and may require special handling or optimizations
|
|
74
|
+
*
|
|
75
|
+
* For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
|
|
76
|
+
*
|
|
77
|
+
* @public exported from `@promptbook/core`
|
|
78
|
+
*/
|
|
79
|
+
export declare const BIG_DATASET_TRESHOLD = 50;
|
|
80
|
+
/**
|
|
81
|
+
* Placeholder text used to represent a placeholder value of failed operation
|
|
82
|
+
*
|
|
83
|
+
* @public exported from `@promptbook/core`
|
|
84
|
+
*/
|
|
85
|
+
export declare const FAILED_VALUE_PLACEHOLDER = "!?";
|
|
86
|
+
/**
|
|
87
|
+
* Placeholder text used to represent operations or values that are still in progress
|
|
88
|
+
* or awaiting completion in UI displays and logging
|
|
89
|
+
*
|
|
90
|
+
* @public exported from `@promptbook/core`
|
|
91
|
+
*/
|
|
92
|
+
export declare const PENDING_VALUE_PLACEHOLDER = "\u2026";
|
|
71
93
|
/**
|
|
72
94
|
* Warning message for the generated sections and files files
|
|
73
95
|
*
|
|
@@ -156,15 +178,15 @@ export declare const DEFAULT_MAX_PARALLEL_COUNT = 5;
|
|
|
156
178
|
*/
|
|
157
179
|
export declare const DEFAULT_MAX_EXECUTION_ATTEMPTS = 10;
|
|
158
180
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
181
|
+
* The maximum depth to which knowledge sources will be scraped when building a knowledge base.
|
|
182
|
+
* This prevents infinite recursion and limits resource usage.
|
|
161
183
|
*
|
|
162
184
|
* @public exported from `@promptbook/core`
|
|
163
185
|
*/
|
|
164
186
|
export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
|
|
165
187
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
188
|
+
* The maximum total number of knowledge sources that will be scraped in a single operation.
|
|
189
|
+
* This acts as a global limit to avoid excessive resource consumption.
|
|
168
190
|
*
|
|
169
191
|
* @public exported from `@promptbook/core`
|
|
170
192
|
*/
|
|
@@ -234,27 +256,27 @@ export declare const MOMENT_ARG_THRESHOLDS: {
|
|
|
234
256
|
*/
|
|
235
257
|
export declare const DEFAULT_REMOTE_SERVER_URL: string_promptbook_server_url;
|
|
236
258
|
/**
|
|
237
|
-
*
|
|
259
|
+
* Default settings for parsing and generating CSV files in Promptbook.
|
|
238
260
|
*
|
|
239
261
|
* @public exported from `@promptbook/core`
|
|
240
262
|
*/
|
|
241
263
|
export declare const DEFAULT_CSV_SETTINGS: CsvSettings;
|
|
242
264
|
/**
|
|
243
|
-
*
|
|
265
|
+
* Controls whether verbose logging is enabled by default throughout the application.
|
|
244
266
|
*
|
|
245
267
|
* @public exported from `@promptbook/core`
|
|
246
268
|
*/
|
|
247
269
|
export declare let DEFAULT_IS_VERBOSE: boolean;
|
|
248
270
|
/**
|
|
249
|
-
*
|
|
271
|
+
* Enables or disables verbose logging globally at runtime.
|
|
250
272
|
*
|
|
251
|
-
* Note: This is experimental feature
|
|
273
|
+
* Note: This is an experimental feature.
|
|
252
274
|
*
|
|
253
275
|
* @public exported from `@promptbook/core`
|
|
254
276
|
*/
|
|
255
277
|
export declare function SET_IS_VERBOSE(isVerbose: boolean): void;
|
|
256
278
|
/**
|
|
257
|
-
*
|
|
279
|
+
* Controls whether auto-installation of dependencies is enabled by default.
|
|
258
280
|
*
|
|
259
281
|
* @public exported from `@promptbook/core`
|
|
260
282
|
*/
|
|
@@ -266,13 +288,21 @@ export declare const DEFAULT_IS_AUTO_INSTALLED = false;
|
|
|
266
288
|
*/
|
|
267
289
|
export declare const DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME = "getPipelineCollection";
|
|
268
290
|
/**
|
|
269
|
-
*
|
|
291
|
+
* Default rate limits (requests per minute)
|
|
292
|
+
*
|
|
293
|
+
* Note: Adjust based on the provider tier you are have
|
|
294
|
+
*
|
|
295
|
+
* @public exported from `@promptbook/core`
|
|
296
|
+
*/
|
|
297
|
+
export declare const DEFAULT_MAX_REQUESTS_PER_MINUTE = 60;
|
|
298
|
+
/**
|
|
299
|
+
* Indicates whether pipeline logic validation is enabled. When true, the pipeline logic is checked for consistency.
|
|
270
300
|
*
|
|
271
301
|
* @private within the repository
|
|
272
302
|
*/
|
|
273
303
|
export declare const IS_PIPELINE_LOGIC_VALIDATED: boolean;
|
|
274
304
|
/**
|
|
275
|
-
*
|
|
305
|
+
* Indicates whether cost-prevention is enabled. When true, real API keys are prevented from being used in tests.
|
|
276
306
|
*
|
|
277
307
|
* @private within the repository
|
|
278
308
|
*/
|
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
import type { PipelineJson } from './pipeline/PipelineJson/PipelineJson';
|
|
2
2
|
import type { ExportJsonOptions } from './utils/serialization/exportJson';
|
|
3
|
+
/**
|
|
4
|
+
* How is the model provider trusted?
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
7
|
+
*/
|
|
8
|
+
export declare const MODEL_TRUST_LEVELS: {
|
|
9
|
+
readonly FULL: "Model is running on the local machine, training data and model weights are known, data are ethically sourced";
|
|
10
|
+
readonly OPEN: "Model is open source, training data and model weights are known";
|
|
11
|
+
readonly PARTIALLY_OPEN: "Model is open source, but training data and model weights are not (fully) known";
|
|
12
|
+
readonly CLOSED_LOCAL: "Model can be run locally, but it is not open source";
|
|
13
|
+
readonly CLOSED_FREE: "Model is behind API gateway but free to use";
|
|
14
|
+
readonly CLOSED_BUSINESS: "Model is behind API gateway and paid but has good SLA, TOS, privacy policy and in general is a good to use in business applications";
|
|
15
|
+
readonly CLOSED: "Model is behind API gateway and paid";
|
|
16
|
+
readonly UNTRUSTED: "Model has questions about the training data and ethics, but it is not known if it is a problem or not";
|
|
17
|
+
readonly VURNABLE: "Model has some known serious vulnerabilities, leaks, ethical problems, etc.";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* How is the model provider important?
|
|
21
|
+
*
|
|
22
|
+
* @public exported from `@promptbook/core`
|
|
23
|
+
*/
|
|
24
|
+
export declare const MODEL_ORDERS: {
|
|
25
|
+
/**
|
|
26
|
+
* Top-tier models, e.g. OpenAI, Anthropic,...
|
|
27
|
+
*/
|
|
28
|
+
readonly TOP_TIER: 333;
|
|
29
|
+
/**
|
|
30
|
+
* Mid-tier models, e.g. Llama, Mistral, etc.
|
|
31
|
+
*/
|
|
32
|
+
readonly NORMAL: 100;
|
|
33
|
+
/**
|
|
34
|
+
* Low-tier models, e.g. Phi, Tiny, etc.
|
|
35
|
+
*/
|
|
36
|
+
readonly LOW_TIER: 0;
|
|
37
|
+
};
|
|
3
38
|
/**
|
|
4
39
|
* Order of keys in the pipeline JSON
|
|
5
40
|
*
|
|
@@ -13,13 +48,19 @@ export declare const ORDER_OF_PIPELINE_JSON: ExportJsonOptions<PipelineJson>['or
|
|
|
13
48
|
*/
|
|
14
49
|
export declare const REPLACING_NONCE = "ptbkauk42kV2dzao34faw7FudQUHYPtW";
|
|
15
50
|
/**
|
|
16
|
-
*
|
|
51
|
+
* Nonce which is used as string which is not occurring in normal text
|
|
52
|
+
*
|
|
53
|
+
* @private within the repository
|
|
54
|
+
*/
|
|
55
|
+
export declare const SALT_NONCE = "ptbkghhewbvruets21t54et5";
|
|
56
|
+
/**
|
|
57
|
+
* Placeholder value indicating a parameter is missing its value.
|
|
17
58
|
*
|
|
18
59
|
* @private within the repository
|
|
19
60
|
*/
|
|
20
61
|
export declare const RESERVED_PARAMETER_MISSING_VALUE: string;
|
|
21
62
|
/**
|
|
22
|
-
*
|
|
63
|
+
* Placeholder value indicating a parameter is restricted and cannot be used directly.
|
|
23
64
|
*
|
|
24
65
|
* @private within the repository
|
|
25
66
|
*/
|
|
@@ -4,7 +4,7 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
4
4
|
* Compile pipeline from string (markdown) format to JSON format synchronously
|
|
5
5
|
*
|
|
6
6
|
* Note: There are 3 similar functions:
|
|
7
|
-
* - `compilePipeline` **(preferred)** - which
|
|
7
|
+
* - `compilePipeline` **(preferred)** - which properly compiles the promptbook and uses embedding for external knowledge
|
|
8
8
|
* - `parsePipeline` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
9
9
|
* - `preparePipeline` - just one step in the compilation process
|
|
10
10
|
*
|
|
@@ -24,7 +24,7 @@ export declare function parsePipeline(pipelineString: PipelineString): PipelineJ
|
|
|
24
24
|
* TODO: Use spaceTrim more effectively
|
|
25
25
|
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
26
26
|
* TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
|
|
27
|
-
* TODO: [♈]
|
|
27
|
+
* TODO: [♈] Probably move expectations from tasks to parameters
|
|
28
28
|
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
29
29
|
* TODO: [🍙] Make some standard order of json properties
|
|
30
30
|
*/
|