@promptbook/openai 0.62.1 → 0.63.0-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/esm/index.es.js +50 -8
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +3 -2
- package/esm/typings/src/_packages/azure-openai.index.d.ts +4 -2
- package/esm/typings/src/_packages/browser.index.d.ts +6 -0
- package/esm/typings/src/_packages/cli.index.d.ts +1 -7
- package/esm/typings/src/_packages/core.index.d.ts +87 -13
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +5 -45
- package/esm/typings/src/_packages/fake-llm.index.d.ts +4 -5
- package/esm/typings/src/_packages/langtail.index.d.ts +4 -2
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +23 -4
- package/esm/typings/src/_packages/node.index.d.ts +5 -2
- package/esm/typings/src/_packages/openai.index.d.ts +5 -2
- package/esm/typings/src/_packages/remote-client.index.d.ts +5 -2
- package/esm/typings/src/_packages/remote-server.index.d.ts +4 -2
- package/esm/typings/src/_packages/types.index.d.ts +441 -21
- package/esm/typings/src/_packages/utils.index.d.ts +84 -31
- package/esm/typings/src/cli/main.d.ts +12 -0
- package/esm/typings/src/collection/collectionToJson.d.ts +2 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createSubcollection.d.ts +1 -0
- package/esm/typings/src/commands/BLOCK/BlockTypes.d.ts +2 -0
- package/esm/typings/src/config.d.ts +27 -1
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +6 -3
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -3
- package/esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts +2 -0
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +2 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.d.ts +1 -0
- package/esm/typings/src/conversion/utils/extractVariables.d.ts +1 -0
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +1 -0
- package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +2 -0
- package/esm/typings/src/conversion/utils/titleToName.d.ts +6 -1
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +1 -0
- package/esm/typings/src/errors/CollectionError.d.ts +2 -0
- package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +2 -0
- package/esm/typings/src/errors/LimitReachedError.d.ts +2 -0
- package/esm/typings/src/errors/NotFoundError.d.ts +2 -0
- package/esm/typings/src/errors/NotYetImplementedError.d.ts +2 -0
- package/esm/typings/src/errors/ParsingError.d.ts +2 -0
- package/esm/typings/src/errors/PipelineExecutionError.d.ts +2 -0
- package/esm/typings/src/errors/PipelineLogicError.d.ts +2 -0
- package/esm/typings/src/errors/ReferenceError.d.ts +2 -0
- package/esm/typings/src/errors/UnexpectedError.d.ts +2 -0
- package/esm/typings/src/errors/VersionMismatchError.d.ts +2 -0
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -0
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +1 -0
- package/esm/typings/src/execution/embeddingVectorToString.d.ts +2 -0
- package/esm/typings/src/execution/utils/addUsage.d.ts +3 -1
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +2 -0
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -0
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +2 -0
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +2 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +2 -1
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +2 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +2 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +2 -0
- package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -1
- package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +10 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +2 -0
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +4 -1
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +2 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +2 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +2 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +2 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +7 -1
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
- package/esm/typings/src/personas/preparePersona.d.ts +1 -1
- package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +5 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +2 -1
- package/esm/typings/src/prepare/preparePipeline.d.ts +1 -1
- package/esm/typings/src/prepare/prepareTemplates.d.ts +2 -1
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +2 -1
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +2 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +51 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +0 -1
- package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +2 -1
- package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -3
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +2 -1
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +2 -3
- package/esm/typings/src/storage/utils/PrefixStorage.d.ts +2 -3
- package/esm/typings/src/types/ModelRequirements.d.ts +0 -1
- package/esm/typings/src/types/Prompt.d.ts +0 -1
- package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +4 -0
- package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -0
- package/esm/typings/src/types/typeAliases.d.ts +9 -2
- package/esm/typings/src/utils/currentDate.d.ts +1 -0
- package/esm/typings/src/utils/deepClone.d.ts +2 -1
- package/esm/typings/src/utils/deepFreeze.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +4 -0
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +2 -0
- package/esm/typings/src/utils/extractParameterNames.d.ts +1 -0
- package/esm/typings/src/utils/isRunningInWhatever.d.ts +6 -3
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +4 -1
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
- package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +4 -1
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +5 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +2 -1
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +3 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +4 -0
- package/esm/typings/src/utils/markdown/removeContentComments.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +3 -0
- package/esm/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +2 -0
- package/esm/typings/src/utils/normalization/IKeywords.d.ts +3 -0
- package/esm/typings/src/utils/normalization/capitalize.d.ts +1 -0
- package/esm/typings/src/utils/normalization/decapitalize.d.ts +1 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.d.ts +2 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +8 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +8 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +10 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +9 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +10 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +11 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +9 -0
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +1 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +7 -0
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +5 -0
- package/esm/typings/src/utils/parseNumber.d.ts +2 -1
- package/esm/typings/src/utils/random/randomSeed.d.ts +1 -0
- package/esm/typings/src/utils/removeEmojis.d.ts +1 -0
- package/esm/typings/src/utils/removeQuotes.d.ts +1 -0
- package/esm/typings/src/utils/replaceParameters.d.ts +1 -0
- package/esm/typings/src/utils/sets/difference.d.ts +1 -0
- package/esm/typings/src/utils/sets/intersection.d.ts +1 -0
- package/esm/typings/src/utils/sets/union.d.ts +1 -0
- package/esm/typings/src/utils/trimCodeBlock.d.ts +1 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +2 -0
- package/esm/typings/src/utils/unwrapResult.d.ts +1 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +1 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +7 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +2 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +2 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -0
- package/esm/typings/src/version.d.ts +2 -0
- package/package.json +2 -2
- package/umd/index.umd.js +50 -8
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/src/_packages/anthropic-claude.index.d.ts +3 -2
- package/umd/typings/src/_packages/azure-openai.index.d.ts +4 -2
- package/umd/typings/src/_packages/browser.index.d.ts +6 -0
- package/umd/typings/src/_packages/cli.index.d.ts +1 -7
- package/umd/typings/src/_packages/core.index.d.ts +87 -13
- package/umd/typings/src/_packages/execute-javascript.index.d.ts +5 -45
- package/umd/typings/src/_packages/fake-llm.index.d.ts +4 -5
- package/umd/typings/src/_packages/langtail.index.d.ts +4 -2
- package/umd/typings/src/_packages/markdown-utils.index.d.ts +23 -4
- package/umd/typings/src/_packages/node.index.d.ts +5 -2
- package/umd/typings/src/_packages/openai.index.d.ts +5 -2
- package/umd/typings/src/_packages/remote-client.index.d.ts +5 -2
- package/umd/typings/src/_packages/remote-server.index.d.ts +4 -2
- package/umd/typings/src/_packages/types.index.d.ts +441 -21
- package/umd/typings/src/_packages/utils.index.d.ts +84 -31
- package/umd/typings/src/cli/main.d.ts +12 -0
- package/umd/typings/src/collection/collectionToJson.d.ts +2 -0
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/umd/typings/src/collection/constructors/createSubcollection.d.ts +1 -0
- package/umd/typings/src/commands/BLOCK/BlockTypes.d.ts +2 -0
- package/umd/typings/src/config.d.ts +27 -1
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +1 -0
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +6 -3
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -3
- package/umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts +2 -0
- package/umd/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +2 -0
- package/umd/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.d.ts +1 -0
- package/umd/typings/src/conversion/utils/extractVariables.d.ts +1 -0
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +1 -0
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.d.ts +2 -0
- package/umd/typings/src/conversion/utils/titleToName.d.ts +6 -1
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +1 -0
- package/umd/typings/src/errors/CollectionError.d.ts +2 -0
- package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +2 -0
- package/umd/typings/src/errors/LimitReachedError.d.ts +2 -0
- package/umd/typings/src/errors/NotFoundError.d.ts +2 -0
- package/umd/typings/src/errors/NotYetImplementedError.d.ts +2 -0
- package/umd/typings/src/errors/ParsingError.d.ts +2 -0
- package/umd/typings/src/errors/PipelineExecutionError.d.ts +2 -0
- package/umd/typings/src/errors/PipelineLogicError.d.ts +2 -0
- package/umd/typings/src/errors/ReferenceError.d.ts +2 -0
- package/umd/typings/src/errors/UnexpectedError.d.ts +2 -0
- package/umd/typings/src/errors/VersionMismatchError.d.ts +2 -0
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -0
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +1 -0
- package/umd/typings/src/execution/embeddingVectorToString.d.ts +2 -0
- package/umd/typings/src/execution/utils/addUsage.d.ts +3 -1
- package/umd/typings/src/execution/utils/checkExpectations.d.ts +2 -0
- package/umd/typings/src/execution/utils/forEachAsync.d.ts +1 -0
- package/umd/typings/src/execution/utils/usageToHuman.d.ts +2 -0
- package/umd/typings/src/execution/utils/usageToWorktime.d.ts +2 -0
- package/umd/typings/src/formats/_common/FormatDefinition.d.ts +2 -1
- package/umd/typings/src/formats/json/utils/isValidJsonString.d.ts +2 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +2 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +2 -0
- package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -1
- package/umd/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +10 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +1 -1
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +2 -0
- package/umd/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +4 -1
- package/umd/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -1
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +1 -1
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +2 -1
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +2 -1
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +2 -0
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +2 -0
- package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +7 -1
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
- package/umd/typings/src/personas/preparePersona.d.ts +1 -1
- package/umd/typings/src/postprocessing/utils/extractBlock.d.ts +5 -0
- package/umd/typings/src/prepare/isPipelinePrepared.d.ts +2 -1
- package/umd/typings/src/prepare/preparePipeline.d.ts +1 -1
- package/umd/typings/src/prepare/prepareTemplates.d.ts +2 -1
- package/umd/typings/src/prepare/unpreparePipeline.d.ts +2 -1
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +2 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
- package/umd/typings/src/scripting/javascript/postprocessing-functions.d.ts +51 -0
- package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +0 -1
- package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +2 -1
- package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -3
- package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +2 -1
- package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +2 -1
- package/umd/typings/src/storage/memory/MemoryStorage.d.ts +2 -3
- package/umd/typings/src/storage/utils/PrefixStorage.d.ts +2 -3
- package/umd/typings/src/types/ModelRequirements.d.ts +0 -1
- package/umd/typings/src/types/Prompt.d.ts +0 -1
- package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +4 -0
- package/umd/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -0
- package/umd/typings/src/types/typeAliases.d.ts +9 -2
- package/umd/typings/src/utils/currentDate.d.ts +1 -0
- package/umd/typings/src/utils/deepClone.d.ts +2 -1
- package/umd/typings/src/utils/deepFreeze.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countLines.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countPages.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +4 -0
- package/umd/typings/src/utils/expectation-counters/countWords.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/index.d.ts +2 -0
- package/umd/typings/src/utils/extractParameterNames.d.ts +1 -0
- package/umd/typings/src/utils/isRunningInWhatever.d.ts +6 -3
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +4 -1
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
- package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +4 -1
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +5 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +2 -1
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -0
- package/umd/typings/src/utils/markdown/flattenMarkdown.d.ts +3 -0
- package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +4 -0
- package/umd/typings/src/utils/markdown/removeContentComments.d.ts +1 -0
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +3 -0
- package/umd/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +2 -0
- package/umd/typings/src/utils/normalization/IKeywords.d.ts +3 -0
- package/umd/typings/src/utils/normalization/capitalize.d.ts +1 -0
- package/umd/typings/src/utils/normalization/decapitalize.d.ts +1 -0
- package/umd/typings/src/utils/normalization/isValidKeyword.d.ts +2 -0
- package/umd/typings/src/utils/normalization/nameToUriPart.d.ts +8 -0
- package/umd/typings/src/utils/normalization/nameToUriParts.d.ts +8 -0
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +10 -0
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +9 -0
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +10 -0
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +11 -0
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +9 -0
- package/umd/typings/src/utils/normalization/parseKeywords.d.ts +1 -0
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
- package/umd/typings/src/utils/normalization/removeDiacritics.d.ts +7 -0
- package/umd/typings/src/utils/normalization/searchKeywords.d.ts +5 -0
- package/umd/typings/src/utils/parseNumber.d.ts +2 -1
- package/umd/typings/src/utils/random/randomSeed.d.ts +1 -0
- package/umd/typings/src/utils/removeEmojis.d.ts +1 -0
- package/umd/typings/src/utils/removeQuotes.d.ts +1 -0
- package/umd/typings/src/utils/replaceParameters.d.ts +1 -0
- package/umd/typings/src/utils/sets/difference.d.ts +1 -0
- package/umd/typings/src/utils/sets/intersection.d.ts +1 -0
- package/umd/typings/src/utils/sets/union.d.ts +1 -0
- package/umd/typings/src/utils/trimCodeBlock.d.ts +1 -0
- package/umd/typings/src/utils/trimEndOfCodeBlock.d.ts +2 -0
- package/umd/typings/src/utils/unwrapResult.d.ts +1 -0
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +1 -0
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +7 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -0
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +2 -0
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -0
- package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +2 -0
- package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -0
- package/umd/typings/src/version.d.ts +2 -0
|
@@ -4,6 +4,8 @@ import type { PipelineCollection } from './PipelineCollection';
|
|
|
4
4
|
* Converts PipelineCollection to serialized JSON
|
|
5
5
|
*
|
|
6
6
|
* Note: Functions `collectionToJson` and `createCollectionFromJson` are complementary
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
7
9
|
*/
|
|
8
10
|
export declare function collectionToJson(collection: PipelineCollection): Promise<Array<PipelineJson>>;
|
|
9
11
|
/**
|
|
@@ -39,6 +39,7 @@ type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions
|
|
|
39
39
|
* @param path - path to the directory with pipelines
|
|
40
40
|
* @param options - Misc options for the collection
|
|
41
41
|
* @returns PipelineCollection
|
|
42
|
+
* @public exported from `@promptbook/node`
|
|
42
43
|
*/
|
|
43
44
|
export declare function createCollectionFromDirectory(path: string_folder_path, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
|
|
44
45
|
export {};
|
|
@@ -8,5 +8,6 @@ import type { PipelineCollection } from '../PipelineCollection';
|
|
|
8
8
|
*
|
|
9
9
|
* @param promptbookSources
|
|
10
10
|
* @returns PipelineCollection
|
|
11
|
+
* @public exported from `@promptbook/core`
|
|
11
12
|
*/
|
|
12
13
|
export declare function createCollectionFromJson(...promptbooks: Array<PipelineJson>): PipelineCollection;
|
|
@@ -18,5 +18,6 @@ import type { PipelineCollection } from '../PipelineCollection';
|
|
|
18
18
|
* @param promptbookSourcesPromiseOrFactory
|
|
19
19
|
* @returns PipelineCollection
|
|
20
20
|
* @deprecated Do not use, it will became internal tool for other constructor functions
|
|
21
|
+
* @public exported from `@promptbook/core`
|
|
21
22
|
*/
|
|
22
23
|
export declare function createCollectionFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PipelineJson>> | (() => Promise<Array<PipelineJson>>)): PipelineCollection;
|
|
@@ -19,8 +19,8 @@ type CreatePipelineCollectionFromUrlyOptions = {
|
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Constructs Promptbook from remote Promptbase URL
|
|
22
|
-
|
|
23
22
|
* @returns PipelineCollection
|
|
23
|
+
* @public exported from `@promptbook/core`
|
|
24
24
|
*/
|
|
25
25
|
export declare function createCollectionFromUrl(url: string_url | URL, options: CreatePipelineCollectionFromUrlyOptions): Promise<PipelineCollection>;
|
|
26
26
|
export {};
|
|
@@ -8,5 +8,6 @@ import type { PipelineCollection } from '../PipelineCollection';
|
|
|
8
8
|
*
|
|
9
9
|
* @param promptbookSources
|
|
10
10
|
* @returns PipelineCollection
|
|
11
|
+
* @public exported from `@promptbook/core`
|
|
11
12
|
*/
|
|
12
13
|
export declare function createSubcollection(collection: PipelineCollection, predicate: (url: string_pipeline_url) => boolean): PipelineCollection;
|
|
@@ -3,11 +3,13 @@ import type { TupleToUnion } from 'type-fest';
|
|
|
3
3
|
* Block type describes the way how the block is blockd
|
|
4
4
|
*
|
|
5
5
|
* @see https://github.com/webgptorg/promptbook#block-type
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
6
7
|
*/
|
|
7
8
|
export type BlockType = TupleToUnion<typeof BlockTypes>;
|
|
8
9
|
/**
|
|
9
10
|
* Block type describes the way how the block is blockd
|
|
10
11
|
*
|
|
11
12
|
* @see https://github.com/webgptorg/promptbook#block-type
|
|
13
|
+
* @public exported from `@promptbook/core`
|
|
12
14
|
*/
|
|
13
15
|
export declare const BlockTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT", "PROMPT_DIALOG", "SAMPLE", "KNOWLEDGE", "INSTRUMENT", "ACTION"];
|
|
@@ -1,39 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The maximum number of iterations for a loops
|
|
3
|
+
*
|
|
4
|
+
* @private within the repository - too low-level in comparison to other `MAX_...`
|
|
3
5
|
*/
|
|
4
6
|
export declare const LOOP_LIMIT = 1000;
|
|
5
7
|
/**
|
|
6
8
|
* The maximum number of iterations for a loops which adds characters one by one
|
|
9
|
+
*
|
|
10
|
+
* @private within the repository - too low-level in comparison to other `MAX_...`
|
|
7
11
|
*/
|
|
8
12
|
export declare const CHARACTER_LOOP_LIMIT = 100000;
|
|
9
13
|
/**
|
|
10
14
|
* The maximum number of (LLM) tasks running in parallel
|
|
15
|
+
*
|
|
16
|
+
* @public exported from `@promptbook/core`
|
|
11
17
|
*/
|
|
12
18
|
export declare const MAX_PARALLEL_COUNT = 5;
|
|
13
19
|
/**
|
|
14
20
|
* The maximum number of attempts to execute LLM task before giving up
|
|
21
|
+
*
|
|
22
|
+
* @public exported from `@promptbook/core`
|
|
15
23
|
*/
|
|
16
24
|
export declare const MAX_EXECUTION_ATTEMPTS = 3;
|
|
17
25
|
/**
|
|
18
26
|
* The maximum length of the (generated) filename
|
|
27
|
+
*
|
|
28
|
+
* @public exported from `@promptbook/core`
|
|
19
29
|
*/
|
|
20
30
|
export declare const MAX_FILENAME_LENGTH = 30;
|
|
21
31
|
/**
|
|
22
32
|
* @@@
|
|
23
33
|
* TODO: [🐝] !!! Use
|
|
34
|
+
*
|
|
35
|
+
* @public exported from `@promptbook/core`
|
|
24
36
|
*/
|
|
25
37
|
export declare const MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
|
|
26
38
|
/**
|
|
27
39
|
* @@@
|
|
28
40
|
* TODO: [🐝] !!! Use
|
|
41
|
+
*
|
|
42
|
+
* @public exported from `@promptbook/core`
|
|
29
43
|
*/
|
|
30
44
|
export declare const MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
|
|
31
45
|
/**
|
|
32
46
|
* Where to store the cache of executions for promptbook CLI
|
|
47
|
+
*
|
|
48
|
+
* @public exported from `@promptbook/core`
|
|
33
49
|
*/
|
|
34
50
|
export declare const EXECUTIONS_CACHE_DIRNAME = "/.promptbook/executions-cache";
|
|
35
51
|
/**
|
|
36
52
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
53
|
+
*
|
|
54
|
+
* @public exported from `@promptbook/core`
|
|
37
55
|
*/
|
|
38
56
|
export declare const PIPELINE_COLLECTION_BASE_FILENAME = "index";
|
|
39
57
|
/**
|
|
@@ -42,20 +60,28 @@ export declare const PIPELINE_COLLECTION_BASE_FILENAME = "index";
|
|
|
42
60
|
export declare const REPLACING_NONCE = "u$k42k%!V2zo34w7Fu#@QUHYPW";
|
|
43
61
|
/**
|
|
44
62
|
* The names of the parameters that are reserved for special purposes
|
|
63
|
+
*
|
|
64
|
+
* @public exported from `@promptbook/core`
|
|
45
65
|
*/
|
|
46
66
|
export declare const RESERVED_PARAMETER_NAMES: readonly ["content", "context", "knowledge", "samples", "modelName", "currentDate"];
|
|
47
67
|
/**
|
|
48
68
|
* @@@
|
|
69
|
+
*
|
|
70
|
+
* @private within the repository
|
|
49
71
|
*/
|
|
50
72
|
export declare const RESERVED_PARAMETER_MISSING_VALUE: string;
|
|
51
73
|
/**
|
|
52
74
|
* @@@
|
|
75
|
+
*
|
|
76
|
+
* @private within the repository
|
|
53
77
|
*/
|
|
54
78
|
export declare const RESERVED_PARAMETER_RESTRICTED: string;
|
|
55
79
|
/**
|
|
56
80
|
* @@@
|
|
81
|
+
*
|
|
82
|
+
* @private within the repository
|
|
57
83
|
*/
|
|
58
84
|
export declare const DEBUG_ALLOW_PAYED_TESTING: boolean;
|
|
59
85
|
/**
|
|
60
|
-
* TODO:
|
|
86
|
+
* TODO: !!!!!! Check that all @private contains some normalized explanation
|
|
61
87
|
*/
|
|
@@ -5,6 +5,7 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
5
5
|
*
|
|
6
6
|
* @param pipelineJson Promptbook in JSON format (.ptbk.json)
|
|
7
7
|
* @returns Promptbook in string format (.ptbk.md)
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
8
9
|
*/
|
|
9
10
|
export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
|
|
10
11
|
/**
|
|
@@ -3,6 +3,8 @@ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
|
3
3
|
import type { PipelineString } from '../types/PipelineString';
|
|
4
4
|
/**
|
|
5
5
|
* Options for `pipelineStringToJson`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
6
8
|
*/
|
|
7
9
|
export type PipelineStringToJsonOptions = {
|
|
8
10
|
/**
|
|
@@ -20,13 +22,14 @@ export type PipelineStringToJsonOptions = {
|
|
|
20
22
|
* - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
21
23
|
* - `preparePipeline` - just one step in the compilation process
|
|
22
24
|
*
|
|
25
|
+
* Note: This function does not validate logic of the pipeline only the syntax
|
|
26
|
+
* Note: This function acts as compilation process
|
|
27
|
+
*
|
|
23
28
|
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
24
29
|
* @param options - Options and tools for the compilation
|
|
25
30
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
26
31
|
* @throws {ParsingError} if the promptbook string is not valid
|
|
27
|
-
*
|
|
28
|
-
* Note: This function does not validate logic of the pipeline only the syntax
|
|
29
|
-
* Note: This function acts as compilation process
|
|
32
|
+
* @public exported from `@promptbook/core`
|
|
30
33
|
*/
|
|
31
34
|
export declare function pipelineStringToJson(pipelineString: PipelineString, options?: PipelineStringToJsonOptions): Promise<PipelineJson>;
|
|
32
35
|
/**
|
|
@@ -8,12 +8,13 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
8
8
|
* - `pipelineStringToJsonSync` - 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
|
*
|
|
11
|
+
* Note: This function does not validate logic of the pipeline only the syntax
|
|
12
|
+
* Note: This function acts as compilation process
|
|
13
|
+
*
|
|
11
14
|
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
12
15
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
13
16
|
* @throws {ParsingError} if the promptbook string is not valid
|
|
14
|
-
*
|
|
15
|
-
* Note: This function does not validate logic of the pipeline only the syntax
|
|
16
|
-
* Note: This function acts as compilation process
|
|
17
|
+
* @public exported from `@promptbook/core`
|
|
17
18
|
*/
|
|
18
19
|
export declare function pipelineStringToJsonSync(pipelineString: PipelineString): PipelineJson;
|
|
19
20
|
/**
|
|
@@ -2,6 +2,8 @@ import type { PipelineString } from '../../types/PipelineString';
|
|
|
2
2
|
import type { PrettifyOptions } from './PrettifyOptions';
|
|
3
3
|
/**
|
|
4
4
|
* Prettyfies Promptbook string and adds Mermaid graph
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
5
7
|
*/
|
|
6
8
|
export declare function prettifyPipelineString(pipelineString: PipelineString, options: PrettifyOptions): Promise<PipelineString>;
|
|
7
9
|
/**
|
|
@@ -17,6 +17,8 @@ export type renderPipelineMermaidOptions = {
|
|
|
17
17
|
* Creates a Mermaid graph based on the promptbook
|
|
18
18
|
*
|
|
19
19
|
* Note: The result is not wrapped in a Markdown code block
|
|
20
|
+
*
|
|
21
|
+
* @public exported from `@promptbook/utils`
|
|
20
22
|
*/
|
|
21
23
|
export declare function renderPromptbookMermaid(pipelineJson: PipelineJson, options?: renderPipelineMermaidOptions): string;
|
|
22
24
|
/**
|
|
@@ -6,6 +6,7 @@ import type { string_parameter_name } from '../../types/typeAliases';
|
|
|
6
6
|
* @param promptTemplate the template with used parameters
|
|
7
7
|
* @returns the set of parameter names
|
|
8
8
|
* @throws {ParsingError} if the script is invalid
|
|
9
|
+
* @public exported from `@promptbook/utils`
|
|
9
10
|
*/
|
|
10
11
|
export declare function extractParameterNamesFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | 'blockType' | 'content' | 'preparedContent' | 'jokerParameterNames'>): Set<string_parameter_name>;
|
|
11
12
|
/**
|
|
@@ -6,6 +6,7 @@ import type { string_javascript_name } from '../../types/typeAliases';
|
|
|
6
6
|
* @param script from which to extract the variables
|
|
7
7
|
* @returns the list of variable names
|
|
8
8
|
* @throws {ParsingError} if the script is invalid
|
|
9
|
+
* @public exported from `@promptbook/utils`
|
|
9
10
|
*/
|
|
10
11
|
export declare function extractVariables(script: string_javascript): Set<string_javascript_name>;
|
|
11
12
|
/**
|
|
@@ -20,6 +20,7 @@ type RenameParameterOptions = {
|
|
|
20
20
|
* In other words, it will find all parameters that are not used in the prompt template itseld and all its dependencies
|
|
21
21
|
*
|
|
22
22
|
* @throws {PipelineLogicError} If the new parameter name is already used in the pipeline
|
|
23
|
+
* @public exported from `@promptbook/utils`
|
|
23
24
|
*/
|
|
24
25
|
export declare function renameParameter(options: RenameParameterOptions): PipelineJson;
|
|
25
26
|
export {};
|
|
@@ -4,6 +4,8 @@ import type { string_json } from '../../types/typeAliases';
|
|
|
4
4
|
*
|
|
5
5
|
* Note: [0] It can be used for more JSON types like whole collection of pipelines, single knowledge piece, etc.
|
|
6
6
|
* Note: In contrast to JSON.stringify, this function ensures that **embedding index** is on single line
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
7
9
|
*/
|
|
8
10
|
export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
|
|
9
11
|
/**
|
|
@@ -12,6 +12,7 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
|
12
12
|
* @param pipeline valid or invalid PipelineJson
|
|
13
13
|
* @returns the same pipeline if it is logically valid
|
|
14
14
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
15
|
+
* @public exported from `@promptbook/core`
|
|
15
16
|
*/
|
|
16
17
|
export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
|
|
17
18
|
/**
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error type indicates that you try to use a feature that is not available in the current environment
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
3
5
|
*/
|
|
4
6
|
export declare class EnvironmentMismatchError extends Error {
|
|
5
7
|
readonly name = "EnvironmentMismatchError";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
3
5
|
*/
|
|
4
6
|
export declare class PipelineLogicError extends Error {
|
|
5
7
|
readonly name = "PipelineLogicError";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error type indicates that the error should not happen and its last check before crashing with some other error
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
3
5
|
*/
|
|
4
6
|
export declare class UnexpectedError extends Error {
|
|
5
7
|
readonly name = "UnexpectedError";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { string_semantic_version } from '../types/typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* This error type indicates that the version of the pipeline is not matching the expected version
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
4
6
|
*/
|
|
5
7
|
export declare class VersionMismatchError extends Error {
|
|
6
8
|
readonly name = "UnexpectedError";
|
|
@@ -4,6 +4,7 @@ import type { PipelineExecutor } from './PipelineExecutor';
|
|
|
4
4
|
*
|
|
5
5
|
* @param executionResult - The partial result of the promptnook execution
|
|
6
6
|
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
7
8
|
*/
|
|
8
9
|
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PipelineExecutor>>, 'isSuccessful' | 'errors'>): void;
|
|
9
10
|
/**
|
|
@@ -53,6 +53,7 @@ interface CreatePipelineExecutorOptions {
|
|
|
53
53
|
*
|
|
54
54
|
* @returns The executor function
|
|
55
55
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
56
|
+
* @public exported from `@promptbook/core`
|
|
56
57
|
*/
|
|
57
58
|
export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
|
|
58
59
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { PromptResultUsage } from '../PromptResultUsage';
|
|
|
2
2
|
/**
|
|
3
3
|
* @@@
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
6
6
|
*/
|
|
7
7
|
export declare const ZERO_USAGE: import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
|
|
8
8
|
readonly price: {
|
|
@@ -59,5 +59,7 @@ export declare const ZERO_USAGE: import("type-fest/source/readonly-deep").Readon
|
|
|
59
59
|
* Function `addUsage` will add multiple usages into one
|
|
60
60
|
*
|
|
61
61
|
* Note: If you provide 0 values, it returns ZERO_USAGE
|
|
62
|
+
*
|
|
63
|
+
* @public exported from `@promptbook/core`
|
|
62
64
|
*/
|
|
63
65
|
export declare function addUsage(...usageItems: Array<PromptResultUsage>): PromptResultUsage;
|
|
@@ -8,6 +8,7 @@ import type { Expectations } from '../../types/PipelineJson/Expectations';
|
|
|
8
8
|
*
|
|
9
9
|
* @throws {ExpectError} if the expectations are not met
|
|
10
10
|
* @returns {void} Nothing
|
|
11
|
+
* @public exported from `@promptbook/core`
|
|
11
12
|
*/
|
|
12
13
|
export declare function checkExpectations(expectations: Expectations, value: string): void;
|
|
13
14
|
/**
|
|
@@ -18,6 +19,7 @@ export declare function checkExpectations(expectations: Expectations, value: str
|
|
|
18
19
|
* - `isPassingExpectations` which returns a boolean
|
|
19
20
|
*
|
|
20
21
|
* @returns {boolean} True if the expectations are met
|
|
22
|
+
* @public exported from `@promptbook/core`
|
|
21
23
|
*/
|
|
22
24
|
export declare function isPassingExpectations(expectations: Expectations, value: string): boolean;
|
|
23
25
|
/**
|
|
@@ -13,6 +13,7 @@ type ForEachAsyncOptions = {
|
|
|
13
13
|
* @param array - Array to iterate over
|
|
14
14
|
* @param options - Options for the function
|
|
15
15
|
* @param callbackfunction - Function to call for each item
|
|
16
|
+
* @public exported from `@promptbook/utils`
|
|
16
17
|
*/
|
|
17
18
|
export declare function forEachAsync<TItem>(array: Array<TItem>, options: ForEachAsyncOptions, callbackfunction: (value: TItem, index: number, array: Array<TItem>) => Promisable<void>): Promise<void>;
|
|
18
19
|
export {};
|
|
@@ -2,6 +2,8 @@ import type { string_markdown } from '../../types/typeAliases';
|
|
|
2
2
|
import type { PromptResultUsage } from '../PromptResultUsage';
|
|
3
3
|
/**
|
|
4
4
|
* Function `usageToHuman` will take usage and convert it to human readable report
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
5
7
|
*/
|
|
6
8
|
export declare function usageToHuman(usage: PromptResultUsage): string_markdown;
|
|
7
9
|
/**
|
|
@@ -6,5 +6,7 @@ import type { UncertainNumber } from '../UncertainNumber';
|
|
|
6
6
|
* Note: This is an estimate based of theese sources:
|
|
7
7
|
* - https://jecas.cz/doba-cteni
|
|
8
8
|
* - https://www.originalnitonery.cz/blog/psani-vsemi-deseti-se-muzete-naucit-i-sami-doma
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/core`
|
|
9
11
|
*/
|
|
10
12
|
export declare function usageToWorktime(usage: PromptResultUsage): UncertainNumber;
|
|
@@ -4,6 +4,7 @@ import type { string_name } from '../../types/typeAliases';
|
|
|
4
4
|
* A format definition is a set of functions that define how to validate, heal and convert response from LLM
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/webgptorg/promptbook/discussions/36
|
|
7
|
+
* @private still an internal experimental
|
|
7
8
|
*/
|
|
8
9
|
export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends string, TSchema extends object> = {
|
|
9
10
|
/**
|
|
@@ -66,4 +67,4 @@ export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends
|
|
|
66
67
|
* TODO: [🍓][🧠] Should execution tools be aviable to heal, canBeValid and isValid?
|
|
67
68
|
* TODO: [🍓][🧠] llm Provider Bindings
|
|
68
69
|
* TODO: [🍓][🔼] Export via some package
|
|
69
|
-
*/
|
|
70
|
+
*/
|
|
@@ -4,6 +4,8 @@ import type { CallbackInterfaceToolsOptions } from './CallbackInterfaceToolsOpti
|
|
|
4
4
|
/**
|
|
5
5
|
* Delagates the user interaction to a async callback function
|
|
6
6
|
* You need to provide your own implementation of this callback function and its bind to UI.
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
7
9
|
*/
|
|
8
10
|
export declare class CallbackInterfaceTools implements UserInterfaceTools {
|
|
9
11
|
private readonly options;
|
|
@@ -3,6 +3,8 @@ import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecu
|
|
|
3
3
|
import type { UserInterfaceToolsPromptDialogOptions } from '../../../execution/UserInterfaceTools';
|
|
4
4
|
/**
|
|
5
5
|
* Options for `CallbackInterfaceTools`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
6
8
|
*/
|
|
7
9
|
export type CallbackInterfaceToolsOptions = CommonExecutionToolsOptions & {
|
|
8
10
|
/**
|
|
@@ -6,6 +6,8 @@ import type { UserInterfaceToolsPromptDialogOptions } from '../../../execution/U
|
|
|
6
6
|
*
|
|
7
7
|
* Warning: It is used for testing and mocking
|
|
8
8
|
* **NOT intended to use in the production** due to its synchronous nature.
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/core`
|
|
9
11
|
*/
|
|
10
12
|
export declare class SimplePromptInterfaceTools implements UserInterfaceTools {
|
|
11
13
|
private readonly options;
|
|
@@ -17,4 +19,4 @@ export declare class SimplePromptInterfaceTools implements UserInterfaceTools {
|
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Note: [🔵] This code should never be published outside of `@promptbook/browser`
|
|
20
|
-
*/
|
|
22
|
+
*/
|
|
@@ -7,6 +7,11 @@ import type { string_mime_type } from '../../../types/typeAliases';
|
|
|
7
7
|
import type { string_mime_type_with_wildcard } from '../../../types/typeAliases';
|
|
8
8
|
import type { string_promptbook_documentation_url } from '../../../types/typeAliases';
|
|
9
9
|
import type { really_unknown } from '../../../utils/organization/really_unknown';
|
|
10
|
+
/**
|
|
11
|
+
* @@@
|
|
12
|
+
*
|
|
13
|
+
* @private still an internal experimental
|
|
14
|
+
*/
|
|
10
15
|
export type Scraper = {
|
|
11
16
|
readonly description: string_markdown_text;
|
|
12
17
|
readonly documentationUrl: string_promptbook_documentation_url;
|
|
@@ -14,6 +19,11 @@ export type Scraper = {
|
|
|
14
19
|
readonly mimeTypes: Array<string_mime_type_with_wildcard>;
|
|
15
20
|
scrape(source: ScraperSourceOptions): Promisable<string_markdown>;
|
|
16
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* @@@
|
|
24
|
+
*
|
|
25
|
+
* @private still an internal experimental
|
|
26
|
+
*/
|
|
17
27
|
export type ScraperSourceOptions = {
|
|
18
28
|
readonly source: string_knowledge_source_link;
|
|
19
29
|
readonly mimeType: string_mime_type;
|
|
@@ -5,10 +5,10 @@ import type { KnowledgeSourceJson } from '../../../types/PipelineJson/KnowledgeS
|
|
|
5
5
|
* Prepares the knowle
|
|
6
6
|
*
|
|
7
7
|
* @see https://github.com/webgptorg/promptbook/discussions/41
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
8
9
|
*/
|
|
9
10
|
export declare function prepareKnowledgePieces(knowledgeSources: Array<KnowledgeSourceJson>, options: PrepareOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'preparationIds'>>>;
|
|
10
11
|
/**
|
|
11
|
-
* TODO: [🐝][🔼] !!! Export via `@promptbook/core`
|
|
12
12
|
* TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
|
|
13
13
|
* Put `knowledgePieces` into `PrepareKnowledgeOptions`
|
|
14
14
|
* TODO: [🪂] More than max things can run in parallel by acident [1,[2a,2b,_],[3a,3b,_]]
|
package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { KnowledgePiecePreparedJson } from '../../../types/PipelineJson/Kno
|
|
|
3
3
|
import type { string_markdown } from '../../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
5
|
* @@@
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
6
8
|
*/
|
|
7
9
|
export declare function prepareKnowledgeFromMarkdown(knowledgeContent: string_markdown, options: PrepareOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>>>;
|
|
8
10
|
/**
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
2
|
+
/**
|
|
3
|
+
* @privxxate <- TODO: !!!!!! Warn that not private or exported
|
|
4
|
+
*/
|
|
2
5
|
export type CreateLlmToolsFromEnvOptions = {
|
|
3
6
|
/**
|
|
4
7
|
* This will will be passed to the created `LlmExecutionTools`
|
|
@@ -19,11 +22,11 @@ export type CreateLlmToolsFromEnvOptions = {
|
|
|
19
22
|
* - `process.env.ANTHROPIC_CLAUDE_API_KEY`
|
|
20
23
|
*
|
|
21
24
|
* @returns @@@
|
|
25
|
+
* @public exported from `@promptbook/node`
|
|
22
26
|
*/
|
|
23
27
|
export declare function createLlmToolsFromEnv(options?: CreateLlmToolsFromEnvOptions): LlmExecutionTools;
|
|
24
28
|
/**
|
|
25
29
|
* TODO: [🍜] Use `createLlmToolsFromConfiguration`
|
|
26
|
-
* TODO: [🔼] !!! Export via `@promptbook/node`
|
|
27
30
|
* TODO: @@@ write discussion about this - wizzard
|
|
28
31
|
* TODO: Add Azure
|
|
29
32
|
* TODO: [🧠] Which name is better `createLlmToolsFromEnv` or `createLlmToolsFromEnvironment`?
|
|
@@ -7,10 +7,10 @@ import type { CacheLlmToolsOptions } from './CacheLlmToolsOptions';
|
|
|
7
7
|
*
|
|
8
8
|
* @param llmTools LLM tools to be intercepted with usage counting, it can contain extra methods like `totalUsage`
|
|
9
9
|
* @returns LLM tools with same functionality with added total cost counting
|
|
10
|
+
* @public exported from `@promptbook/core`
|
|
10
11
|
*/
|
|
11
12
|
export declare function cacheLlmTools<TLlmTools extends LlmExecutionTools>(llmTools: TLlmTools, options?: Partial<CacheLlmToolsOptions>): TLlmTools;
|
|
12
13
|
/**
|
|
13
|
-
* TODO: [🔼] !!! Export via `@promptbook/core`
|
|
14
14
|
* TODO: [🧠][💸] Maybe make some common abstraction `interceptLlmTools` and use here (or use javascript Proxy?)
|
|
15
15
|
* TODO: [🧠] Is there some meaningfull way how to test this util
|
|
16
16
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
@@ -5,10 +5,10 @@ import type { LlmExecutionToolsWithTotalUsage } from './LlmExecutionToolsWithTot
|
|
|
5
5
|
*
|
|
6
6
|
* @param llmTools LLM tools to be intercepted with usage counting
|
|
7
7
|
* @returns LLM tools with same functionality with added total cost counting
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
8
9
|
*/
|
|
9
10
|
export declare function countTotalUsage(llmTools: LlmExecutionTools): LlmExecutionToolsWithTotalUsage;
|
|
10
11
|
/**
|
|
11
|
-
* TODO: [🔼] !!! Export via `@promptbookcore/`
|
|
12
12
|
* TODO: [🧠][💸] Maybe make some common abstraction `interceptLlmTools` and use here (or use javascript Proxy?)
|
|
13
13
|
* TODO: [🧠] Is there some meaningfull way how to test this util
|
|
14
14
|
* TODO: [🧠][🌯] Maybe a way how to hide ability to `get totalUsage`
|