@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
|
@@ -22,11 +22,12 @@ type LimitTotalUsageOptions = {
|
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* @@@
|
|
25
|
+
*
|
|
26
|
+
* @public exported from `@promptbook/core`
|
|
25
27
|
*/
|
|
26
28
|
export declare function limitTotalUsage(llmTools: LlmExecutionTools, options?: Partial<LimitTotalUsageOptions>): LlmExecutionToolsWithTotalUsage;
|
|
27
29
|
export {};
|
|
28
30
|
/**
|
|
29
|
-
* TODO: [🔼] !!! Export via `@promptbookcore/`
|
|
30
31
|
* TODO: Maybe internally use `countTotalUsage`
|
|
31
32
|
* TODO: [🧠][💸] Maybe make some common abstraction `interceptLlmTools` and use here (or use javascript Proxy?)
|
|
32
33
|
* TODO: [🧠] Is there some meaningfull way how to test this util
|
|
@@ -8,6 +8,8 @@ import type { string_title } from '../../types/typeAliases';
|
|
|
8
8
|
import type { AnthropicClaudeExecutionToolsOptions } from './AnthropicClaudeExecutionToolsOptions';
|
|
9
9
|
/**
|
|
10
10
|
* Execution Tools for calling Anthropic Claude API.
|
|
11
|
+
*
|
|
12
|
+
* @public exported from `@promptbook/anthropic-claude`
|
|
11
13
|
*/
|
|
12
14
|
export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools {
|
|
13
15
|
private readonly options;
|
package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutio
|
|
|
4
4
|
* Options for `AnthropicClaudeExecutionTools`
|
|
5
5
|
*
|
|
6
6
|
* This extends Anthropic's `ClientOptions` with are directly passed to the Anthropic client.
|
|
7
|
+
* @public exported from `@promptbook/anthropic-claude`
|
|
7
8
|
*/
|
|
8
9
|
export type AnthropicClaudeExecutionToolsOptions = CommonExecutionToolsOptions & ClientOptions;
|
|
9
10
|
/**
|
|
10
11
|
* TODO: [🍜] Auto add WebGPT / Promptbook.studio anonymous server in browser
|
|
11
|
-
*/
|
|
12
|
+
*/
|
|
@@ -9,6 +9,8 @@ import type { string_title } from '../../types/typeAliases';
|
|
|
9
9
|
import type { AzureOpenAiExecutionToolsOptions } from './AzureOpenAiExecutionToolsOptions';
|
|
10
10
|
/**
|
|
11
11
|
* Execution Tools for calling Azure OpenAI API.
|
|
12
|
+
*
|
|
13
|
+
* @public exported from `@promptbook/azure-openai`
|
|
12
14
|
*/
|
|
13
15
|
export declare class AzureOpenAiExecutionTools implements LlmExecutionTools {
|
|
14
16
|
private readonly options;
|
|
@@ -5,6 +5,7 @@ import type { string_token } from '../../types/typeAliases';
|
|
|
5
5
|
* Options for `AzureOpenAiExecutionTools`
|
|
6
6
|
*
|
|
7
7
|
* @see https://oai.azure.com/portal/
|
|
8
|
+
* @public exported from `@promptbook/azure-openai`
|
|
8
9
|
*/
|
|
9
10
|
export type AzureOpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
10
11
|
/**
|
|
@@ -5,6 +5,8 @@ import type { string_title } from '../../types/typeAliases';
|
|
|
5
5
|
import { OpenAiExecutionTools } from '../openai/OpenAiExecutionTools';
|
|
6
6
|
/**
|
|
7
7
|
* Execution Tools for calling OpenAI API.
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/langtail`
|
|
8
10
|
*/
|
|
9
11
|
export declare class LangtailExecutionTools extends OpenAiExecutionTools implements LlmExecutionTools {
|
|
10
12
|
get title(): string_title & string_markdown_text;
|
|
@@ -4,6 +4,8 @@ import type { OpenAiExecutionToolsOptions } from '../openai/OpenAiExecutionTools
|
|
|
4
4
|
*
|
|
5
5
|
* This extends OpenAI's `ClientOptions` with are directly passed to the OpenAI client.
|
|
6
6
|
* Rest is used by the `OpenAiExecutionTools`.
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/langtail`
|
|
7
9
|
*/
|
|
8
10
|
export type LangtailExecutionToolsOptions = OpenAiExecutionToolsOptions;
|
|
9
11
|
/**
|
|
@@ -9,6 +9,8 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
9
9
|
import type { string_title } from '../../types/typeAliases';
|
|
10
10
|
/**
|
|
11
11
|
* Mocked execution Tools for just echoing the requests for testing purposes.
|
|
12
|
+
*
|
|
13
|
+
* @public exported from `@promptbook/fake-llm`
|
|
12
14
|
*/
|
|
13
15
|
export declare class MockedEchoLlmExecutionTools implements LlmExecutionTools {
|
|
14
16
|
private readonly options;
|
|
@@ -10,6 +10,8 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
10
10
|
import type { string_title } from '../../types/typeAliases';
|
|
11
11
|
/**
|
|
12
12
|
* Mocked execution Tools for just faking expected responses for testing purposes
|
|
13
|
+
*
|
|
14
|
+
* @public exported from `@promptbook/fake-llm`
|
|
13
15
|
*/
|
|
14
16
|
export declare class MockedFackedLlmExecutionTools implements LlmExecutionTools {
|
|
15
17
|
private readonly options;
|
|
@@ -12,6 +12,8 @@ import { MultipleLlmExecutionTools } from './MultipleLlmExecutionTools';
|
|
|
12
12
|
*
|
|
13
13
|
*
|
|
14
14
|
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`
|
|
15
|
+
*
|
|
16
|
+
* @public exported from `@promptbook/core`
|
|
15
17
|
*/
|
|
16
18
|
export declare function joinLlmExecutionTools(...llmExecutionTools: Array<LlmExecutionTools>): MultipleLlmExecutionTools;
|
|
17
19
|
/**
|
|
@@ -10,6 +10,8 @@ import type { string_title } from '../../types/typeAliases';
|
|
|
10
10
|
import type { OpenAiExecutionToolsOptions } from './OpenAiExecutionToolsOptions';
|
|
11
11
|
/**
|
|
12
12
|
* Execution Tools for calling OpenAI API.
|
|
13
|
+
*
|
|
14
|
+
* @public exported from `@promptbook/openai`
|
|
13
15
|
*/
|
|
14
16
|
export declare class OpenAiExecutionTools implements LlmExecutionTools {
|
|
15
17
|
private readonly options;
|
|
@@ -6,6 +6,8 @@ import type { string_token } from '../../types/typeAliases';
|
|
|
6
6
|
*
|
|
7
7
|
* This extends OpenAI's `ClientOptions` with are directly passed to the OpenAI client.
|
|
8
8
|
* Rest is used by the `OpenAiExecutionTools`.
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/openai`
|
|
9
11
|
*/
|
|
10
12
|
export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & ClientOptions & {
|
|
11
13
|
/**
|
|
@@ -7,6 +7,7 @@ import type { number_usd } from '../../types/typeAliases';
|
|
|
7
7
|
*
|
|
8
8
|
* @see https://platform.openai.com/docs/models/
|
|
9
9
|
* @see https://openai.com/api/pricing/
|
|
10
|
+
* @public exported from `@promptbook/openai`
|
|
10
11
|
*/
|
|
11
12
|
export declare const OPENAI_MODELS: Array<AvailableModel & {
|
|
12
13
|
pricing?: {
|
|
@@ -17,6 +17,7 @@ import type { RemoteLlmExecutionToolsOptions } from './RemoteLlmExecutionToolsOp
|
|
|
17
17
|
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
18
18
|
*
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
20
|
+
* @public exported from `@promptbook/remote-client`
|
|
20
21
|
*/
|
|
21
22
|
export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
|
|
22
23
|
private readonly options;
|
|
@@ -3,6 +3,8 @@ import type { client_id } from '../../types/typeAliases';
|
|
|
3
3
|
import type { string_uri } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
5
|
* Options for `RemoteLlmExecutionTools`
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/remote-client`
|
|
6
8
|
*/
|
|
7
9
|
export type RemoteLlmExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
10
|
/**
|
|
@@ -3,6 +3,12 @@ import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecu
|
|
|
3
3
|
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
|
|
4
4
|
import type { client_id } from '../../../types/typeAliases';
|
|
5
5
|
import type { string_uri } from '../../../types/typeAliases';
|
|
6
|
+
/**
|
|
7
|
+
* @@@
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/remote-client`
|
|
10
|
+
* @public exported from `@promptbook/remote-server`
|
|
11
|
+
*/
|
|
6
12
|
export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
7
13
|
/**
|
|
8
14
|
* Port on which the server will listen
|
|
@@ -28,4 +34,4 @@ export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
|
28
34
|
};
|
|
29
35
|
/**
|
|
30
36
|
* TODO: [🍜] Add anonymous option
|
|
31
|
-
*/
|
|
37
|
+
*/
|
|
@@ -7,6 +7,7 @@ import type { RemoteServerOptions } from './interfaces/RemoteServerOptions';
|
|
|
7
7
|
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
8
8
|
*
|
|
9
9
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
10
|
+
* @public exported from `@promptbook/remote-server`
|
|
10
11
|
*/
|
|
11
12
|
export declare function startRemoteServer(options: RemoteServerOptions): IDestroyable;
|
|
12
13
|
/**
|
|
@@ -5,10 +5,10 @@ import type { string_persona_description } from '../types/typeAliases';
|
|
|
5
5
|
* Prepares the persona for the pipeline
|
|
6
6
|
*
|
|
7
7
|
* @see https://github.com/webgptorg/promptbook/discussions/22
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
8
9
|
*/
|
|
9
10
|
export declare function preparePersona(personaDescription: string_persona_description, options: PrepareOptions): Promise<PersonaPreparedJson['modelRequirements']>;
|
|
10
11
|
/**
|
|
11
|
-
* TODO: [🔼] !!! Export via `@promptbook/core`
|
|
12
12
|
* TODO: [🏢] !! Check validity of `modelName` in pipeline
|
|
13
13
|
* TODO: [🏢] !! Check validity of `systemMessage` in pipeline
|
|
14
14
|
* TODO: [🏢] !! Check validity of `temperature` in pipeline
|
|
@@ -8,5 +8,10 @@ import type { string_markdown } from '../../types/typeAliases';
|
|
|
8
8
|
* - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
|
|
9
9
|
* - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
|
|
10
10
|
* - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
|
|
11
|
+
*
|
|
12
|
+
* @public exported from `@promptbook/utils`
|
|
11
13
|
*/
|
|
12
14
|
export declare function extractBlock(markdown: string_markdown): string;
|
|
15
|
+
/**
|
|
16
|
+
* TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
|
|
17
|
+
*/
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
2
|
/**
|
|
3
3
|
* Determine if the pipeline is fully prepared
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
4
6
|
*/
|
|
5
7
|
export declare function isPipelinePrepared(pipeline: PipelineJson): boolean;
|
|
6
8
|
/**
|
|
7
9
|
* TODO: [🐠] Maybe base this on `makeValidator`
|
|
8
|
-
* TODO: [🔼] Export via core or utils
|
|
9
10
|
* TODO: [🧊] Pipeline can be partially prepared, this should return true ONLY if fully prepared
|
|
10
11
|
* TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
|
|
11
12
|
* - [🏍] ? Is context in each template
|
|
@@ -5,10 +5,10 @@ import type { PrepareOptions } from './PrepareOptions';
|
|
|
5
5
|
*
|
|
6
6
|
* Note: This function does not validate logic of the pipeline
|
|
7
7
|
* Note: This function acts as part of compilation process
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
8
9
|
*/
|
|
9
10
|
export declare function preparePipeline(pipeline: PipelineJson, options: PrepareOptions): Promise<PipelineJson>;
|
|
10
11
|
/**
|
|
11
|
-
* TODO: [🔼] !!! Export via `@promptbook/core`
|
|
12
12
|
* TODO: Write tests for `preparePipeline`
|
|
13
13
|
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
14
14
|
* TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
|
|
@@ -15,6 +15,8 @@ type PreparedTemplates = {
|
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* @@@
|
|
18
|
+
*
|
|
19
|
+
* @public exported from `@promptbook/core`
|
|
18
20
|
*/
|
|
19
21
|
export declare function prepareTemplates(pipeline: PrepareTemplateInput, options: PrepareOptions): Promise<PreparedTemplates>;
|
|
20
22
|
export {};
|
|
@@ -22,7 +24,6 @@ export {};
|
|
|
22
24
|
* TODO: [🧠] Add context to each template (if missing)
|
|
23
25
|
* TODO: [🧠] What is better name `prepareTemplate` or `prepareTemplateAndParameters`
|
|
24
26
|
* TODO: [♨] !!! Prepare index the samples and maybe templates
|
|
25
|
-
* TODO: [🔼] !!! Export via `@promptbook/core`
|
|
26
27
|
* TODO: Write tests for `preparePipeline`
|
|
27
28
|
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
28
29
|
* TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
2
|
/**
|
|
3
3
|
* Unprepare just strips the preparation data of the pipeline
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
4
6
|
*/
|
|
5
7
|
export declare function unpreparePipeline(pipeline: PipelineJson): PipelineJson;
|
|
6
8
|
/**
|
|
7
|
-
* TODO: [🔼] !!! Export via `@promptbook/core`
|
|
8
9
|
* TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
|
|
9
10
|
* TODO: Write tests for `preparePipeline`
|
|
10
11
|
* TODO: [🍙] Make some standart order of json properties
|
|
@@ -5,6 +5,8 @@ import type { JavascriptExecutionToolsOptions } from './JavascriptExecutionTools
|
|
|
5
5
|
*
|
|
6
6
|
* Warning: It is used for testing and mocking
|
|
7
7
|
* **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/execute-javascript`
|
|
8
10
|
*/
|
|
9
11
|
export declare class JavascriptEvalExecutionTools implements ScriptExecutionTools {
|
|
10
12
|
private readonly options;
|
|
@@ -3,5 +3,6 @@ import { JavascriptEvalExecutionTools } from './JavascriptEvalExecutionTools';
|
|
|
3
3
|
* Placeholder for better implementation of JavascriptExecutionTools - some propper sandboxing
|
|
4
4
|
*
|
|
5
5
|
* @alias JavascriptExecutionTools
|
|
6
|
+
* @public exported from `@promptbook/execute-javascript`
|
|
6
7
|
*/
|
|
7
8
|
export declare const JavascriptExecutionTools: typeof JavascriptEvalExecutionTools;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import spaceTrim from 'spacetrim';
|
|
2
|
+
import { extractBlock } from '../../postprocessing/utils/extractBlock';
|
|
3
|
+
import { prettifyMarkdown } from '../../utils/markdown/prettifyMarkdown';
|
|
4
|
+
import { capitalize } from '../../utils/normalization/capitalize';
|
|
5
|
+
import { decapitalize } from '../../utils/normalization/decapitalize';
|
|
6
|
+
import { nameToUriPart } from '../../utils/normalization/nameToUriPart';
|
|
7
|
+
import { nameToUriParts } from '../../utils/normalization/nameToUriParts';
|
|
8
|
+
import { normalizeToKebabCase } from '../../utils/normalization/normalize-to-kebab-case';
|
|
9
|
+
import { normalizeTo_PascalCase } from '../../utils/normalization/normalizeTo_PascalCase';
|
|
10
|
+
import { normalizeTo_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
11
|
+
import { normalizeTo_camelCase } from '../../utils/normalization/normalizeTo_camelCase';
|
|
12
|
+
import { normalizeTo_snake_case } from '../../utils/normalization/normalizeTo_snake_case';
|
|
13
|
+
import { normalizeWhitespaces } from '../../utils/normalization/normalizeWhitespaces';
|
|
14
|
+
import { removeDiacritics } from '../../utils/normalization/removeDiacritics';
|
|
15
|
+
import { removeEmojis } from '../../utils/removeEmojis';
|
|
16
|
+
import { removeQuotes } from '../../utils/removeQuotes';
|
|
17
|
+
import { trimCodeBlock } from '../../utils/trimCodeBlock';
|
|
18
|
+
import { trimEndOfCodeBlock } from '../../utils/trimEndOfCodeBlock';
|
|
19
|
+
import { unwrapResult } from '../../utils/unwrapResult';
|
|
20
|
+
/**
|
|
21
|
+
* @@@
|
|
22
|
+
*
|
|
23
|
+
* @public exported from `@promptbook/execute-javascript`
|
|
24
|
+
*/
|
|
25
|
+
export declare const POSTPROCESSING_FUNCTIONS: {
|
|
26
|
+
spaceTrim: typeof spaceTrim;
|
|
27
|
+
removeQuotes: typeof removeQuotes;
|
|
28
|
+
unwrapResult: typeof unwrapResult;
|
|
29
|
+
trimEndOfCodeBlock: typeof trimEndOfCodeBlock;
|
|
30
|
+
trimCodeBlock: typeof trimCodeBlock;
|
|
31
|
+
trim: (str: string) => string;
|
|
32
|
+
reverse: (str: string) => string;
|
|
33
|
+
removeEmojis: typeof removeEmojis;
|
|
34
|
+
prettifyMarkdown: typeof prettifyMarkdown;
|
|
35
|
+
capitalize: typeof capitalize;
|
|
36
|
+
decapitalize: typeof decapitalize;
|
|
37
|
+
nameToUriPart: typeof nameToUriPart;
|
|
38
|
+
nameToUriParts: typeof nameToUriParts;
|
|
39
|
+
removeDiacritics: typeof removeDiacritics;
|
|
40
|
+
normalizeWhitespaces: typeof normalizeWhitespaces;
|
|
41
|
+
normalizeToKebabCase: typeof normalizeToKebabCase;
|
|
42
|
+
normalizeTo_camelCase: typeof normalizeTo_camelCase;
|
|
43
|
+
normalizeTo_snake_case: typeof normalizeTo_snake_case;
|
|
44
|
+
normalizeTo_PascalCase: typeof normalizeTo_PascalCase;
|
|
45
|
+
parseKeywords: (input: string) => string;
|
|
46
|
+
normalizeTo_SCREAMING_CASE: typeof normalizeTo_SCREAMING_CASE;
|
|
47
|
+
extractBlock: typeof extractBlock;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* TODO: DRY [🍯], [🧠] Where should be POSTPROCESSING_FUNCTIONS located and how it should be named
|
|
51
|
+
*/
|
|
@@ -2,6 +2,8 @@ import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
|
2
2
|
import type { FilesStorageOptions } from './FilesStorageOptions';
|
|
3
3
|
/**
|
|
4
4
|
* @@@
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/node`
|
|
5
7
|
*/
|
|
6
8
|
export declare class FilesStorage<TItem> implements PromptbookStorage<TItem> {
|
|
7
9
|
private readonly options;
|
|
@@ -24,7 +26,6 @@ export declare class FilesStorage<TItem> implements PromptbookStorage<TItem> {
|
|
|
24
26
|
removeItem(key: string): Promise<void>;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
|
-
* TODO: [🔼] !!! Export via `@promptbook/node`
|
|
28
29
|
* TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
|
|
29
30
|
* Note: [🟢] This code should never be published outside of `@promptbook/node`
|
|
30
31
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
2
2
|
/**
|
|
3
3
|
* Gets wrapper around `localStorage` object which can be used as `PromptbookStorage`
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/browser`
|
|
4
6
|
*/
|
|
5
7
|
export declare function getLocalStorage<TItem>(): PromptbookStorage<TItem>;
|
|
6
8
|
/**
|
|
7
|
-
* TODO: [🔼] !!! Export via `@promptbook/browser`
|
|
8
9
|
* Note: [🔵] This code should never be published outside of `@promptbook/browser`
|
|
9
10
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
2
2
|
/**
|
|
3
3
|
* Gets wrapper around `sessionStorage` object which can be used as `PromptbookStorage`
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/browser`
|
|
4
6
|
*/
|
|
5
7
|
export declare function getSessionStorage<TItem>(): PromptbookStorage<TItem>;
|
|
6
8
|
/**
|
|
7
|
-
* TODO: [🔼] !!! Export via `@promptbook/browser`
|
|
8
9
|
* Note: [🔵] This code should never be published outside of `@promptbook/browser`
|
|
9
10
|
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
2
2
|
/**
|
|
3
3
|
* Stores
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
4
6
|
*/
|
|
5
7
|
export declare class MemoryStorage<TItem> implements PromptbookStorage<TItem> {
|
|
6
8
|
private storage;
|
|
@@ -29,6 +31,3 @@ export declare class MemoryStorage<TItem> implements PromptbookStorage<TItem> {
|
|
|
29
31
|
*/
|
|
30
32
|
removeItem(key: string): void;
|
|
31
33
|
}
|
|
32
|
-
/**
|
|
33
|
-
* TODO: [🔼] !!! Export via `@promptbook/core`
|
|
34
|
-
*/
|
|
@@ -2,6 +2,8 @@ import { Promisable } from 'type-fest';
|
|
|
2
2
|
import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
3
3
|
/**
|
|
4
4
|
* This class behaves like LocalStorage but separates keys by prefix
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
5
7
|
*/
|
|
6
8
|
export declare class PrefixStorage<TItem> implements PromptbookStorage<TItem> {
|
|
7
9
|
private baseStorage;
|
|
@@ -21,6 +23,3 @@ export declare class PrefixStorage<TItem> implements PromptbookStorage<TItem> {
|
|
|
21
23
|
*/
|
|
22
24
|
removeItem(key: string): void;
|
|
23
25
|
}
|
|
24
|
-
/**
|
|
25
|
-
* TODO: [🔼] !!! Export via `@promptbook/core`
|
|
26
|
-
*/
|
|
@@ -91,7 +91,6 @@ export type CommonModelRequirements = {
|
|
|
91
91
|
readonly maxTokens?: number;
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
|
-
* TODO: [🔼] !!!!! (<- To all [🔼]) Export all from `@promptbook/types`
|
|
95
94
|
* TODO: [🧠][🈁] `seed` should maybe be somewhere else (not in `ModelRequirements`) (simmilar that `user` identification is not here)
|
|
96
95
|
* TODO: [🧠][💱] Add more model options: `stop_token`, `logit_bias`, `logprobs` (`top_logprobs`), `top_k`, `top_p`, `presence_penalty`, `frequency_penalty`, `bestOf`, `logitBias`, `logitBiasType`,...
|
|
97
96
|
* [💱] Probbably keep using just `temperature` in Promptbook (not `top_k` and `top_p`)
|
|
@@ -102,7 +102,6 @@ export type CommonPrompt = {
|
|
|
102
102
|
readonly parameters: Parameters;
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
|
-
* TODO: [🔼] !!!! Export all from `@promptbook/types`
|
|
106
105
|
* TODO: [🧄] Replace all "github.com/webgptorg/promptbook#xxx" with "ptbk.io/xxx"
|
|
107
106
|
* TODO: [✔] Check ModelRequirements in runtime
|
|
108
107
|
* TODO: [🏳] Add options for translation - maybe create `TranslationPrompt`
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { number_percent } from '../typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* Options for `executionReportJsonToString`
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
4
6
|
*/
|
|
5
7
|
export type ExecutionReportStringOptions = {
|
|
6
8
|
/**
|
|
@@ -14,6 +16,8 @@ export type ExecutionReportStringOptions = {
|
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* Default options for generating an execution report string
|
|
19
|
+
*
|
|
20
|
+
* @public exported from `@promptbook/core`
|
|
17
21
|
*/
|
|
18
22
|
export declare const ExecutionReportStringOptionsDefaults: {
|
|
19
23
|
taxRate: number;
|
|
@@ -3,6 +3,8 @@ import type { ExecutionReportString } from './ExecutionReportString';
|
|
|
3
3
|
import type { ExecutionReportStringOptions } from './ExecutionReportStringOptions';
|
|
4
4
|
/**
|
|
5
5
|
* Converts execution report from JSON to string format
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
6
8
|
*/
|
|
7
9
|
export declare function executionReportJsonToString(executionReportJson: ExecutionReportJson, options?: Partial<ExecutionReportStringOptions>): ExecutionReportString;
|
|
8
10
|
/**
|
|
@@ -172,12 +172,16 @@ export type string_xml = string;
|
|
|
172
172
|
* Semantic helper
|
|
173
173
|
*
|
|
174
174
|
* For example `"**Hello** World!"`
|
|
175
|
+
*
|
|
176
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
175
177
|
*/
|
|
176
178
|
export type string_markdown = string;
|
|
177
179
|
/**
|
|
178
180
|
* Semantic helper
|
|
179
181
|
*
|
|
180
182
|
* Markdown text with exactly ONE heading on first line NO less NO more
|
|
183
|
+
*
|
|
184
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
181
185
|
*/
|
|
182
186
|
export type string_markdown_section = string;
|
|
183
187
|
/**
|
|
@@ -185,6 +189,8 @@ export type string_markdown_section = string;
|
|
|
185
189
|
*
|
|
186
190
|
* Markdown without any headings like h1, h2
|
|
187
191
|
* BUT with formatting, lists, blockquotes, blocks, etc. is allowed
|
|
192
|
+
*
|
|
193
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
188
194
|
*/
|
|
189
195
|
export type string_markdown_section_content = string;
|
|
190
196
|
/**
|
|
@@ -194,6 +200,8 @@ export type string_markdown_section_content = string;
|
|
|
194
200
|
* BUT with bold, italic, etc. is allowed
|
|
195
201
|
*
|
|
196
202
|
* For example `"**Hello** World!"`
|
|
203
|
+
*
|
|
204
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
197
205
|
*/
|
|
198
206
|
export type string_markdown_text = string;
|
|
199
207
|
/**
|
|
@@ -573,7 +581,6 @@ export type number_gigabytes = number_positive;
|
|
|
573
581
|
export type number_terabytes = number_positive;
|
|
574
582
|
/**.
|
|
575
583
|
* TODO: !!! Change "For example" to @example
|
|
576
|
-
* TODO: !! Cleanup
|
|
577
584
|
* TODO: !! Change to branded types
|
|
578
|
-
* TODO:
|
|
585
|
+
* TODO: Delete type aliases that are not exported or used internally
|
|
579
586
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { WritableDeep } from 'type-fest';
|
|
2
2
|
/**
|
|
3
3
|
* @@@
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/utils`
|
|
4
6
|
*/
|
|
5
7
|
export declare function deepClone<TObject>(objectValue: TObject): WritableDeep<TObject>;
|
|
6
8
|
/**
|
|
7
|
-
* TODO: [🔼] Export from `@promptbook/utils`
|
|
8
9
|
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
9
10
|
*/
|
|
@@ -12,11 +12,11 @@ export declare function deepFreeze<TObject>(objectValue: TObject): ReadonlyDeep<
|
|
|
12
12
|
* @@@
|
|
13
13
|
*
|
|
14
14
|
* @returns The same object as the input, but deeply frozen
|
|
15
|
+
* @public exported from `@promptbook/utils`
|
|
15
16
|
*
|
|
16
17
|
* Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
|
|
17
18
|
*/
|
|
18
19
|
export declare function deepFreezeWithSameType<TObject>(objectValue: TObject): TObject;
|
|
19
20
|
/**
|
|
20
|
-
* TODO: [🔼] Export from `@promptbook/utils`
|
|
21
21
|
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
22
22
|
*/
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
|
|
2
2
|
/**
|
|
3
3
|
* Split text into sentences
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/utils`
|
|
4
6
|
*/
|
|
5
7
|
export declare function splitIntoSentences(text: string): Array<string>;
|
|
6
8
|
/**
|
|
7
9
|
* Counts number of sentences in the text
|
|
10
|
+
*
|
|
11
|
+
* @public exported from `@promptbook/utils`
|
|
8
12
|
*/
|
|
9
13
|
export declare function countSentences(text: string): ExpectationAmount;
|
|
@@ -2,5 +2,7 @@ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
|
|
|
2
2
|
import type { ExpectationUnit } from '../../types/PipelineJson/Expectations';
|
|
3
3
|
/**
|
|
4
4
|
* Index of all counter functions
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
5
7
|
*/
|
|
6
8
|
export declare const CountUtils: Record<ExpectationUnit, (text: string) => ExpectationAmount>;
|