@promptbook/openai 0.61.0-2 → 0.61.0-20
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 +2 -2
- package/esm/index.es.js +181 -18
- package/esm/index.es.js.map +1 -1
- package/esm/typings/promptbook-collection/index.d.ts +200 -30
- package/esm/typings/src/_packages/core.index.d.ts +7 -2
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +1 -1
- package/esm/typings/src/_packages/node.index.d.ts +2 -1
- package/esm/typings/src/_packages/types.index.d.ts +11 -7
- package/esm/typings/src/_packages/utils.index.d.ts +8 -6
- package/esm/typings/src/cli/cli-commands/hello.d.ts +3 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +3 -0
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +3 -0
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
- package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +10 -10
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +8 -7
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
- package/esm/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +2 -3
- package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +2 -2
- package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +42 -14
- package/esm/typings/src/config.d.ts +38 -1
- package/esm/typings/src/config.test.d.ts +4 -0
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -3
- package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
- package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +3 -3
- package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +13 -0
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +12 -3
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +10 -1
- package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
- package/esm/typings/src/errors/LimitReachedError.d.ts +7 -0
- package/esm/typings/src/errors/VersionMismatchError.d.ts +8 -0
- package/esm/typings/src/execution/CommonExecutionToolsOptions.d.ts +1 -0
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +10 -8
- package/esm/typings/src/execution/PipelineExecutor.d.ts +9 -8
- package/esm/typings/src/execution/PromptResult.d.ts +28 -58
- package/esm/typings/src/execution/PromptResultUsage.d.ts +26 -0
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +5 -4
- package/esm/typings/src/execution/UncertainNumber.d.ts +18 -0
- package/esm/typings/src/execution/UserInterfaceTools.d.ts +5 -5
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +19 -3
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
- package/esm/typings/src/execution/utils/addUsage.d.ts +58 -2
- package/esm/typings/src/execution/utils/computeUsageCounts.d.ts +1 -1
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +1 -1
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +2 -2
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +2 -1
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +2 -1
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +2 -1
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +1 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
- package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +27 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +9 -23
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +8 -14
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +30 -0
- package/esm/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +10 -0
- package/esm/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +11 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +16 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-cost/countTotalCost.d.ts +14 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-cost/limitTotalCost.d.ts +32 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -2
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +3 -3
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -4
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
- package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +3 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -5
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +7 -7
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +12 -8
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +7 -6
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +9 -7
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/personas/preparePersona.d.ts +15 -0
- package/esm/typings/src/prepare/PrepareOptions.d.ts +22 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +10 -0
- package/esm/typings/src/prepare/preparePipeline.d.ts +18 -0
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +9 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +2 -1
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +25 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
- package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +30 -0
- package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +13 -0
- package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
- package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +9 -0
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +9 -0
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +34 -0
- package/esm/typings/src/storage/utils/PrefixStorage.d.ts +26 -0
- package/esm/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +71 -11
- package/esm/typings/src/types/ModelVariant.d.ts +14 -0
- package/esm/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
- package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
- package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
- package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +9 -1
- package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +38 -0
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +29 -4
- package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
- package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +5 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +5 -1
- package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +13 -4
- package/esm/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
- package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
- package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
- package/esm/typings/src/types/PipelineString.d.ts +1 -1
- package/esm/typings/src/types/Prompt.d.ts +54 -10
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
- package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
- package/esm/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +114 -15
- package/esm/typings/src/utils/FromtoItems.d.ts +3 -3
- package/esm/typings/src/utils/currentDate.d.ts +7 -0
- package/esm/typings/src/utils/deepClone.d.ts +9 -0
- package/esm/typings/src/utils/deepFreeze.d.ts +22 -0
- package/esm/typings/src/utils/emojis.d.ts +2 -2
- package/esm/typings/src/utils/extractParameters.d.ts +2 -2
- package/esm/typings/src/utils/formatNumber.d.ts +1 -1
- package/esm/typings/src/utils/isRunningInWhatever.d.ts +3 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +3 -3
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +7 -10
- package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -1
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +12 -0
- package/esm/typings/src/utils/organization/TODO_any.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_object.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_unknown.d.ts +6 -0
- package/esm/typings/src/utils/organization/___.d.ts +6 -0
- package/esm/typings/src/utils/{just.d.ts → organization/just.d.ts} +5 -1
- package/esm/typings/src/utils/organization/keepUnused.d.ts +16 -0
- package/esm/typings/src/utils/organization/really_any.d.ts +6 -0
- package/esm/typings/src/utils/organization/really_unknown.d.ts +6 -0
- package/esm/typings/src/utils/random/randomSeed.d.ts +7 -0
- package/{umd/typings/src/execution → esm/typings/src}/utils/replaceParameters.d.ts +2 -4
- package/esm/typings/src/utils/replaceParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/difference.d.ts +3 -0
- package/esm/typings/src/utils/validators/email/isValidEmail.d.ts +2 -1
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +2 -1
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -1
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -1
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -1
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +2 -1
- package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -1
- package/package.json +2 -2
- package/umd/index.umd.js +181 -18
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/promptbook-collection/index.d.ts +200 -30
- package/umd/typings/src/_packages/core.index.d.ts +7 -2
- package/umd/typings/src/_packages/execute-javascript.index.d.ts +1 -1
- package/umd/typings/src/_packages/node.index.d.ts +2 -1
- package/umd/typings/src/_packages/types.index.d.ts +11 -7
- package/umd/typings/src/_packages/utils.index.d.ts +8 -6
- package/umd/typings/src/cli/cli-commands/hello.d.ts +3 -0
- package/umd/typings/src/cli/cli-commands/make.d.ts +3 -0
- package/umd/typings/src/cli/cli-commands/prettify.d.ts +3 -0
- package/umd/typings/src/cli/promptbookCli.d.ts +1 -0
- package/umd/typings/src/collection/PipelineCollection.d.ts +1 -1
- package/umd/typings/src/collection/SimplePipelineCollection.d.ts +10 -10
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +8 -7
- package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
- package/umd/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +2 -3
- package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +2 -2
- package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
- package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
- package/umd/typings/src/commands/_common/types/CommandParser.d.ts +42 -14
- package/umd/typings/src/config.d.ts +38 -1
- package/umd/typings/src/config.test.d.ts +4 -0
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -3
- package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
- package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +3 -3
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.d.ts +13 -0
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.test.d.ts +1 -0
- package/umd/typings/src/conversion/validation/_importPipeline.d.ts +12 -3
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +10 -1
- package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
- package/umd/typings/src/errors/LimitReachedError.d.ts +7 -0
- package/umd/typings/src/errors/VersionMismatchError.d.ts +8 -0
- package/umd/typings/src/execution/CommonExecutionToolsOptions.d.ts +1 -0
- package/umd/typings/src/execution/LlmExecutionTools.d.ts +10 -8
- package/umd/typings/src/execution/PipelineExecutor.d.ts +9 -8
- package/umd/typings/src/execution/PromptResult.d.ts +28 -58
- package/umd/typings/src/execution/PromptResultUsage.d.ts +26 -0
- package/umd/typings/src/execution/ScriptExecutionTools.d.ts +5 -4
- package/umd/typings/src/execution/UncertainNumber.d.ts +18 -0
- package/umd/typings/src/execution/UserInterfaceTools.d.ts +5 -5
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +19 -3
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
- package/umd/typings/src/execution/utils/addUsage.d.ts +58 -2
- package/umd/typings/src/execution/utils/computeUsageCounts.d.ts +1 -1
- package/umd/typings/src/execution/utils/forEachAsync.d.ts +1 -1
- package/umd/typings/src/execution/utils/uncertainNumber.d.ts +1 -1
- package/umd/typings/src/execution/utils/usageToWorktime.d.ts +2 -2
- package/umd/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
- package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +2 -1
- package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +2 -1
- package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +2 -1
- package/umd/typings/src/formats/xml/XmlFormatDefinition.d.ts +1 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
- package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +27 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +9 -23
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +8 -14
- package/umd/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +30 -0
- package/umd/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +10 -0
- package/umd/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +11 -0
- package/umd/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
- package/umd/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
- package/umd/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +16 -0
- package/umd/typings/src/llm-providers/_common/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
- package/umd/typings/src/llm-providers/_common/utils/count-total-cost/countTotalCost.d.ts +14 -0
- package/umd/typings/src/llm-providers/_common/utils/count-total-cost/limitTotalCost.d.ts +32 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -2
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +3 -3
- package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -4
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
- package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +3 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -5
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +7 -7
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +12 -8
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +7 -6
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
- package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
- package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +9 -7
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/personas/preparePersona.d.ts +15 -0
- package/umd/typings/src/personas/preparePersona.test.d.ts +1 -0
- package/umd/typings/src/prepare/PrepareOptions.d.ts +22 -0
- package/umd/typings/src/prepare/isPipelinePrepared.d.ts +10 -0
- package/umd/typings/src/prepare/isPipelinePrepared.test.d.ts +1 -0
- package/umd/typings/src/prepare/preparePipeline.d.ts +18 -0
- package/umd/typings/src/prepare/unpreparePipeline.d.ts +9 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
- package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/umd/typings/src/scripting/javascript/utils/unknownToString.d.ts +2 -1
- package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +25 -0
- package/umd/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
- package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +30 -0
- package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +13 -0
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
- package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +9 -0
- package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +9 -0
- package/umd/typings/src/storage/memory/MemoryStorage.d.ts +34 -0
- package/umd/typings/src/storage/utils/PrefixStorage.d.ts +26 -0
- package/umd/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
- package/umd/typings/src/types/ModelRequirements.d.ts +71 -11
- package/umd/typings/src/types/ModelVariant.d.ts +14 -0
- package/umd/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
- package/umd/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
- package/umd/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
- package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +9 -1
- package/umd/typings/src/types/PipelineJson/PersonaJson.d.ts +38 -0
- package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +29 -4
- package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
- package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +5 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +5 -1
- package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +13 -4
- package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
- package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
- package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
- package/umd/typings/src/types/PipelineString.d.ts +1 -1
- package/umd/typings/src/types/Prompt.d.ts +54 -10
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
- package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
- package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
- package/umd/typings/src/types/typeAliases.d.ts +114 -15
- package/umd/typings/src/utils/FromtoItems.d.ts +3 -3
- package/umd/typings/src/utils/currentDate.d.ts +7 -0
- package/umd/typings/src/utils/deepClone.d.ts +9 -0
- package/umd/typings/src/utils/deepFreeze.d.ts +22 -0
- package/umd/typings/src/utils/emojis.d.ts +2 -2
- package/umd/typings/src/utils/extractParameters.d.ts +2 -2
- package/umd/typings/src/utils/formatNumber.d.ts +1 -1
- package/umd/typings/src/utils/isRunningInWhatever.d.ts +3 -0
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +3 -3
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +7 -10
- package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
- package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
- package/umd/typings/src/utils/normalization/parseKeywords.d.ts +2 -1
- package/umd/typings/src/utils/organization/TODO_USE.d.ts +12 -0
- package/umd/typings/src/utils/organization/TODO_any.d.ts +6 -0
- package/umd/typings/src/utils/organization/TODO_object.d.ts +6 -0
- package/umd/typings/src/utils/organization/TODO_unknown.d.ts +6 -0
- package/umd/typings/src/utils/organization/___.d.ts +6 -0
- package/umd/typings/src/utils/{just.d.ts → organization/just.d.ts} +5 -1
- package/umd/typings/src/utils/organization/keepUnused.d.ts +16 -0
- package/umd/typings/src/utils/organization/really_any.d.ts +6 -0
- package/umd/typings/src/utils/organization/really_unknown.d.ts +6 -0
- package/umd/typings/src/utils/random/randomSeed.d.ts +7 -0
- package/{esm/typings/src/execution → umd/typings/src}/utils/replaceParameters.d.ts +2 -4
- package/umd/typings/src/utils/replaceParameters.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/difference.d.ts +3 -0
- package/umd/typings/src/utils/validators/email/isValidEmail.d.ts +2 -1
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +2 -1
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -1
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -1
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -1
- package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +2 -1
- package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -1
- package/esm/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
- package/esm/typings/src/personas/personaToModelRequirements.d.ts +0 -6
- package/esm/typings/src/types/Parameters.d.ts +0 -14
- package/esm/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
- package/esm/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
- package/umd/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
- package/umd/typings/src/personas/personaToModelRequirements.d.ts +0 -6
- package/umd/typings/src/types/Parameters.d.ts +0 -14
- package/umd/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
- package/umd/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
- /package/esm/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
- /package/esm/typings/src/{execution/addPromptResultUsage.test.d.ts → conversion/utils/stringifyPipelineJson.test.d.ts} +0 -0
- /package/esm/typings/src/{execution/utils/replaceParameters.test.d.ts → knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts} +0 -0
- /package/{umd/typings/src/execution/addPromptResultUsage.test.d.ts → esm/typings/src/personas/preparePersona.test.d.ts} +0 -0
- /package/esm/typings/src/{utils/postprocessing → postprocessing/utils}/extractBlock.d.ts +0 -0
- /package/{umd/typings/src/execution/utils/replaceParameters.test.d.ts → esm/typings/src/prepare/isPipelinePrepared.test.d.ts} +0 -0
- /package/umd/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
- /package/umd/typings/src/{utils/postprocessing → postprocessing/utils}/extractBlock.d.ts +0 -0
|
@@ -9,30 +9,74 @@ declare const _default: ({
|
|
|
9
9
|
isOutput: boolean;
|
|
10
10
|
}[];
|
|
11
11
|
promptTemplates: {
|
|
12
|
+
blockType: string;
|
|
12
13
|
name: string;
|
|
13
14
|
title: string;
|
|
14
|
-
dependentParameterNames: string[];
|
|
15
|
-
blockType: string;
|
|
16
15
|
modelRequirements: {
|
|
17
16
|
modelVariant: string;
|
|
18
17
|
modelName: string;
|
|
19
18
|
};
|
|
20
19
|
content: string;
|
|
20
|
+
dependentParameterNames: string[];
|
|
21
21
|
resultingParameterName: string;
|
|
22
22
|
}[];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
knowledgeSources: never[];
|
|
24
|
+
knowledgePieces: never[];
|
|
25
|
+
personas: never[];
|
|
26
|
+
preparations: {
|
|
27
|
+
id: number;
|
|
28
|
+
promptbookVersion: string;
|
|
29
|
+
modelUsage: {
|
|
30
|
+
price: {
|
|
31
|
+
value: number;
|
|
32
|
+
};
|
|
33
|
+
input: {
|
|
34
|
+
tokensCount: {
|
|
35
|
+
value: number;
|
|
36
|
+
};
|
|
37
|
+
charactersCount: {
|
|
38
|
+
value: number;
|
|
39
|
+
};
|
|
40
|
+
wordsCount: {
|
|
41
|
+
value: number;
|
|
42
|
+
};
|
|
43
|
+
sentencesCount: {
|
|
44
|
+
value: number;
|
|
45
|
+
};
|
|
46
|
+
linesCount: {
|
|
47
|
+
value: number;
|
|
48
|
+
};
|
|
49
|
+
paragraphsCount: {
|
|
50
|
+
value: number;
|
|
51
|
+
};
|
|
52
|
+
pagesCount: {
|
|
53
|
+
value: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
output: {
|
|
57
|
+
tokensCount: {
|
|
58
|
+
value: number;
|
|
59
|
+
};
|
|
60
|
+
charactersCount: {
|
|
61
|
+
value: number;
|
|
62
|
+
};
|
|
63
|
+
wordsCount: {
|
|
64
|
+
value: number;
|
|
65
|
+
};
|
|
66
|
+
sentencesCount: {
|
|
67
|
+
value: number;
|
|
68
|
+
};
|
|
69
|
+
linesCount: {
|
|
70
|
+
value: number;
|
|
71
|
+
};
|
|
72
|
+
paragraphsCount: {
|
|
73
|
+
value: number;
|
|
74
|
+
};
|
|
75
|
+
pagesCount: {
|
|
76
|
+
value: number;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
36
80
|
}[];
|
|
37
81
|
sourceFile: string;
|
|
38
82
|
} | {
|
|
@@ -46,36 +90,162 @@ declare const _default: ({
|
|
|
46
90
|
isOutput: boolean;
|
|
47
91
|
}[];
|
|
48
92
|
promptTemplates: {
|
|
93
|
+
blockType: string;
|
|
49
94
|
name: string;
|
|
50
95
|
title: string;
|
|
51
|
-
|
|
52
|
-
|
|
96
|
+
modelRequirements: {
|
|
97
|
+
modelVariant: string;
|
|
98
|
+
modelName: string;
|
|
99
|
+
};
|
|
100
|
+
content: string;
|
|
53
101
|
expectations: {
|
|
54
102
|
words: {
|
|
55
103
|
min: number;
|
|
56
104
|
max: number;
|
|
57
105
|
};
|
|
58
106
|
};
|
|
107
|
+
dependentParameterNames: string[];
|
|
108
|
+
resultingParameterName: string;
|
|
109
|
+
}[];
|
|
110
|
+
knowledgeSources: never[];
|
|
111
|
+
knowledgePieces: never[];
|
|
112
|
+
personas: never[];
|
|
113
|
+
preparations: {
|
|
114
|
+
id: number;
|
|
115
|
+
promptbookVersion: string;
|
|
116
|
+
modelUsage: {
|
|
117
|
+
price: {
|
|
118
|
+
value: number;
|
|
119
|
+
};
|
|
120
|
+
input: {
|
|
121
|
+
tokensCount: {
|
|
122
|
+
value: number;
|
|
123
|
+
};
|
|
124
|
+
charactersCount: {
|
|
125
|
+
value: number;
|
|
126
|
+
};
|
|
127
|
+
wordsCount: {
|
|
128
|
+
value: number;
|
|
129
|
+
};
|
|
130
|
+
sentencesCount: {
|
|
131
|
+
value: number;
|
|
132
|
+
};
|
|
133
|
+
linesCount: {
|
|
134
|
+
value: number;
|
|
135
|
+
};
|
|
136
|
+
paragraphsCount: {
|
|
137
|
+
value: number;
|
|
138
|
+
};
|
|
139
|
+
pagesCount: {
|
|
140
|
+
value: number;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
output: {
|
|
144
|
+
tokensCount: {
|
|
145
|
+
value: number;
|
|
146
|
+
};
|
|
147
|
+
charactersCount: {
|
|
148
|
+
value: number;
|
|
149
|
+
};
|
|
150
|
+
wordsCount: {
|
|
151
|
+
value: number;
|
|
152
|
+
};
|
|
153
|
+
sentencesCount: {
|
|
154
|
+
value: number;
|
|
155
|
+
};
|
|
156
|
+
linesCount: {
|
|
157
|
+
value: number;
|
|
158
|
+
};
|
|
159
|
+
paragraphsCount: {
|
|
160
|
+
value: number;
|
|
161
|
+
};
|
|
162
|
+
pagesCount: {
|
|
163
|
+
value: number;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
}[];
|
|
168
|
+
sourceFile: string;
|
|
169
|
+
} | {
|
|
170
|
+
title: string;
|
|
171
|
+
pipelineUrl: string;
|
|
172
|
+
promptbookVersion: string;
|
|
173
|
+
parameters: {
|
|
174
|
+
name: string;
|
|
175
|
+
description: string;
|
|
176
|
+
isInput: boolean;
|
|
177
|
+
isOutput: boolean;
|
|
178
|
+
}[];
|
|
179
|
+
promptTemplates: {
|
|
180
|
+
blockType: string;
|
|
181
|
+
name: string;
|
|
182
|
+
title: string;
|
|
59
183
|
modelRequirements: {
|
|
60
184
|
modelVariant: string;
|
|
61
185
|
modelName: string;
|
|
62
186
|
};
|
|
63
187
|
content: string;
|
|
188
|
+
expectFormat: string;
|
|
189
|
+
dependentParameterNames: string[];
|
|
64
190
|
resultingParameterName: string;
|
|
65
191
|
}[];
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
192
|
+
knowledgeSources: never[];
|
|
193
|
+
knowledgePieces: never[];
|
|
194
|
+
personas: never[];
|
|
195
|
+
preparations: {
|
|
196
|
+
id: number;
|
|
197
|
+
promptbookVersion: string;
|
|
198
|
+
modelUsage: {
|
|
199
|
+
price: {
|
|
200
|
+
value: number;
|
|
201
|
+
};
|
|
202
|
+
input: {
|
|
203
|
+
tokensCount: {
|
|
204
|
+
value: number;
|
|
205
|
+
};
|
|
206
|
+
charactersCount: {
|
|
207
|
+
value: number;
|
|
208
|
+
};
|
|
209
|
+
wordsCount: {
|
|
210
|
+
value: number;
|
|
211
|
+
};
|
|
212
|
+
sentencesCount: {
|
|
213
|
+
value: number;
|
|
214
|
+
};
|
|
215
|
+
linesCount: {
|
|
216
|
+
value: number;
|
|
217
|
+
};
|
|
218
|
+
paragraphsCount: {
|
|
219
|
+
value: number;
|
|
220
|
+
};
|
|
221
|
+
pagesCount: {
|
|
222
|
+
value: number;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
output: {
|
|
226
|
+
tokensCount: {
|
|
227
|
+
value: number;
|
|
228
|
+
};
|
|
229
|
+
charactersCount: {
|
|
230
|
+
value: number;
|
|
231
|
+
};
|
|
232
|
+
wordsCount: {
|
|
233
|
+
value: number;
|
|
234
|
+
};
|
|
235
|
+
sentencesCount: {
|
|
236
|
+
value: number;
|
|
237
|
+
};
|
|
238
|
+
linesCount: {
|
|
239
|
+
value: number;
|
|
240
|
+
};
|
|
241
|
+
paragraphsCount: {
|
|
242
|
+
value: number;
|
|
243
|
+
};
|
|
244
|
+
pagesCount: {
|
|
245
|
+
value: number;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
};
|
|
79
249
|
}[];
|
|
80
250
|
sourceFile: string;
|
|
81
251
|
})[];
|
|
@@ -9,6 +9,7 @@ import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
|
|
|
9
9
|
import { pipelineStringToJson } from '../conversion/pipelineStringToJson';
|
|
10
10
|
import { pipelineStringToJsonSync } from '../conversion/pipelineStringToJsonSync';
|
|
11
11
|
import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
|
|
12
|
+
import { stringifyPipelineJson } from '../conversion/utils/stringifyPipelineJson';
|
|
12
13
|
import { validatePipeline } from '../conversion/validation/validatePipeline';
|
|
13
14
|
import { CollectionError } from '../errors/CollectionError';
|
|
14
15
|
import { NotFoundError } from '../errors/NotFoundError';
|
|
@@ -17,6 +18,7 @@ import { PipelineExecutionError } from '../errors/PipelineExecutionError';
|
|
|
17
18
|
import { PipelineLogicError } from '../errors/PipelineLogicError';
|
|
18
19
|
import { ReferenceError } from '../errors/ReferenceError';
|
|
19
20
|
import { UnexpectedError } from '../errors/UnexpectedError';
|
|
21
|
+
import { VersionMismatchError } from '../errors/VersionMismatchError';
|
|
20
22
|
import { ExpectError } from '../errors/_ExpectError';
|
|
21
23
|
import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
|
|
22
24
|
import { createPipelineExecutor } from '../execution/createPipelineExecutor';
|
|
@@ -29,6 +31,8 @@ import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callbac
|
|
|
29
31
|
import { SimplePromptInterfaceTools } from '../knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools';
|
|
30
32
|
import { prepareKnowledgeFromMarkdown } from '../knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown';
|
|
31
33
|
import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
|
|
34
|
+
import { preparePipeline } from '../prepare/preparePipeline';
|
|
35
|
+
import { unpreparePipeline } from '../prepare/unpreparePipeline';
|
|
32
36
|
import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
|
|
33
37
|
import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
34
38
|
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
@@ -38,7 +42,8 @@ export { BlockTypes, RESERVED_PARAMETER_NAMES };
|
|
|
38
42
|
export { addUsage, assertsExecutionSuccessful, checkExpectations, embeddingVectorToString, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, isPassingExpectations, prepareKnowledgeFromMarkdown, prettifyPipelineString, usageToWorktime, };
|
|
39
43
|
export { collectionToJson, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createSubcollection, };
|
|
40
44
|
export { SimplePromptInterfaceTools };
|
|
41
|
-
export { pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, validatePipeline };
|
|
45
|
+
export { pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, stringifyPipelineJson, validatePipeline, };
|
|
46
|
+
export { preparePipeline, unpreparePipeline };
|
|
42
47
|
export { createPipelineExecutor, joinLlmExecutionTools };
|
|
43
48
|
export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
|
|
44
|
-
export { CollectionError, ExpectError, NotFoundError, ParsingError, PipelineExecutionError, PipelineLogicError, ReferenceError, UnexpectedError, };
|
|
49
|
+
export { CollectionError, ExpectError, NotFoundError, ParsingError, PipelineExecutionError, PipelineLogicError, ReferenceError, UnexpectedError, VersionMismatchError, };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import spaceTrim from 'spacetrim';
|
|
2
|
+
import { extractBlock } from '../postprocessing/utils/extractBlock';
|
|
2
3
|
import { JavascriptEvalExecutionTools } from '../scripting/javascript/JavascriptEvalExecutionTools';
|
|
3
4
|
import { JavascriptExecutionTools } from '../scripting/javascript/JavascriptExecutionTools';
|
|
4
5
|
import { prettifyMarkdown } from '../utils/markdown/prettifyMarkdown';
|
|
@@ -13,7 +14,6 @@ import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelC
|
|
|
13
14
|
import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
|
|
14
15
|
import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
|
|
15
16
|
import { removeDiacritics } from '../utils/normalization/removeDiacritics';
|
|
16
|
-
import { extractBlock } from '../utils/postprocessing/extractBlock';
|
|
17
17
|
import { removeEmojis } from '../utils/removeEmojis';
|
|
18
18
|
import { removeQuotes } from '../utils/removeQuotes';
|
|
19
19
|
import { trimCodeBlock } from '../utils/trimCodeBlock';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createCollectionFromDirectory } from '../collection/constructors/createCollectionFromDirectory';
|
|
2
|
+
import { createLlmToolsFromEnv } from '../llm-providers/_common/createLlmToolsFromEnv';
|
|
2
3
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
3
4
|
export { PROMPTBOOK_VERSION };
|
|
4
|
-
export { createCollectionFromDirectory };
|
|
5
|
+
export { createCollectionFromDirectory, createLlmToolsFromEnv };
|
|
@@ -5,17 +5,21 @@ import { EmbeddingVector } from '../execution/EmbeddingVector';
|
|
|
5
5
|
import type { ExecutionTools } from '../execution/ExecutionTools';
|
|
6
6
|
import type { AvailableModel, LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
7
7
|
import type { PipelineExecutor } from '../execution/PipelineExecutor';
|
|
8
|
-
import type {
|
|
8
|
+
import type { ChatPromptResult, CommonPromptResult, CompletionPromptResult, EmbeddingPromptResult, PromptResult } from '../execution/PromptResult';
|
|
9
|
+
import type { PromptResultUsage, PromptResultUsageCounts } from '../execution/PromptResultUsage';
|
|
9
10
|
import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
|
|
11
|
+
import type { UncertainNumber } from '../execution/UncertainNumber';
|
|
10
12
|
import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
|
|
11
|
-
import type { ModelRequirements
|
|
12
|
-
import type {
|
|
13
|
+
import type { ModelRequirements } from '../types/ModelRequirements';
|
|
14
|
+
import type { ModelVariant } from '../types/ModelVariant';
|
|
13
15
|
import type { ExpectationAmount, ExpectationUnit, Expectations } from '../types/PipelineJson/Expectations';
|
|
14
16
|
import { EXPECTATION_UNITS } from '../types/PipelineJson/Expectations';
|
|
15
|
-
import {
|
|
17
|
+
import { KnowledgePiecePreparedJson } from '../types/PipelineJson/KnowledgePieceJson';
|
|
18
|
+
import { KnowledgeSourceJson, KnowledgeSourcePreparedJson } from '../types/PipelineJson/KnowledgeSourceJson';
|
|
16
19
|
import type { LlmTemplateJson } from '../types/PipelineJson/LlmTemplateJson';
|
|
17
|
-
import {
|
|
20
|
+
import { PersonaJson, PersonaPreparedJson } from '../types/PipelineJson/PersonaJson';
|
|
18
21
|
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
22
|
+
import { PreparationJson } from '../types/PipelineJson/PreparationJson';
|
|
19
23
|
import type { PromptDialogJson } from '../types/PipelineJson/PromptDialogJson';
|
|
20
24
|
import type { PromptTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
|
|
21
25
|
import type { PromptTemplateParameterJson } from '../types/PipelineJson/PromptTemplateParameterJson';
|
|
@@ -27,12 +31,12 @@ import type { ScriptLanguage } from '../types/ScriptLanguage';
|
|
|
27
31
|
import type { TaskProgress } from '../types/TaskProgress';
|
|
28
32
|
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
29
33
|
import type { string_char_emoji } from '../types/typeAliasEmoji';
|
|
30
|
-
import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_script, string_semantic_version, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid } from '../types/typeAliases';
|
|
34
|
+
import type { Parameters, ReservedParameters, client_id, number_model_temperature, number_seed, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_parameter_name, string_parameter_value, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_documentation_url, string_reserved_parameter_name, string_script, string_semantic_version, string_sha256, string_system_message, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid } from '../types/typeAliases';
|
|
31
35
|
import type { FromtoItems } from '../utils/FromtoItems';
|
|
32
36
|
import { PROMPTBOOK_VERSION, string_promptbook_version } from '../version';
|
|
33
37
|
export { PROMPTBOOK_VERSION };
|
|
34
38
|
export { EXPECTATION_UNITS };
|
|
35
|
-
export type { AvailableModel, BlockType, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems,
|
|
39
|
+
export type { AvailableModel, BlockType, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems, KnowledgePiecePreparedJson, KnowledgeSourceJson, KnowledgeSourcePreparedJson, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, PersonaJson, PersonaPreparedJson, PipelineCollection, PipelineExecutor, PipelineJson, PipelineString, PreparationJson, Prompt, ChatPromptResult as PromptChatResult, CommonPromptResult as PromptCommonResult, CompletionPromptResult as PromptCompletionResult, PromptDialogJson, EmbeddingPromptResult as PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ReservedParameters, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, number_model_temperature, number_seed, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_parameter_name, string_parameter_value, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_documentation_url, string_promptbook_version, string_reserved_parameter_name, string_script, string_semantic_version, string_sha256, string_system_message, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid, };
|
|
36
40
|
/**
|
|
37
41
|
* TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
|
|
38
42
|
*/
|
|
@@ -5,8 +5,9 @@ import { extractVariables } from '../conversion/utils/extractVariables';
|
|
|
5
5
|
import { renameParameter } from '../conversion/utils/renameParameter';
|
|
6
6
|
import { titleToName } from '../conversion/utils/titleToName';
|
|
7
7
|
import { forEachAsync } from '../execution/utils/forEachAsync';
|
|
8
|
-
import { replaceParameters } from '../execution/utils/replaceParameters';
|
|
9
8
|
import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
|
|
9
|
+
import { extractBlock } from '../postprocessing/utils/extractBlock';
|
|
10
|
+
import { $currentDate } from '../utils/currentDate';
|
|
10
11
|
import { countCharacters } from '../utils/expectation-counters/countCharacters';
|
|
11
12
|
import { countLines } from '../utils/expectation-counters/countLines';
|
|
12
13
|
import { countPages } from '../utils/expectation-counters/countPages';
|
|
@@ -33,9 +34,10 @@ import { parseKeywordsFromString } from '../utils/normalization/parseKeywordsFro
|
|
|
33
34
|
import { removeDiacritics } from '../utils/normalization/removeDiacritics';
|
|
34
35
|
import { searchKeywords } from '../utils/normalization/searchKeywords';
|
|
35
36
|
import { parseNumber } from '../utils/parseNumber';
|
|
36
|
-
import {
|
|
37
|
+
import { $randomSeed } from '../utils/random/randomSeed';
|
|
37
38
|
import { removeEmojis } from '../utils/removeEmojis';
|
|
38
39
|
import { removeQuotes } from '../utils/removeQuotes';
|
|
40
|
+
import { replaceParameters } from '../utils/replaceParameters';
|
|
39
41
|
import { difference } from '../utils/sets/difference';
|
|
40
42
|
import { intersection } from '../utils/sets/intersection';
|
|
41
43
|
import { union } from '../utils/sets/union';
|
|
@@ -53,9 +55,10 @@ import { isValidUrl } from '../utils/validators/url/isValidUrl';
|
|
|
53
55
|
import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
|
|
54
56
|
import { PROMPTBOOK_VERSION } from '../version';
|
|
55
57
|
export { forEachAsync, PROMPTBOOK_VERSION };
|
|
56
|
-
export {
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
export { extractParameters, extractVariables, replaceParameters, spaceTrim };
|
|
59
|
+
export { $currentDate, $randomSeed, extractBlock, // <- [🌻] + maybe export through `@promptbook/markdown-utils`
|
|
60
|
+
isHostnameOnPrivateNetwork, isUrlOnPrivateNetwork, isValidFilePath, isValidJavascriptName, isValidJsonString, isValidPipelineUrl, isValidPromptbookVersion, isValidSemanticVersion, isValidUrl, isValidUuid, parseNumber, // <- [🌻]
|
|
61
|
+
removeEmojis, removeQuotes, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
|
|
59
62
|
export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
|
|
60
63
|
export { splitIntoSentences };
|
|
61
64
|
export declare const normalizeTo: {
|
|
@@ -70,6 +73,5 @@ export type { string_camelCase, string_kebab_case, string_PascalCase, string_SCR
|
|
|
70
73
|
export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
|
|
71
74
|
export { difference, intersection, union };
|
|
72
75
|
/**
|
|
73
|
-
* TODO: [🧠] Maybe create some indipendent package like `@promptbook/markdown-utils`
|
|
74
76
|
* Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
|
|
75
77
|
*/
|
|
@@ -6,4 +6,5 @@ export declare function promptbookCli(): Promise<void>;
|
|
|
6
6
|
* TODO: [🥠] Do not export to utils directly, its just for CLI script
|
|
7
7
|
* TODO: [🕌] When more functionalities, rename
|
|
8
8
|
* Note: 11:11
|
|
9
|
+
* Note: [🟡] This code should never be published outside of `@promptbook/cli`
|
|
9
10
|
*/
|
|
@@ -5,7 +5,7 @@ import type { string_pipeline_url } from '../types/typeAliases';
|
|
|
5
5
|
/**
|
|
6
6
|
* Collection that groups together pipelines, knowledge, personas, tools and actions
|
|
7
7
|
*
|
|
8
|
-
* @see
|
|
8
|
+
* @see @@@ https://github.com/webgptorg/pipeline#pipeline-collection
|
|
9
9
|
*/
|
|
10
10
|
export type PipelineCollection = {
|
|
11
11
|
/**
|
|
@@ -3,36 +3,36 @@ import type { Prompt } from '../types/Prompt';
|
|
|
3
3
|
import type { string_pipeline_url } from '../types/typeAliases';
|
|
4
4
|
import type { PipelineCollection } from './PipelineCollection';
|
|
5
5
|
/**
|
|
6
|
-
* Library of
|
|
7
|
-
* This implementation is a very thin wrapper around the Array / Map of
|
|
6
|
+
* Library of pipelines that groups together pipelines for an application.
|
|
7
|
+
* This implementation is a very thin wrapper around the Array / Map of pipelines.
|
|
8
8
|
*
|
|
9
9
|
* @private use `createCollectionFromJson` instead
|
|
10
|
-
* @see https://github.com/webgptorg/
|
|
10
|
+
* @see https://github.com/webgptorg/pipeline#pipeline-collection
|
|
11
11
|
*/
|
|
12
12
|
export declare class SimplePipelineCollection implements PipelineCollection {
|
|
13
13
|
private collection;
|
|
14
14
|
/**
|
|
15
|
-
* Constructs a pipeline collection from
|
|
15
|
+
* Constructs a pipeline collection from pipelines
|
|
16
16
|
*
|
|
17
|
-
* @param
|
|
17
|
+
* @param pipelines @@@
|
|
18
18
|
*
|
|
19
19
|
* @private Use instead `createCollectionFromJson`
|
|
20
|
-
* Note: During the construction logic of all
|
|
20
|
+
* Note: During the construction logic of all pipelines are validated
|
|
21
21
|
* Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
|
|
22
22
|
*/
|
|
23
|
-
constructor(...
|
|
23
|
+
constructor(...pipelines: Array<PipelineJson>);
|
|
24
24
|
/**
|
|
25
|
-
* Gets all
|
|
25
|
+
* Gets all pipelines in the collection
|
|
26
26
|
*/
|
|
27
27
|
listPipelines(): Array<string_pipeline_url>;
|
|
28
28
|
/**
|
|
29
|
-
* Gets
|
|
29
|
+
* Gets pipeline by its URL
|
|
30
30
|
*
|
|
31
31
|
* Note: This is not a direct fetching from the URL, but a lookup in the collection
|
|
32
32
|
*/
|
|
33
33
|
getPipelineByUrl(url: string_pipeline_url): PipelineJson;
|
|
34
34
|
/**
|
|
35
|
-
* Checks whether given prompt was defined in any
|
|
35
|
+
* Checks whether given prompt was defined in any pipeline in the collection
|
|
36
36
|
*/
|
|
37
37
|
isResponsibleForPrompt(prompt: Prompt): boolean;
|
|
38
38
|
}
|
|
@@ -6,7 +6,7 @@ import type { PipelineCollection } from '../PipelineCollection';
|
|
|
6
6
|
*/
|
|
7
7
|
type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions & {
|
|
8
8
|
/**
|
|
9
|
-
* If true, the directory is searched recursively for
|
|
9
|
+
* If true, the directory is searched recursively for pipelines
|
|
10
10
|
*
|
|
11
11
|
* @default true
|
|
12
12
|
*/
|
|
@@ -24,24 +24,25 @@ type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions
|
|
|
24
24
|
*/
|
|
25
25
|
isLazyLoaded?: boolean;
|
|
26
26
|
/**
|
|
27
|
-
* If true, whole collection creation crashes on error in any
|
|
28
|
-
* If true and isLazyLoaded is true, the error is thrown on first access to the
|
|
27
|
+
* If true, whole collection creation crashes on error in any pipeline
|
|
28
|
+
* If true and isLazyLoaded is true, the error is thrown on first access to the pipeline
|
|
29
29
|
*
|
|
30
30
|
* @default true
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
isCrashedOnError?: boolean;
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* Constructs
|
|
35
|
+
* Constructs Pipeline from given directory
|
|
36
36
|
*
|
|
37
37
|
* Note: Works only in Node.js environment because it reads the file system
|
|
38
38
|
*
|
|
39
|
-
* @param path - path to the directory with
|
|
39
|
+
* @param path - path to the directory with pipelines
|
|
40
40
|
* @param options - Misc options for the collection
|
|
41
41
|
* @returns PipelineCollection
|
|
42
42
|
*/
|
|
43
43
|
export declare function createCollectionFromDirectory(path: string_folder_path, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
|
|
44
44
|
export {};
|
|
45
45
|
/**
|
|
46
|
-
* TODO: !!!! [🧠] Library precompilation and do not mix markdown and json
|
|
46
|
+
* TODO: !!!! [🧠] Library precompilation and do not mix markdown and json pipelines
|
|
47
|
+
* Note: [🟢] This code should never be published outside of `@pipeline/node`
|
|
47
48
|
*/
|
|
@@ -9,13 +9,13 @@ type CreatePipelineCollectionFromUrlyOptions = {
|
|
|
9
9
|
*
|
|
10
10
|
* @default false
|
|
11
11
|
*/
|
|
12
|
-
isVerbose?: boolean;
|
|
12
|
+
readonly isVerbose?: boolean;
|
|
13
13
|
/**
|
|
14
14
|
* If true, directory will be scanned only when needed not during the construction
|
|
15
15
|
*
|
|
16
16
|
* @default false
|
|
17
17
|
*/
|
|
18
|
-
isLazyLoaded?: boolean;
|
|
18
|
+
readonly isLazyLoaded?: boolean;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Constructs Promptbook from remote Promptbase URL
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { string_url } from '../../types/typeAliases';
|
|
1
|
+
import type { string_knowledge_source } from '../../types/typeAliases';
|
|
3
2
|
/**
|
|
4
3
|
* Parsed KNOWLEDGE command
|
|
5
4
|
*
|
|
@@ -8,5 +7,5 @@ import type { string_url } from '../../types/typeAliases';
|
|
|
8
7
|
*/
|
|
9
8
|
export type KnowledgeCommand = {
|
|
10
9
|
readonly type: 'KNOWLEDGE';
|
|
11
|
-
readonly source:
|
|
10
|
+
readonly source: string_knowledge_source;
|
|
12
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelRequirements } from '../../types/ModelRequirements';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TODO_any } from '../../utils/organization/TODO_any';
|
|
3
3
|
/**
|
|
4
4
|
* Parsed MODEL command
|
|
5
5
|
*
|
|
@@ -9,5 +9,5 @@ import type { TODO } from '../../types/typeAliases';
|
|
|
9
9
|
export type ModelCommand = {
|
|
10
10
|
readonly type: 'MODEL';
|
|
11
11
|
readonly key: keyof ModelRequirements;
|
|
12
|
-
readonly value:
|
|
12
|
+
readonly value: TODO_any;
|
|
13
13
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { string_name } from '../../types/typeAliases';
|
|
2
|
+
import type { string_persona_description } from '../../types/typeAliases';
|
|
1
3
|
/**
|
|
2
4
|
* Parsed PERSONA command
|
|
3
5
|
*
|
|
@@ -6,6 +8,6 @@
|
|
|
6
8
|
*/
|
|
7
9
|
export type PersonaCommand = {
|
|
8
10
|
readonly type: 'PERSONA';
|
|
9
|
-
personaName:
|
|
10
|
-
personaDescription:
|
|
11
|
+
readonly personaName: string_name;
|
|
12
|
+
readonly personaDescription: string_persona_description | null;
|
|
11
13
|
};
|
|
@@ -9,4 +9,5 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
|
|
|
9
9
|
export declare const boilerplateCommandParser: CommandParser<BoilerplateCommand>;
|
|
10
10
|
/**
|
|
11
11
|
* TODO: [💐] Implement BOILERPLATE command into `pipelineStringToJsonSync` function
|
|
12
|
+
* Note: [⚪] This should never be in any released package
|
|
12
13
|
*/
|