@promptbook/node 0.56.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +706 -0
- package/esm/index.es.js +2491 -0
- package/esm/index.es.js.map +1 -0
- package/esm/typings/_packages/anthropic-claude.index.d.ts +5 -0
- package/esm/typings/_packages/azure-openai.index.d.ts +5 -0
- package/esm/typings/_packages/cli.index.d.ts +10 -0
- package/esm/typings/_packages/core.index.d.ts +41 -0
- package/esm/typings/_packages/execute-javascript.index.d.ts +48 -0
- package/esm/typings/_packages/fake-llm.index.d.ts +7 -0
- package/esm/typings/_packages/langtail.index.d.ts +5 -0
- package/esm/typings/_packages/node.index.d.ts +4 -0
- package/esm/typings/_packages/openai.index.d.ts +6 -0
- package/esm/typings/_packages/remote-client.index.d.ts +6 -0
- package/esm/typings/_packages/remote-server.index.d.ts +5 -0
- package/esm/typings/_packages/types.index.d.ts +28 -0
- package/esm/typings/_packages/utils.index.d.ts +71 -0
- package/esm/typings/config.d.ts +8 -0
- package/esm/typings/conversion/prettify/PrettifyOptions.d.ts +13 -0
- package/esm/typings/conversion/prettify/prettifyPromptbookString.d.ts +10 -0
- package/esm/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -0
- package/esm/typings/conversion/prettify/renderPromptbookMermaid.d.ts +25 -0
- package/esm/typings/conversion/promptbookJsonToString.d.ts +12 -0
- package/esm/typings/conversion/promptbookStringToJson.d.ts +15 -0
- package/esm/typings/conversion/promptbookStringToJson.test.d.ts +1 -0
- package/esm/typings/conversion/utils/extractParametersFromPromptTemplate.d.ts +13 -0
- package/esm/typings/conversion/utils/extractParametersFromPromptTemplate.test.d.ts +1 -0
- package/esm/typings/conversion/utils/extractVariables.d.ts +13 -0
- package/esm/typings/conversion/utils/extractVariables.test.d.ts +1 -0
- package/esm/typings/conversion/utils/parseCommand.d.ts +11 -0
- package/esm/typings/conversion/utils/parseCommand.test.d.ts +4 -0
- package/esm/typings/conversion/utils/parseNumber.d.ts +15 -0
- package/esm/typings/conversion/utils/parseNumber.test.d.ts +1 -0
- package/esm/typings/conversion/utils/renameParameter.d.ts +25 -0
- package/esm/typings/conversion/utils/renameParameter.test.d.ts +1 -0
- package/esm/typings/conversion/utils/titleToName.d.ts +4 -0
- package/esm/typings/conversion/utils/titleToName.test.d.ts +1 -0
- package/esm/typings/conversion/validation/_importPromptbook.d.ts +13 -0
- package/esm/typings/conversion/validation/promptbookStringToJson-syntaxErrors.test.d.ts +1 -0
- package/esm/typings/conversion/validation/validatePromptbookJson-logicErrors.test.d.ts +1 -0
- package/esm/typings/conversion/validation/validatePromptbookJson.d.ts +27 -0
- package/esm/typings/conversion/validation/validatePromptbookJson.test.d.ts +1 -0
- package/esm/typings/errors/PromptbookExecutionError.d.ts +7 -0
- package/esm/typings/errors/PromptbookLibraryError.d.ts +7 -0
- package/esm/typings/errors/PromptbookLogicError.d.ts +7 -0
- package/esm/typings/errors/PromptbookNotFoundError.d.ts +7 -0
- package/esm/typings/errors/PromptbookReferenceError.d.ts +7 -0
- package/esm/typings/errors/PromptbookSyntaxError.d.ts +7 -0
- package/esm/typings/errors/TemplateError.d.ts +9 -0
- package/esm/typings/errors/UnexpectedError.d.ts +7 -0
- package/esm/typings/errors/_ExpectError.d.ts +10 -0
- package/esm/typings/execution/CommonExecutionToolsOptions.d.ts +9 -0
- package/esm/typings/execution/ExecutionTools.d.ts +32 -0
- package/esm/typings/execution/LlmExecutionTools.d.ts +50 -0
- package/esm/typings/execution/PromptResult.d.ts +103 -0
- package/esm/typings/execution/PromptbookExecutor.d.ts +42 -0
- package/esm/typings/execution/ScriptExecutionTools.d.ts +38 -0
- package/esm/typings/execution/UserInterfaceTools.d.ts +46 -0
- package/esm/typings/execution/addPromptResultUsage.test.d.ts +1 -0
- package/esm/typings/execution/assertsExecutionSuccessful.d.ts +11 -0
- package/esm/typings/execution/createPromptbookExecutor.d.ts +42 -0
- package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +43 -0
- package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +8 -0
- package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/anthropic-claude-models.d.ts +20 -0
- package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/playground/playground.d.ts +2 -0
- package/esm/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools.d.ts +42 -0
- package/esm/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +35 -0
- package/esm/typings/execution/plugins/llm-execution-tools/azure-openai/playground/playground.d.ts +2 -0
- package/esm/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools.d.ts +7 -0
- package/esm/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
- package/esm/typings/execution/plugins/llm-execution-tools/langtail/playground/playground.d.ts +2 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts +28 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts +25 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts +14 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.test.d.ts +1 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/faked-completion.test.d.ts +1 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/joker.test.d.ts +4 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
- package/esm/typings/execution/plugins/llm-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
- package/esm/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionTools.d.ts +37 -0
- package/esm/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionToolsOptions.d.ts +24 -0
- package/esm/typings/execution/plugins/llm-execution-tools/multiple/playground/playground.d.ts +2 -0
- package/esm/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +47 -0
- package/esm/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +18 -0
- package/esm/typings/execution/plugins/llm-execution-tools/openai/computeOpenaiUsage.d.ts +12 -0
- package/esm/typings/execution/plugins/llm-execution-tools/openai/computeUsage.d.ts +16 -0
- package/esm/typings/execution/plugins/llm-execution-tools/openai/computeUsage.test.d.ts +1 -0
- package/esm/typings/execution/plugins/llm-execution-tools/openai/openai-models.d.ts +26 -0
- package/esm/typings/execution/plugins/llm-execution-tools/openai/playground/playground.d.ts +2 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts +42 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionToolsOptions.d.ts +24 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +28 -0
- package/esm/typings/execution/plugins/llm-execution-tools/remote/startRemoteServer.d.ts +18 -0
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +7 -0
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
- package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
- package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/unknownToString.d.ts +7 -0
- package/esm/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +16 -0
- package/esm/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
- package/esm/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +16 -0
- package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +15 -0
- package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
- package/esm/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +17 -0
- package/esm/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
- package/esm/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
- package/esm/typings/execution/utils/addUsage.d.ts +7 -0
- package/esm/typings/execution/utils/addUsage.test.d.ts +1 -0
- package/esm/typings/execution/utils/checkExpectations.d.ts +25 -0
- package/esm/typings/execution/utils/checkExpectations.test.d.ts +1 -0
- package/esm/typings/execution/utils/computeUsageCounts.d.ts +10 -0
- package/esm/typings/execution/utils/forEachAsync.d.ts +18 -0
- package/esm/typings/execution/utils/replaceParameters.d.ts +13 -0
- package/esm/typings/execution/utils/replaceParameters.test.d.ts +1 -0
- package/esm/typings/execution/utils/uncertainNumber.d.ts +9 -0
- package/esm/typings/execution/utils/usageToWorktime.d.ts +10 -0
- package/esm/typings/execution/utils/usageToWorktime.test.d.ts +1 -0
- package/esm/typings/library/PromptbookLibrary.d.ts +25 -0
- package/esm/typings/library/SimplePromptbookLibrary.d.ts +36 -0
- package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +43 -0
- package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.test.d.ts +1 -0
- package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +23 -0
- package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.test.d.ts +1 -0
- package/esm/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +13 -0
- package/esm/typings/library/constructors/createPromptbookLibraryFromSources.test.d.ts +1 -0
- package/esm/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +26 -0
- package/esm/typings/library/constructors/createPromptbookSublibrary.d.ts +12 -0
- package/esm/typings/library/constructors/justTestFsImport.d.ts +7 -0
- package/esm/typings/types/Command.d.ts +101 -0
- package/esm/typings/types/ExecutionTypes.d.ts +13 -0
- package/esm/typings/types/ModelRequirements.d.ts +43 -0
- package/esm/typings/types/Parameters.d.ts +14 -0
- package/esm/typings/types/Prompt.d.ts +57 -0
- package/esm/typings/types/PromptbookJson/PromptTemplateJson.d.ts +145 -0
- package/esm/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +26 -0
- package/esm/typings/types/PromptbookJson/PromptbookJson.d.ts +53 -0
- package/esm/typings/types/PromptbookString.d.ts +12 -0
- package/esm/typings/types/ScriptLanguage.d.ts +9 -0
- package/esm/typings/types/TaskProgress.d.ts +43 -0
- package/esm/typings/types/execution-report/ExecutionReportJson.d.ts +58 -0
- package/esm/typings/types/execution-report/ExecutionReportString.d.ts +16 -0
- package/esm/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
- package/esm/typings/types/execution-report/config.d.ts +8 -0
- package/esm/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
- package/esm/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
- package/esm/typings/types/execution-report/executionReportJsonToString.d.ts +11 -0
- package/esm/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -0
- package/esm/typings/types/typeAliasEmoji.d.ts +9 -0
- package/esm/typings/types/typeAliases.d.ts +430 -0
- package/esm/typings/utils/FromtoItems.d.ts +19 -0
- package/esm/typings/utils/emojis.d.ts +22 -0
- package/esm/typings/utils/expectation-counters/countCharacters.d.ts +5 -0
- package/esm/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -0
- package/esm/typings/utils/expectation-counters/countLines.d.ts +5 -0
- package/esm/typings/utils/expectation-counters/countLines.test.d.ts +1 -0
- package/esm/typings/utils/expectation-counters/countPages.d.ts +5 -0
- package/esm/typings/utils/expectation-counters/countPages.test.d.ts +1 -0
- package/esm/typings/utils/expectation-counters/countParagraphs.d.ts +5 -0
- package/esm/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
- package/esm/typings/utils/expectation-counters/countSentences.d.ts +9 -0
- package/esm/typings/utils/expectation-counters/countSentences.test.d.ts +1 -0
- package/esm/typings/utils/expectation-counters/countWords.d.ts +5 -0
- package/esm/typings/utils/expectation-counters/countWords.test.d.ts +1 -0
- package/esm/typings/utils/expectation-counters/index.d.ts +6 -0
- package/esm/typings/utils/extractParameters.d.ts +9 -0
- package/esm/typings/utils/extractParameters.test.d.ts +1 -0
- package/esm/typings/utils/formatNumber.d.ts +6 -0
- package/esm/typings/utils/formatNumber.test.d.ts +1 -0
- package/esm/typings/utils/getCurrentIsoDate.d.ts +7 -0
- package/esm/typings/utils/isRunningInWhatever.d.ts +12 -0
- package/esm/typings/utils/isValidJsonString.d.ts +4 -0
- package/esm/typings/utils/isValidJsonString.test.d.ts +1 -0
- package/esm/typings/utils/just.d.ts +10 -0
- package/esm/typings/utils/markdown/addAutoGeneratedSection.d.ts +11 -0
- package/esm/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/esm/typings/utils/markdown/createMarkdownChart.d.ts +41 -0
- package/esm/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
- package/esm/typings/utils/markdown/createMarkdownTable.d.ts +8 -0
- package/esm/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
- package/esm/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
- package/esm/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
- package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
- package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
- package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +14 -0
- package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
- package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
- package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
- package/esm/typings/utils/markdown/prettifyMarkdown.d.ts +8 -0
- package/esm/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
- package/esm/typings/utils/markdown/removeContentComments.d.ts +9 -0
- package/esm/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
- package/esm/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
- package/esm/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
- package/esm/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
- package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
- package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
- package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
- package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
- package/esm/typings/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
- package/esm/typings/utils/normalization/IKeywords.d.ts +18 -0
- package/esm/typings/utils/normalization/capitalize.d.ts +5 -0
- package/esm/typings/utils/normalization/capitalize.test.d.ts +1 -0
- package/esm/typings/utils/normalization/decapitalize.d.ts +5 -0
- package/esm/typings/utils/normalization/decapitalize.test.d.ts +1 -0
- package/esm/typings/utils/normalization/isValidKeyword.d.ts +8 -0
- package/esm/typings/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriPart.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriParts.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalize-to-kebab-case.d.ts +1 -0
- package/esm/typings/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_PascalCase.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +4 -0
- package/esm/typings/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_camelCase.d.ts +4 -0
- package/esm/typings/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/esm/typings/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/esm/typings/utils/normalization/parseKeywords.d.ts +14 -0
- package/esm/typings/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/esm/typings/utils/normalization/parseKeywordsFromString.d.ts +8 -0
- package/esm/typings/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/esm/typings/utils/normalization/removeDiacritics.d.ts +4 -0
- package/esm/typings/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/esm/typings/utils/normalization/searchKeywords.d.ts +5 -0
- package/esm/typings/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/esm/typings/utils/postprocessing/extractBlock.d.ts +12 -0
- package/esm/typings/utils/removeEmojis.d.ts +7 -0
- package/esm/typings/utils/removeEmojis.test.d.ts +1 -0
- package/esm/typings/utils/removeQuotes.d.ts +13 -0
- package/esm/typings/utils/removeQuotes.test.d.ts +1 -0
- package/esm/typings/utils/sets/difference.d.ts +4 -0
- package/esm/typings/utils/sets/difference.test.d.ts +1 -0
- package/esm/typings/utils/sets/intersection.d.ts +4 -0
- package/esm/typings/utils/sets/intersection.test.d.ts +1 -0
- package/esm/typings/utils/sets/union.d.ts +4 -0
- package/esm/typings/utils/sets/union.test.d.ts +1 -0
- package/esm/typings/utils/trimCodeBlock.d.ts +8 -0
- package/esm/typings/utils/trimCodeBlock.test.d.ts +1 -0
- package/esm/typings/utils/trimEndOfCodeBlock.d.ts +7 -0
- package/esm/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -0
- package/esm/typings/utils/unwrapResult.d.ts +36 -0
- package/esm/typings/utils/unwrapResult.test.d.ts +1 -0
- package/esm/typings/utils/validators/url/isValidUrl.d.ts +7 -0
- package/esm/typings/utils/validators/url/isValidUrl.test.d.ts +1 -0
- package/esm/typings/version.d.ts +5 -0
- package/package.json +56 -0
- package/umd/index.umd.js +2501 -0
- package/umd/index.umd.js.map +1 -0
- package/umd/typings/_packages/anthropic-claude.index.d.ts +5 -0
- package/umd/typings/_packages/azure-openai.index.d.ts +5 -0
- package/umd/typings/_packages/cli.index.d.ts +10 -0
- package/umd/typings/_packages/core.index.d.ts +41 -0
- package/umd/typings/_packages/execute-javascript.index.d.ts +48 -0
- package/umd/typings/_packages/fake-llm.index.d.ts +7 -0
- package/umd/typings/_packages/langtail.index.d.ts +5 -0
- package/umd/typings/_packages/node.index.d.ts +4 -0
- package/umd/typings/_packages/openai.index.d.ts +6 -0
- package/umd/typings/_packages/remote-client.index.d.ts +6 -0
- package/umd/typings/_packages/remote-server.index.d.ts +5 -0
- package/umd/typings/_packages/types.index.d.ts +28 -0
- package/umd/typings/_packages/utils.index.d.ts +71 -0
- package/umd/typings/config.d.ts +8 -0
- package/umd/typings/conversion/prettify/PrettifyOptions.d.ts +13 -0
- package/umd/typings/conversion/prettify/prettifyPromptbookString.d.ts +10 -0
- package/umd/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -0
- package/umd/typings/conversion/prettify/renderPromptbookMermaid.d.ts +25 -0
- package/umd/typings/conversion/promptbookJsonToString.d.ts +12 -0
- package/umd/typings/conversion/promptbookStringToJson.d.ts +15 -0
- package/umd/typings/conversion/promptbookStringToJson.test.d.ts +1 -0
- package/umd/typings/conversion/utils/extractParametersFromPromptTemplate.d.ts +13 -0
- package/umd/typings/conversion/utils/extractParametersFromPromptTemplate.test.d.ts +1 -0
- package/umd/typings/conversion/utils/extractVariables.d.ts +13 -0
- package/umd/typings/conversion/utils/extractVariables.test.d.ts +1 -0
- package/umd/typings/conversion/utils/parseCommand.d.ts +11 -0
- package/umd/typings/conversion/utils/parseCommand.test.d.ts +4 -0
- package/umd/typings/conversion/utils/parseNumber.d.ts +15 -0
- package/umd/typings/conversion/utils/parseNumber.test.d.ts +1 -0
- package/umd/typings/conversion/utils/renameParameter.d.ts +25 -0
- package/umd/typings/conversion/utils/renameParameter.test.d.ts +1 -0
- package/umd/typings/conversion/utils/titleToName.d.ts +4 -0
- package/umd/typings/conversion/utils/titleToName.test.d.ts +1 -0
- package/umd/typings/conversion/validation/_importPromptbook.d.ts +13 -0
- package/umd/typings/conversion/validation/promptbookStringToJson-syntaxErrors.test.d.ts +1 -0
- package/umd/typings/conversion/validation/validatePromptbookJson-logicErrors.test.d.ts +1 -0
- package/umd/typings/conversion/validation/validatePromptbookJson.d.ts +27 -0
- package/umd/typings/conversion/validation/validatePromptbookJson.test.d.ts +1 -0
- package/umd/typings/errors/PromptbookExecutionError.d.ts +7 -0
- package/umd/typings/errors/PromptbookLibraryError.d.ts +7 -0
- package/umd/typings/errors/PromptbookLogicError.d.ts +7 -0
- package/umd/typings/errors/PromptbookNotFoundError.d.ts +7 -0
- package/umd/typings/errors/PromptbookReferenceError.d.ts +7 -0
- package/umd/typings/errors/PromptbookSyntaxError.d.ts +7 -0
- package/umd/typings/errors/TemplateError.d.ts +9 -0
- package/umd/typings/errors/UnexpectedError.d.ts +7 -0
- package/umd/typings/errors/_ExpectError.d.ts +10 -0
- package/umd/typings/execution/CommonExecutionToolsOptions.d.ts +9 -0
- package/umd/typings/execution/ExecutionTools.d.ts +32 -0
- package/umd/typings/execution/LlmExecutionTools.d.ts +50 -0
- package/umd/typings/execution/PromptResult.d.ts +103 -0
- package/umd/typings/execution/PromptbookExecutor.d.ts +42 -0
- package/umd/typings/execution/ScriptExecutionTools.d.ts +38 -0
- package/umd/typings/execution/UserInterfaceTools.d.ts +46 -0
- package/umd/typings/execution/addPromptResultUsage.test.d.ts +1 -0
- package/umd/typings/execution/assertsExecutionSuccessful.d.ts +11 -0
- package/umd/typings/execution/createPromptbookExecutor.d.ts +42 -0
- package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +43 -0
- package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +8 -0
- package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/anthropic-claude-models.d.ts +20 -0
- package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/playground/playground.d.ts +2 -0
- package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools.d.ts +42 -0
- package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +35 -0
- package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/playground/playground.d.ts +2 -0
- package/umd/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools.d.ts +7 -0
- package/umd/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
- package/umd/typings/execution/plugins/llm-execution-tools/langtail/playground/playground.d.ts +2 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts +28 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts +25 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts +14 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.test.d.ts +1 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/faked-completion.test.d.ts +1 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/joker.test.d.ts +4 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
- package/umd/typings/execution/plugins/llm-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
- package/umd/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionTools.d.ts +37 -0
- package/umd/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionToolsOptions.d.ts +24 -0
- package/umd/typings/execution/plugins/llm-execution-tools/multiple/playground/playground.d.ts +2 -0
- package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +47 -0
- package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +18 -0
- package/umd/typings/execution/plugins/llm-execution-tools/openai/computeOpenaiUsage.d.ts +12 -0
- package/umd/typings/execution/plugins/llm-execution-tools/openai/computeUsage.d.ts +16 -0
- package/umd/typings/execution/plugins/llm-execution-tools/openai/computeUsage.test.d.ts +1 -0
- package/umd/typings/execution/plugins/llm-execution-tools/openai/openai-models.d.ts +26 -0
- package/umd/typings/execution/plugins/llm-execution-tools/openai/playground/playground.d.ts +2 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts +42 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionToolsOptions.d.ts +24 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +28 -0
- package/umd/typings/execution/plugins/llm-execution-tools/remote/startRemoteServer.d.ts +18 -0
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +7 -0
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
- package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
- package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/unknownToString.d.ts +7 -0
- package/umd/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +16 -0
- package/umd/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
- package/umd/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +16 -0
- package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +15 -0
- package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
- package/umd/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +17 -0
- package/umd/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
- package/umd/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
- package/umd/typings/execution/utils/addUsage.d.ts +7 -0
- package/umd/typings/execution/utils/addUsage.test.d.ts +1 -0
- package/umd/typings/execution/utils/checkExpectations.d.ts +25 -0
- package/umd/typings/execution/utils/checkExpectations.test.d.ts +1 -0
- package/umd/typings/execution/utils/computeUsageCounts.d.ts +10 -0
- package/umd/typings/execution/utils/forEachAsync.d.ts +18 -0
- package/umd/typings/execution/utils/replaceParameters.d.ts +13 -0
- package/umd/typings/execution/utils/replaceParameters.test.d.ts +1 -0
- package/umd/typings/execution/utils/uncertainNumber.d.ts +9 -0
- package/umd/typings/execution/utils/usageToWorktime.d.ts +10 -0
- package/umd/typings/execution/utils/usageToWorktime.test.d.ts +1 -0
- package/umd/typings/library/PromptbookLibrary.d.ts +25 -0
- package/umd/typings/library/SimplePromptbookLibrary.d.ts +36 -0
- package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +43 -0
- package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.test.d.ts +1 -0
- package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +23 -0
- package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.test.d.ts +1 -0
- package/umd/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +13 -0
- package/umd/typings/library/constructors/createPromptbookLibraryFromSources.test.d.ts +1 -0
- package/umd/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +26 -0
- package/umd/typings/library/constructors/createPromptbookSublibrary.d.ts +12 -0
- package/umd/typings/library/constructors/justTestFsImport.d.ts +7 -0
- package/umd/typings/types/Command.d.ts +101 -0
- package/umd/typings/types/ExecutionTypes.d.ts +13 -0
- package/umd/typings/types/ModelRequirements.d.ts +43 -0
- package/umd/typings/types/Parameters.d.ts +14 -0
- package/umd/typings/types/Prompt.d.ts +57 -0
- package/umd/typings/types/PromptbookJson/PromptTemplateJson.d.ts +145 -0
- package/umd/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +26 -0
- package/umd/typings/types/PromptbookJson/PromptbookJson.d.ts +53 -0
- package/umd/typings/types/PromptbookString.d.ts +12 -0
- package/umd/typings/types/ScriptLanguage.d.ts +9 -0
- package/umd/typings/types/TaskProgress.d.ts +43 -0
- package/umd/typings/types/execution-report/ExecutionReportJson.d.ts +58 -0
- package/umd/typings/types/execution-report/ExecutionReportString.d.ts +16 -0
- package/umd/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
- package/umd/typings/types/execution-report/config.d.ts +8 -0
- package/umd/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
- package/umd/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
- package/umd/typings/types/execution-report/executionReportJsonToString.d.ts +11 -0
- package/umd/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -0
- package/umd/typings/types/typeAliasEmoji.d.ts +9 -0
- package/umd/typings/types/typeAliases.d.ts +430 -0
- package/umd/typings/utils/FromtoItems.d.ts +19 -0
- package/umd/typings/utils/emojis.d.ts +22 -0
- package/umd/typings/utils/expectation-counters/countCharacters.d.ts +5 -0
- package/umd/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -0
- package/umd/typings/utils/expectation-counters/countLines.d.ts +5 -0
- package/umd/typings/utils/expectation-counters/countLines.test.d.ts +1 -0
- package/umd/typings/utils/expectation-counters/countPages.d.ts +5 -0
- package/umd/typings/utils/expectation-counters/countPages.test.d.ts +1 -0
- package/umd/typings/utils/expectation-counters/countParagraphs.d.ts +5 -0
- package/umd/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
- package/umd/typings/utils/expectation-counters/countSentences.d.ts +9 -0
- package/umd/typings/utils/expectation-counters/countSentences.test.d.ts +1 -0
- package/umd/typings/utils/expectation-counters/countWords.d.ts +5 -0
- package/umd/typings/utils/expectation-counters/countWords.test.d.ts +1 -0
- package/umd/typings/utils/expectation-counters/index.d.ts +6 -0
- package/umd/typings/utils/extractParameters.d.ts +9 -0
- package/umd/typings/utils/extractParameters.test.d.ts +1 -0
- package/umd/typings/utils/formatNumber.d.ts +6 -0
- package/umd/typings/utils/formatNumber.test.d.ts +1 -0
- package/umd/typings/utils/getCurrentIsoDate.d.ts +7 -0
- package/umd/typings/utils/isRunningInWhatever.d.ts +12 -0
- package/umd/typings/utils/isValidJsonString.d.ts +4 -0
- package/umd/typings/utils/isValidJsonString.test.d.ts +1 -0
- package/umd/typings/utils/just.d.ts +10 -0
- package/umd/typings/utils/markdown/addAutoGeneratedSection.d.ts +11 -0
- package/umd/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/umd/typings/utils/markdown/createMarkdownChart.d.ts +41 -0
- package/umd/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
- package/umd/typings/utils/markdown/createMarkdownTable.d.ts +8 -0
- package/umd/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
- package/umd/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
- package/umd/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
- package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
- package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
- package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +14 -0
- package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
- package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
- package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
- package/umd/typings/utils/markdown/prettifyMarkdown.d.ts +8 -0
- package/umd/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
- package/umd/typings/utils/markdown/removeContentComments.d.ts +9 -0
- package/umd/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
- package/umd/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
- package/umd/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
- package/umd/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
- package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
- package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
- package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
- package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
- package/umd/typings/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
- package/umd/typings/utils/normalization/IKeywords.d.ts +18 -0
- package/umd/typings/utils/normalization/capitalize.d.ts +5 -0
- package/umd/typings/utils/normalization/capitalize.test.d.ts +1 -0
- package/umd/typings/utils/normalization/decapitalize.d.ts +5 -0
- package/umd/typings/utils/normalization/decapitalize.test.d.ts +1 -0
- package/umd/typings/utils/normalization/isValidKeyword.d.ts +8 -0
- package/umd/typings/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriPart.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriParts.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalize-to-kebab-case.d.ts +1 -0
- package/umd/typings/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_PascalCase.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +4 -0
- package/umd/typings/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_camelCase.d.ts +4 -0
- package/umd/typings/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/umd/typings/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/umd/typings/utils/normalization/parseKeywords.d.ts +14 -0
- package/umd/typings/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/umd/typings/utils/normalization/parseKeywordsFromString.d.ts +8 -0
- package/umd/typings/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/umd/typings/utils/normalization/removeDiacritics.d.ts +4 -0
- package/umd/typings/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/umd/typings/utils/normalization/searchKeywords.d.ts +5 -0
- package/umd/typings/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/umd/typings/utils/postprocessing/extractBlock.d.ts +12 -0
- package/umd/typings/utils/removeEmojis.d.ts +7 -0
- package/umd/typings/utils/removeEmojis.test.d.ts +1 -0
- package/umd/typings/utils/removeQuotes.d.ts +13 -0
- package/umd/typings/utils/removeQuotes.test.d.ts +1 -0
- package/umd/typings/utils/sets/difference.d.ts +4 -0
- package/umd/typings/utils/sets/difference.test.d.ts +1 -0
- package/umd/typings/utils/sets/intersection.d.ts +4 -0
- package/umd/typings/utils/sets/intersection.test.d.ts +1 -0
- package/umd/typings/utils/sets/union.d.ts +4 -0
- package/umd/typings/utils/sets/union.test.d.ts +1 -0
- package/umd/typings/utils/trimCodeBlock.d.ts +8 -0
- package/umd/typings/utils/trimCodeBlock.test.d.ts +1 -0
- package/umd/typings/utils/trimEndOfCodeBlock.d.ts +7 -0
- package/umd/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -0
- package/umd/typings/utils/unwrapResult.d.ts +36 -0
- package/umd/typings/utils/unwrapResult.test.d.ts +1 -0
- package/umd/typings/utils/validators/url/isValidUrl.d.ts +7 -0
- package/umd/typings/utils/validators/url/isValidUrl.test.d.ts +1 -0
- package/umd/typings/version.d.ts +5 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { string_javascript_name } from '../../../../types/typeAliases';
|
|
3
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Options for javascript execution
|
|
6
|
+
*/
|
|
7
|
+
export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
+
/**
|
|
9
|
+
* Functions to be executed in the JavaScript evaluation.
|
|
10
|
+
*
|
|
11
|
+
* This can be used in two ways:
|
|
12
|
+
* 1. To provide custom postprocessing functions. For this case function must receive one string and return a (promise of) string.
|
|
13
|
+
* 2. As environment for the ECECUTE SCRIPT, For this case function can be any function. [0]
|
|
14
|
+
*
|
|
15
|
+
* Note: There are also some built-in functions available:
|
|
16
|
+
* @see ./JavascriptEvalExecutionTools.ts
|
|
17
|
+
*/
|
|
18
|
+
functions?: Record<string_javascript_name, PostprocessingFunction>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Function that can be used to postprocess the output of the LLM
|
|
22
|
+
*/
|
|
23
|
+
export type PostprocessingFunction = ((value: string) => Promisable<string>) | Function;
|
|
24
|
+
/**
|
|
25
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
26
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does nothing, but preserves the function in the bundle
|
|
3
|
+
* Compiler is tricked into thinking the function is used
|
|
4
|
+
*
|
|
5
|
+
* @param value any function to preserve
|
|
6
|
+
* @returns nothing
|
|
7
|
+
*/
|
|
8
|
+
export declare function preserve(func: (...params: Array<any>) => unknown): void;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: !! [1] This maybe does memory leak
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
2
|
+
import type { ScriptExecutionTools } from '../../../ScriptExecutionTools';
|
|
3
|
+
import type { ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
4
|
+
/**
|
|
5
|
+
* ScriptExecutionTools for Python
|
|
6
|
+
*
|
|
7
|
+
* Warning: This is not implemented yet
|
|
8
|
+
*/
|
|
9
|
+
export declare class PythonExecutionTools implements ScriptExecutionTools {
|
|
10
|
+
private readonly options;
|
|
11
|
+
constructor(options: CommonExecutionToolsOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Executes a Python
|
|
14
|
+
*/
|
|
15
|
+
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
16
|
+
}
|
package/umd/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
2
|
+
import type { ScriptExecutionTools } from '../../../ScriptExecutionTools';
|
|
3
|
+
import type { ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
4
|
+
/**
|
|
5
|
+
* ScriptExecutionTools for TypeScript
|
|
6
|
+
*
|
|
7
|
+
* Warning: This is not implemented yet
|
|
8
|
+
*/
|
|
9
|
+
export declare class TypescriptExecutionTools implements ScriptExecutionTools {
|
|
10
|
+
private readonly options;
|
|
11
|
+
constructor(options: CommonExecutionToolsOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Executes a TypeScript
|
|
14
|
+
*/
|
|
15
|
+
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { UserInterfaceTools } from '../../../UserInterfaceTools';
|
|
2
|
+
import type { UserInterfaceToolsPromptDialogOptions } from '../../../UserInterfaceTools';
|
|
3
|
+
import type { CallbackInterfaceToolsOptions } from './CallbackInterfaceToolsOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Delagates the user interaction to a async callback function
|
|
6
|
+
* You need to provide your own implementation of this callback function and its bind to UI.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CallbackInterfaceTools implements UserInterfaceTools {
|
|
9
|
+
private readonly options;
|
|
10
|
+
constructor(options: CallbackInterfaceToolsOptions);
|
|
11
|
+
/**
|
|
12
|
+
* Trigger the custom callback function
|
|
13
|
+
*/
|
|
14
|
+
promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
3
|
+
import type { UserInterfaceToolsPromptDialogOptions } from '../../../UserInterfaceTools';
|
|
4
|
+
/**
|
|
5
|
+
* Options for CallbackInterfaceTools
|
|
6
|
+
*/
|
|
7
|
+
export type CallbackInterfaceToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
+
/**
|
|
9
|
+
* The callback function to be called when promptDialog is called
|
|
10
|
+
*/
|
|
11
|
+
callback(prompt: UserInterfaceToolsPromptDialogOptions): Promisable<string>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
2
|
+
import type { UserInterfaceTools } from '../../../UserInterfaceTools';
|
|
3
|
+
import type { UserInterfaceToolsPromptDialogOptions } from '../../../UserInterfaceTools';
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper around `window.prompt` synchronous function that interacts with the user via browser prompt
|
|
6
|
+
*
|
|
7
|
+
* Warning: It is used for testing and mocking
|
|
8
|
+
* **NOT intended to use in the production** due to its synchronous nature.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SimplePromptInterfaceTools implements UserInterfaceTools {
|
|
11
|
+
private readonly options;
|
|
12
|
+
constructor(options: CommonExecutionToolsOptions);
|
|
13
|
+
/**
|
|
14
|
+
* Trigger window.PROMPT DIALOG
|
|
15
|
+
*/
|
|
16
|
+
promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AutomaticTranslator } from './AutomaticTranslator';
|
|
2
|
+
/**
|
|
3
|
+
* This will wrap an automatic translator and log each translation into the console
|
|
4
|
+
*/
|
|
5
|
+
export declare class DebugAutomaticTranslator implements AutomaticTranslator {
|
|
6
|
+
private readonly automaticTranslator;
|
|
7
|
+
constructor(automaticTranslator: AutomaticTranslator);
|
|
8
|
+
translate(message: string): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AutomaticTranslator } from './AutomaticTranslator';
|
|
2
|
+
import type { TranslatorOptions } from './TranslatorOptions';
|
|
3
|
+
interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
|
|
4
|
+
apiUrl: URL;
|
|
5
|
+
}
|
|
6
|
+
export declare class LindatAutomaticTranslator implements AutomaticTranslator {
|
|
7
|
+
private readonly options;
|
|
8
|
+
constructor(options: LindatAutomaticTranslatorOptions);
|
|
9
|
+
translate(message: string): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AutomaticTranslator } from './automatic-translators/AutomaticTranslator';
|
|
2
|
+
import type { TranslatorOptions } from './automatic-translators/TranslatorOptions';
|
|
3
|
+
export declare function translateMessages({ automaticTranslator, from, to, }: {
|
|
4
|
+
automaticTranslator: AutomaticTranslator;
|
|
5
|
+
} & TranslatorOptions): Promise<void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PromptResultUsage } from '../PromptResult';
|
|
2
|
+
/**
|
|
3
|
+
* Function `addUsage` will add multiple usages into one
|
|
4
|
+
*
|
|
5
|
+
* Note: If you provide 0 values, it returns void usage
|
|
6
|
+
*/
|
|
7
|
+
export declare function addUsage(...usageItems: Array<PromptResultUsage>): PromptResultUsage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Expectations } from '../../types/PromptbookJson/PromptTemplateJson';
|
|
2
|
+
/**
|
|
3
|
+
* Function checkExpectations will check if the expectations on given value are met
|
|
4
|
+
*
|
|
5
|
+
* Note: There are two simmilar functions:
|
|
6
|
+
* - `checkExpectations` which throws an error if the expectations are not met
|
|
7
|
+
* - `isPassingExpectations` which returns a boolean
|
|
8
|
+
*
|
|
9
|
+
* @throws {ExpectError} if the expectations are not met
|
|
10
|
+
* @returns {void} Nothing
|
|
11
|
+
*/
|
|
12
|
+
export declare function checkExpectations(expectations: Expectations, value: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Function checkExpectations will check if the expectations on given value are met
|
|
15
|
+
*
|
|
16
|
+
* Note: There are two simmilar functions:
|
|
17
|
+
* - `checkExpectations` which throws an error if the expectations are not met
|
|
18
|
+
* - `isPassingExpectations` which returns a boolean
|
|
19
|
+
*
|
|
20
|
+
* @returns {boolean} True if the expectations are met
|
|
21
|
+
*/
|
|
22
|
+
export declare function isPassingExpectations(expectations: Expectations, value: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* TODO: [💝] Unite object for expecting amount and format
|
|
25
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PromptResultUsageCounts } from '../PromptResult';
|
|
2
|
+
/**
|
|
3
|
+
* Helper of usage compute
|
|
4
|
+
*
|
|
5
|
+
* @param content the content of prompt or response
|
|
6
|
+
* @returns part of PromptResultUsageCounts
|
|
7
|
+
*
|
|
8
|
+
* @private internal util of LlmExecutionTools
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeUsageCounts(content: string): Omit<PromptResultUsageCounts, 'tokensCount'>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
type ForEachAsyncOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Maximum number of tasks running in parallel
|
|
5
|
+
*
|
|
6
|
+
* @default Infinity
|
|
7
|
+
*/
|
|
8
|
+
inParallelCount?: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Async version of Array.forEach
|
|
12
|
+
*
|
|
13
|
+
* @param array - Array to iterate over
|
|
14
|
+
* @param options - Options for the function
|
|
15
|
+
* @param callbackfunction - Function to call for each item
|
|
16
|
+
*/
|
|
17
|
+
export declare function forEachAsync<TItem>(array: Array<TItem>, options: ForEachAsyncOptions, callbackfunction: (value: TItem, index: number, array: Array<TItem>) => Promisable<void>): Promise<void>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Parameters } from '../../types/Parameters';
|
|
2
|
+
import type { string_template } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Replaces parameters in template with values from parameters object
|
|
5
|
+
*
|
|
6
|
+
* @param template the template with parameters in {curly} braces
|
|
7
|
+
* @param parameters the object with parameters
|
|
8
|
+
* @returns the template with replaced parameters
|
|
9
|
+
* @throws {TemplateError} if parameter is not defined, not closed, or not opened
|
|
10
|
+
*
|
|
11
|
+
* @private within the createPromptbookExecutor
|
|
12
|
+
*/
|
|
13
|
+
export declare function replaceParameters(template: string_template, parameters: Parameters): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UncertainNumber } from '../PromptResult';
|
|
2
|
+
/**
|
|
3
|
+
* Make UncertainNumber
|
|
4
|
+
*
|
|
5
|
+
* @param value
|
|
6
|
+
*
|
|
7
|
+
* @private utility for initializating UncertainNumber
|
|
8
|
+
*/
|
|
9
|
+
export declare function uncertainNumber(value?: number | typeof NaN | undefined | null): UncertainNumber;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PromptResultUsage } from '../PromptResult';
|
|
2
|
+
import type { UncertainNumber } from '../PromptResult';
|
|
3
|
+
/**
|
|
4
|
+
* Function usageToWorktime will take usage and estimate saved worktime in hours of reading / writing
|
|
5
|
+
*
|
|
6
|
+
* Note: This is an estimate based of theese sources:
|
|
7
|
+
* - https://jecas.cz/doba-cteni
|
|
8
|
+
* - https://www.originalnitonery.cz/blog/psani-vsemi-deseti-se-muzete-naucit-i-sami-doma
|
|
9
|
+
*/
|
|
10
|
+
export declare function usageToWorktime(usage: PromptResultUsage): UncertainNumber;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { Prompt } from '../types/Prompt';
|
|
3
|
+
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
4
|
+
import type { string_promptbook_url } from '../types/typeAliases';
|
|
5
|
+
/**
|
|
6
|
+
* Library of promptbooks that groups together promptbooks for an application.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/webgptorg/promptbook#promptbook-library
|
|
9
|
+
*/
|
|
10
|
+
export type PromptbookLibrary = {
|
|
11
|
+
/**
|
|
12
|
+
* Gets all promptbooks in the library
|
|
13
|
+
*/
|
|
14
|
+
listPromptbooks(): Promisable<Array<string_promptbook_url>>;
|
|
15
|
+
/**
|
|
16
|
+
* Gets promptbook by its URL
|
|
17
|
+
*
|
|
18
|
+
* Note: This is not a direct fetching from the URL, but a lookup in the library
|
|
19
|
+
*/
|
|
20
|
+
getPromptbookByUrl(url: string_promptbook_url): Promisable<PromptbookJson>;
|
|
21
|
+
/**
|
|
22
|
+
* Checks whether given prompt was defined in any promptbook in the library
|
|
23
|
+
*/
|
|
24
|
+
isResponsibleForPrompt(prompt: Prompt): Promisable<boolean>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Prompt } from '../types/Prompt';
|
|
2
|
+
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
3
|
+
import type { string_promptbook_url } from '../types/typeAliases';
|
|
4
|
+
import type { PromptbookLibrary } from './PromptbookLibrary';
|
|
5
|
+
/**
|
|
6
|
+
* Library of promptbooks that groups together promptbooks for an application.
|
|
7
|
+
* This implementation is a very thin wrapper around the Array / Map of promptbooks.
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/webgptorg/promptbook#promptbook-library
|
|
10
|
+
*/
|
|
11
|
+
export declare class SimplePromptbookLibrary implements PromptbookLibrary {
|
|
12
|
+
private library;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a promptbook library from promptbooks
|
|
15
|
+
*
|
|
16
|
+
* @param promptbooks !!!
|
|
17
|
+
*
|
|
18
|
+
* Note: During the construction logic of all promptbooks are validated
|
|
19
|
+
* Note: It is not recommended to use this constructor directly, use `createPromptbookLibraryFromSources` *(or other variant)* instead
|
|
20
|
+
*/
|
|
21
|
+
constructor(...promptbooks: Array<PromptbookJson>);
|
|
22
|
+
/**
|
|
23
|
+
* Gets all promptbooks in the library
|
|
24
|
+
*/
|
|
25
|
+
listPromptbooks(): Array<string_promptbook_url>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets promptbook by its URL
|
|
28
|
+
*
|
|
29
|
+
* Note: This is not a direct fetching from the URL, but a lookup in the library
|
|
30
|
+
*/
|
|
31
|
+
getPromptbookByUrl(url: string_promptbook_url): PromptbookJson;
|
|
32
|
+
/**
|
|
33
|
+
* Checks whether given prompt was defined in any promptbook in the library
|
|
34
|
+
*/
|
|
35
|
+
isResponsibleForPrompt(prompt: Prompt): boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { string_folder_path } from '../../types/typeAliases';
|
|
2
|
+
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
+
/**
|
|
4
|
+
* Options for `createPromptbookLibraryFromDirectory` function
|
|
5
|
+
*/
|
|
6
|
+
type CreatePromptbookLibraryFromDirectoryOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* If true, the directory is searched recursively for promptbooks
|
|
9
|
+
*
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
isRecursive?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If true, the library creation outputs information about each file it reads
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
isVerbose?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, directory will be scanned only when needed not during the construction
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
isLazyLoaded?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If true, whole library creation crashes on error in any promptbook
|
|
27
|
+
* If true and isLazyLoaded is true, the error is thrown on first access to the promptbook
|
|
28
|
+
*
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
isCrashOnError?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Constructs Promptbook from given directory
|
|
35
|
+
*
|
|
36
|
+
* Note: Works only in Node.js environment because it reads the file system
|
|
37
|
+
*
|
|
38
|
+
* @param path - path to the directory with promptbooks
|
|
39
|
+
* @param options - Misc options for the library
|
|
40
|
+
* @returns PromptbookLibrary
|
|
41
|
+
*/
|
|
42
|
+
export declare function createPromptbookLibraryFromDirectory(path: string_folder_path, options?: CreatePromptbookLibraryFromDirectoryOptions): Promise<PromptbookLibrary>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
+
import type { PromptbookString } from '../../types/PromptbookString';
|
|
3
|
+
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
4
|
+
/**
|
|
5
|
+
* Constructs Promptbook from async sources
|
|
6
|
+
* It can be one of the following:
|
|
7
|
+
* - Promise of array of PromptbookJson or PromptbookString
|
|
8
|
+
* - Factory function that returns Promise of array of PromptbookJson or PromptbookString
|
|
9
|
+
*
|
|
10
|
+
* Note: This is useful as internal tool for other constructor functions like
|
|
11
|
+
* `createPromptbookLibraryFromUrl` or `createPromptbookLibraryFromDirectory`
|
|
12
|
+
* Consider using those functions instead of this one
|
|
13
|
+
*
|
|
14
|
+
* Note: The function does NOT return promise it returns the library directly which waits for the sources to be resolved
|
|
15
|
+
* when error occurs in given promise or factory function, it is thrown during `listPromptbooks` or `getPromptbookByUrl` call
|
|
16
|
+
*
|
|
17
|
+
* Note: Consider using `createPromptbookLibraryFromDirectory` or `createPromptbookLibraryFromUrl`
|
|
18
|
+
*
|
|
19
|
+
* @param promptbookSourcesPromiseOrFactory
|
|
20
|
+
* @returns PromptbookLibrary
|
|
21
|
+
* @private Just internal tool for other constructor functions
|
|
22
|
+
*/
|
|
23
|
+
export declare function createPromptbookLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson | PromptbookString>> | (() => Promise<Array<PromptbookJson | PromptbookString>>)): PromptbookLibrary;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
+
import type { PromptbookString } from '../../types/PromptbookString';
|
|
3
|
+
import { SimplePromptbookLibrary } from '../SimplePromptbookLibrary';
|
|
4
|
+
/**
|
|
5
|
+
* Creates PromptbookLibrary from array of PromptbookJson or PromptbookString
|
|
6
|
+
*
|
|
7
|
+
* Note: You can combine `PromptbookString` (`.ptbk.md`) with `PromptbookJson` BUT it is not recommended
|
|
8
|
+
* Note: During the construction syntax and logic of all sources are validated
|
|
9
|
+
*
|
|
10
|
+
* @param promptbookSources
|
|
11
|
+
* @returns PromptbookLibrary
|
|
12
|
+
*/
|
|
13
|
+
export declare function createPromptbookLibraryFromSources(...promptbookSources: Array<PromptbookJson | PromptbookString>): SimplePromptbookLibrary;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { string_url } from '../../types/typeAliases';
|
|
2
|
+
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
+
/**
|
|
4
|
+
* Options for `createPromptbookLibraryFromDirectory` function
|
|
5
|
+
*/
|
|
6
|
+
type CreatePromptbookLibraryFromUrlyOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* If true, the library creation outputs information about each file it reads
|
|
9
|
+
*
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
isVerbose?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If true, directory will be scanned only when needed not during the construction
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
isLazyLoaded?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Constructs Promptbook from remote Promptbase URL
|
|
22
|
+
|
|
23
|
+
* @returns PromptbookLibrary
|
|
24
|
+
*/
|
|
25
|
+
export declare function createPromptbookLibraryFromUrl(url: string_url | URL, options: CreatePromptbookLibraryFromUrlyOptions): Promise<PromptbookLibrary>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { string_promptbook_url } from '../../types/typeAliases';
|
|
2
|
+
import type { PromptbookLibrary } from '../PromptbookLibrary';
|
|
3
|
+
/**
|
|
4
|
+
* Creates PromptbookLibrary as a subset of another PromptbookLibrary
|
|
5
|
+
*
|
|
6
|
+
* Note: You can use any type of library as a parent library - local, remote, etc.
|
|
7
|
+
* Note: This is just a thin wrapper / proxy around the parent library
|
|
8
|
+
*
|
|
9
|
+
* @param promptbookSources
|
|
10
|
+
* @returns PromptbookLibrary
|
|
11
|
+
*/
|
|
12
|
+
export declare function createPromptbookSublibrary(library: PromptbookLibrary, predicate: (url: string_promptbook_url) => boolean): PromptbookLibrary;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { string_markdown_text } from './typeAliases';
|
|
2
|
+
import type { string_name } from './typeAliases';
|
|
3
|
+
import type { string_version } from './typeAliases';
|
|
4
|
+
import type { ExecutionType } from './ExecutionTypes';
|
|
5
|
+
import type { ModelRequirements } from './ModelRequirements';
|
|
6
|
+
import type { ExpectationAmount } from './PromptbookJson/PromptTemplateJson';
|
|
7
|
+
import type { ExpectationUnit } from './PromptbookJson/PromptTemplateJson';
|
|
8
|
+
/**
|
|
9
|
+
* Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
|
|
10
|
+
* It is parsed from the markdown from ul/ol items - one command per one item.
|
|
11
|
+
*/
|
|
12
|
+
export type Command = PromptbookUrlCommand | PromptbookVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
13
|
+
/**
|
|
14
|
+
* PromptbookVersion command tells which version is .promptbook file using
|
|
15
|
+
*
|
|
16
|
+
* - It is used for backward compatibility
|
|
17
|
+
* - It is defined per whole .promptbook file in the header
|
|
18
|
+
*/
|
|
19
|
+
export type PromptbookUrlCommand = {
|
|
20
|
+
readonly type: 'PROMPTBOOK_URL';
|
|
21
|
+
readonly promptbookUrl: URL;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* PromptbookVersion command tells which version is .promptbook file using
|
|
25
|
+
*
|
|
26
|
+
* - It is used for backward compatibility
|
|
27
|
+
* - It is defined per whole .promptbook file in the header
|
|
28
|
+
*/
|
|
29
|
+
export type PromptbookVersionCommand = {
|
|
30
|
+
readonly type: 'PROMPTBOOK_VERSION';
|
|
31
|
+
readonly promptbookVersion: string_version;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Execute command tells how to execute the section
|
|
35
|
+
* It can be either prompt template, script or SIMPLE TEMPLATE etc.
|
|
36
|
+
*/
|
|
37
|
+
export type ExecuteCommand = {
|
|
38
|
+
readonly type: 'EXECUTE';
|
|
39
|
+
readonly executionType: ExecutionType;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Model command tells which model and modelRequirements to use for the prompt template. execution
|
|
43
|
+
*/
|
|
44
|
+
export type ModelCommand = {
|
|
45
|
+
readonly type: 'MODEL';
|
|
46
|
+
readonly key: keyof ModelRequirements;
|
|
47
|
+
readonly value: any;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Joker parameter is used instead of executing the prompt template if it meet the expectations requirements
|
|
51
|
+
*/
|
|
52
|
+
export type JokerCommand = {
|
|
53
|
+
readonly type: 'JOKER';
|
|
54
|
+
readonly parameterName: string_name;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Parameter command describes one parameter of the prompt template
|
|
58
|
+
*
|
|
59
|
+
* - It can tell if it is input or OUTPUT PARAMETER
|
|
60
|
+
* - It can have description
|
|
61
|
+
* - In description it can have simple formatting BUT not markdown structure or reference to other parameters
|
|
62
|
+
*/
|
|
63
|
+
export type ParameterCommand = {
|
|
64
|
+
readonly type: 'PARAMETER';
|
|
65
|
+
readonly isInput: boolean;
|
|
66
|
+
readonly isOutput: boolean;
|
|
67
|
+
readonly parameterName: string_name;
|
|
68
|
+
readonly parameterDescription: string_markdown_text | null;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Postprocess command describes which function to use for postprocessing
|
|
72
|
+
* This will be created as separate EXECUTE SCRIPT block bellow
|
|
73
|
+
*/
|
|
74
|
+
export type PostprocessCommand = {
|
|
75
|
+
readonly type: 'POSTPROCESS';
|
|
76
|
+
readonly functionName: string_name;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Expect command describes the desired output of the prompt template (after post-processing)
|
|
80
|
+
* It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs or some other shape of the output.
|
|
81
|
+
*/
|
|
82
|
+
export type ExpectCommand = ExpectAmountCommand | ExpectFormatCommand;
|
|
83
|
+
/**
|
|
84
|
+
* Expect amount command describes the desired output of the prompt template (after post-processing)
|
|
85
|
+
* It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs,...
|
|
86
|
+
*
|
|
87
|
+
* Note: LLMs work with tokens, not characters, but in Promptbooks we want to use some human-recognisable and cross-model interoperable units.
|
|
88
|
+
*/
|
|
89
|
+
export type ExpectAmountCommand = {
|
|
90
|
+
readonly type: 'EXPECT_AMOUNT';
|
|
91
|
+
readonly sign: 'EXACTLY' | 'MINIMUM' | 'MAXIMUM';
|
|
92
|
+
readonly unit: ExpectationUnit;
|
|
93
|
+
readonly amount: ExpectationAmount;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Represents a command that expects a specific format.
|
|
97
|
+
*/
|
|
98
|
+
export type ExpectFormatCommand = {
|
|
99
|
+
readonly type: 'EXPECT_FORMAT';
|
|
100
|
+
readonly format: 'JSON';
|
|
101
|
+
};
|