@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,13 @@
|
|
|
1
|
+
import type { TupleToUnion } from 'type-fest';
|
|
2
|
+
/**
|
|
3
|
+
* Execution type describes the way how the block is executed
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/webgptorg/promptbook#execution-type
|
|
6
|
+
*/
|
|
7
|
+
export type ExecutionType = TupleToUnion<typeof ExecutionTypes>;
|
|
8
|
+
/**
|
|
9
|
+
* Execution type describes the way how the block is executed
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/webgptorg/promptbook#execution-type
|
|
12
|
+
*/
|
|
13
|
+
export declare const ExecutionTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT", "PROMPT_DIALOG"];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { string_model_name } from './typeAliases';
|
|
2
|
+
export declare const MODEL_VARIANTS: readonly ["COMPLETION", "CHAT"];
|
|
3
|
+
/**
|
|
4
|
+
* Model variant describes the very general type of the model
|
|
5
|
+
*
|
|
6
|
+
* There are two variants:
|
|
7
|
+
* - **COMPLETION** - model that takes prompt and writes the rest of the text
|
|
8
|
+
* - **CHAT** - model that takes prompt and previous messages and returns response
|
|
9
|
+
*/
|
|
10
|
+
export type ModelVariant = typeof MODEL_VARIANTS[number];
|
|
11
|
+
/**
|
|
12
|
+
* Abstract way to specify the LLM. It does not specify the LLM with concrete version itself, only the requirements for the LLM.
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/webgptorg/promptbook#model-requirements
|
|
15
|
+
*/
|
|
16
|
+
export type ModelRequirements = {
|
|
17
|
+
/**
|
|
18
|
+
* Model variant describes the very general type of the model
|
|
19
|
+
*
|
|
20
|
+
* There are two variants:
|
|
21
|
+
* - **COMPLETION** - model that takes prompt and writes the rest of the text
|
|
22
|
+
* - **CHAT** - model that takes prompt and previous messages and returns response
|
|
23
|
+
*/
|
|
24
|
+
readonly modelVariant: ModelVariant;
|
|
25
|
+
/**
|
|
26
|
+
* The model for text prompt
|
|
27
|
+
*
|
|
28
|
+
* Note: Model must be compatible with the model variant
|
|
29
|
+
* Note: If not specified, the best model for the variant will be used
|
|
30
|
+
*
|
|
31
|
+
* @example 'gpt-4', 'gpt-4-32k-0314', 'gpt-3.5-turbo-instruct',...
|
|
32
|
+
*/
|
|
33
|
+
readonly modelName?: string_model_name;
|
|
34
|
+
/**
|
|
35
|
+
* Maximum number of tokens that can be generated by the model
|
|
36
|
+
*/
|
|
37
|
+
readonly maxTokens?: number;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* TODO: Maybe figure out better word than "variant"
|
|
41
|
+
* TODO: Add here more requirement options like max context size, max tokens, etc.
|
|
42
|
+
* TODO: [👙][🧠] Just selecting gpt3 or gpt4 level of model
|
|
43
|
+
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters of the prompt template (pipeline)
|
|
3
|
+
*
|
|
4
|
+
* There are three types of parameters:
|
|
5
|
+
* - **INPUT PARAMETERs** are required to execute the pipeline.
|
|
6
|
+
* - **Intermediate parameters** are used internally in the pipeline.
|
|
7
|
+
* - **OUTPUT PARAMETERs** are not used internally in the pipeline, but are returned as the result of the pipeline execution.
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/webgptorg/promptbook#parameters
|
|
10
|
+
*/
|
|
11
|
+
export type Parameters = object;
|
|
12
|
+
/**
|
|
13
|
+
* TODO: Constrain type to Simple key-value object, only string keys and string values and no index signature + only camelCase keys and spaceTrimmed values
|
|
14
|
+
*/
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { string_name } from './typeAliases';
|
|
2
|
+
import type { string_prompt } from './typeAliases';
|
|
3
|
+
import type { string_promptbook_url_with_hashtemplate } from './typeAliases';
|
|
4
|
+
import type { string_title } from './typeAliases';
|
|
5
|
+
import type { PostprocessingFunction } from '../execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions';
|
|
6
|
+
import type { ModelRequirements } from './ModelRequirements';
|
|
7
|
+
import type { Expectations } from './PromptbookJson/PromptTemplateJson';
|
|
8
|
+
/**
|
|
9
|
+
* Prompt in a text along with model requirements, but without any execution or templating logic.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/webgptorg/promptbook#prompt
|
|
12
|
+
*/
|
|
13
|
+
export type Prompt = {
|
|
14
|
+
/**
|
|
15
|
+
* The title of the prompt
|
|
16
|
+
*
|
|
17
|
+
* Note: This has no effect on the model, it is just for the reporting
|
|
18
|
+
*/
|
|
19
|
+
readonly title: string_title;
|
|
20
|
+
/**
|
|
21
|
+
* The text of the prompt
|
|
22
|
+
*
|
|
23
|
+
* Note: This is not a template, this is exactly the text that will be sent to the model
|
|
24
|
+
* @example "What is the capital of France?"
|
|
25
|
+
*/
|
|
26
|
+
readonly content: string_prompt;
|
|
27
|
+
/**
|
|
28
|
+
* Requirements for the model
|
|
29
|
+
*/
|
|
30
|
+
readonly modelRequirements: ModelRequirements;
|
|
31
|
+
/**
|
|
32
|
+
* List of postprocessing steps that are executed after the prompt
|
|
33
|
+
*/
|
|
34
|
+
readonly postprocessing?: Array<PostprocessingFunction>;
|
|
35
|
+
/**
|
|
36
|
+
* Expectations for the answer
|
|
37
|
+
*
|
|
38
|
+
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
39
|
+
* If not set, nothing is expected from the answer
|
|
40
|
+
*/
|
|
41
|
+
readonly expectations?: Expectations;
|
|
42
|
+
/**
|
|
43
|
+
* Unique identifier of the promptbook with specific template name as hash
|
|
44
|
+
*
|
|
45
|
+
* @example https://promptbook.webgpt.com/cs/write-website-content.ptbk.md#keywords
|
|
46
|
+
*/
|
|
47
|
+
readonly promptbookUrl: string_promptbook_url_with_hashtemplate;
|
|
48
|
+
/**
|
|
49
|
+
* Parameters used in the prompt
|
|
50
|
+
*
|
|
51
|
+
* Note: This is redundant (same information is in promptbookUrl+content) but useful for logging and debugging
|
|
52
|
+
*/
|
|
53
|
+
readonly parameters: Record<string_name, string>;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* TODO: [✔] Check ModelRequirements in runtime
|
|
57
|
+
*/
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { ExpectFormatCommand } from '../Command';
|
|
2
|
+
import type { ExecutionType } from '../ExecutionTypes';
|
|
3
|
+
import type { ModelRequirements } from '../ModelRequirements';
|
|
4
|
+
import type { ScriptLanguage } from '../ScriptLanguage';
|
|
5
|
+
import type { number_integer } from '../typeAliases';
|
|
6
|
+
import type { number_positive } from '../typeAliases';
|
|
7
|
+
import type { string_javascript } from '../typeAliases';
|
|
8
|
+
import type { string_javascript_name } from '../typeAliases';
|
|
9
|
+
import type { string_markdown } from '../typeAliases';
|
|
10
|
+
import type { string_markdown_text } from '../typeAliases';
|
|
11
|
+
import type { string_name } from '../typeAliases';
|
|
12
|
+
import type { string_prompt } from '../typeAliases';
|
|
13
|
+
import type { string_template } from '../typeAliases';
|
|
14
|
+
/**
|
|
15
|
+
* Describes one prompt template in the promptbook
|
|
16
|
+
*/
|
|
17
|
+
export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptJson | PromptDialogJson;
|
|
18
|
+
/**
|
|
19
|
+
* Template for prompt to LLM
|
|
20
|
+
*/
|
|
21
|
+
export type LlmTemplateJson = PromptTemplateJsonCommon & {
|
|
22
|
+
readonly executionType: 'PROMPT_TEMPLATE';
|
|
23
|
+
/**
|
|
24
|
+
* Requirements for the model
|
|
25
|
+
* - This is required only for executionType PROMPT_TEMPLATE
|
|
26
|
+
*/
|
|
27
|
+
readonly modelRequirements: ModelRequirements;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Expect this amount of each unit in the answer
|
|
31
|
+
*
|
|
32
|
+
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
33
|
+
*
|
|
34
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
35
|
+
*/
|
|
36
|
+
export type Expectations = Partial<Record<Lowercase<ExpectationUnit>, {
|
|
37
|
+
min?: ExpectationAmount;
|
|
38
|
+
max?: ExpectationAmount;
|
|
39
|
+
}>>;
|
|
40
|
+
/**
|
|
41
|
+
* Units of text measurement
|
|
42
|
+
*/
|
|
43
|
+
export declare const EXPECTATION_UNITS: readonly ["CHARACTERS", "WORDS", "SENTENCES", "LINES", "PARAGRAPHS", "PAGES"];
|
|
44
|
+
/**
|
|
45
|
+
* Unit of text measurement
|
|
46
|
+
*/
|
|
47
|
+
export type ExpectationUnit = typeof EXPECTATION_UNITS[number];
|
|
48
|
+
/**
|
|
49
|
+
* Amount of text measurement
|
|
50
|
+
*/
|
|
51
|
+
export type ExpectationAmount = number_integer & (number_positive | 0);
|
|
52
|
+
/**
|
|
53
|
+
* Template for simple concatenation of strings
|
|
54
|
+
*/
|
|
55
|
+
export interface SimpleTemplateJson extends PromptTemplateJsonCommon {
|
|
56
|
+
readonly executionType: 'SIMPLE_TEMPLATE';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Template for script execution
|
|
60
|
+
*/
|
|
61
|
+
export interface ScriptJson extends PromptTemplateJsonCommon {
|
|
62
|
+
readonly executionType: 'SCRIPT';
|
|
63
|
+
/**
|
|
64
|
+
* Language of the script
|
|
65
|
+
* - This is required only for executionType SCRIPT
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
readonly contentLanguage?: ScriptLanguage;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Template for prompt to user
|
|
72
|
+
*/
|
|
73
|
+
export interface PromptDialogJson extends PromptTemplateJsonCommon {
|
|
74
|
+
readonly executionType: 'PROMPT_DIALOG';
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Common properties of all prompt templates
|
|
78
|
+
*/
|
|
79
|
+
interface PromptTemplateJsonCommon {
|
|
80
|
+
/**
|
|
81
|
+
* Name of the template
|
|
82
|
+
* - It must be unique across the pipeline
|
|
83
|
+
* - It should start uppercase and contain letters and numbers
|
|
84
|
+
* - The promptbookUrl together with hash and name are used to identify the prompt template in the pipeline
|
|
85
|
+
*/
|
|
86
|
+
readonly name: string_name;
|
|
87
|
+
/**
|
|
88
|
+
* Title of the prompt template
|
|
89
|
+
* It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
90
|
+
*/
|
|
91
|
+
readonly title: string;
|
|
92
|
+
/**
|
|
93
|
+
* Description of the prompt template
|
|
94
|
+
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
95
|
+
*/
|
|
96
|
+
readonly description?: string_markdown_text;
|
|
97
|
+
/**
|
|
98
|
+
* List of parameter names that are used in the prompt template and must be defined before the prompt template is executed
|
|
99
|
+
*
|
|
100
|
+
* Note: Joker is one of the dependent parameters
|
|
101
|
+
*/
|
|
102
|
+
readonly dependentParameterNames: Array<string_name>;
|
|
103
|
+
/**
|
|
104
|
+
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
105
|
+
*/
|
|
106
|
+
readonly jokers?: Array<string>;
|
|
107
|
+
/**
|
|
108
|
+
* Type of the execution
|
|
109
|
+
* This determines if the prompt template is send to LLM, user or some scripting evaluation
|
|
110
|
+
*/
|
|
111
|
+
readonly executionType: ExecutionType;
|
|
112
|
+
/**
|
|
113
|
+
* Content of the template with {placeholders} for parameters
|
|
114
|
+
*/
|
|
115
|
+
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
|
|
116
|
+
/**
|
|
117
|
+
* List of postprocessing steps that are executed after the prompt template
|
|
118
|
+
*/
|
|
119
|
+
readonly postprocessing?: Array<string_javascript_name>;
|
|
120
|
+
/**
|
|
121
|
+
* Expect this amount of each unit in the answer
|
|
122
|
+
*
|
|
123
|
+
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
124
|
+
*
|
|
125
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
126
|
+
*/
|
|
127
|
+
readonly expectations?: Expectations;
|
|
128
|
+
/**
|
|
129
|
+
* Expect this format of the answer
|
|
130
|
+
*
|
|
131
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
132
|
+
* @deprecated [💝]
|
|
133
|
+
*/
|
|
134
|
+
readonly expectFormat?: ExpectFormatCommand['format'];
|
|
135
|
+
/**
|
|
136
|
+
* Name of the parameter that is the result of the prompt template
|
|
137
|
+
*/
|
|
138
|
+
readonly resultingParameterName: string_name;
|
|
139
|
+
}
|
|
140
|
+
export {};
|
|
141
|
+
/**
|
|
142
|
+
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
143
|
+
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
144
|
+
* TODO: [👙][🧠] Just selecting gpt3 or gpt4 level of model
|
|
145
|
+
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { string_markdown_text } from '../typeAliases';
|
|
2
|
+
import type { string_name } from '../typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Describes one parameter of the promptbook
|
|
5
|
+
*/
|
|
6
|
+
export type PromptTemplateParameterJson = {
|
|
7
|
+
/**
|
|
8
|
+
* Name of the parameter
|
|
9
|
+
* - It must be unique across the pipeline
|
|
10
|
+
* - It should start lowercase and contain letters and numbers
|
|
11
|
+
*/
|
|
12
|
+
readonly name: string_name;
|
|
13
|
+
/**
|
|
14
|
+
* The parameter is input of the pipeline
|
|
15
|
+
*/
|
|
16
|
+
readonly isInput: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The parameter is output of the pipeline
|
|
19
|
+
*/
|
|
20
|
+
readonly isOutput: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Description of the parameter
|
|
23
|
+
* - It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
24
|
+
*/
|
|
25
|
+
readonly description?: string_markdown_text;
|
|
26
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { string_markdown_text } from '../typeAliases';
|
|
2
|
+
import type { string_promptbook_url } from '../typeAliases';
|
|
3
|
+
import type { string_version } from '../typeAliases';
|
|
4
|
+
import type { PromptTemplateJson } from './PromptTemplateJson';
|
|
5
|
+
import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson';
|
|
6
|
+
/**
|
|
7
|
+
* Promptbook is the **core concept of this library**.
|
|
8
|
+
* It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
|
|
9
|
+
*
|
|
10
|
+
* @see https://github.com/webgptorg/promptbook#promptbook
|
|
11
|
+
*/
|
|
12
|
+
export type PromptbookJson = {
|
|
13
|
+
/**
|
|
14
|
+
* Unique identifier of the promptbook
|
|
15
|
+
*
|
|
16
|
+
* Note: It must be unique across all promptbooks libraries
|
|
17
|
+
* Note: It must use HTTPs URL
|
|
18
|
+
* Tip: You can do versioning in the URL
|
|
19
|
+
* For example: https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@1.0.0
|
|
20
|
+
* Warning: Do not hash part of the URL, hash part is used for identification of the prompt template in the pipeline
|
|
21
|
+
*/
|
|
22
|
+
readonly promptbookUrl?: string_promptbook_url;
|
|
23
|
+
/**
|
|
24
|
+
* Title of the promptbook
|
|
25
|
+
* -It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
26
|
+
*/
|
|
27
|
+
readonly title: string_markdown_text;
|
|
28
|
+
/**
|
|
29
|
+
* Version of the .ptbk.json file
|
|
30
|
+
*/
|
|
31
|
+
readonly promptbookVersion: string_version;
|
|
32
|
+
/**
|
|
33
|
+
* Description of the promptbook
|
|
34
|
+
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
35
|
+
*/
|
|
36
|
+
readonly description?: string_markdown_text;
|
|
37
|
+
/**
|
|
38
|
+
* Set of variables that are used across the pipeline
|
|
39
|
+
*/
|
|
40
|
+
readonly parameters: Array<PromptTemplateParameterJson>;
|
|
41
|
+
/**
|
|
42
|
+
* Sequence of prompt templates that are chained together to form a pipeline
|
|
43
|
+
*/
|
|
44
|
+
readonly promptTemplates: Array<PromptTemplateJson>;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* TODO: [🧠] Best format of this code?
|
|
48
|
+
* There must be possible to make
|
|
49
|
+
* - Branching
|
|
50
|
+
* - Loops
|
|
51
|
+
* - Paralelization
|
|
52
|
+
* - ...and more
|
|
53
|
+
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promptbook is the **core concept of this library**.
|
|
3
|
+
* It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/webgptorg/promptbook#promptbook
|
|
6
|
+
*/
|
|
7
|
+
export type PromptbookString = string & {
|
|
8
|
+
readonly _type: 'Promptbook';
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* TODO: !! Better validation (validatePromptbookString) or remove branded type and make it just string
|
|
12
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TupleToUnion } from 'type-fest';
|
|
2
|
+
/**
|
|
3
|
+
* Supported script languages
|
|
4
|
+
*/
|
|
5
|
+
export declare const SUPPORTED_SCRIPT_LANGUAGES: readonly ["javascript", "typescript", "python"];
|
|
6
|
+
/**
|
|
7
|
+
* Script language
|
|
8
|
+
*/
|
|
9
|
+
export type ScriptLanguage = TupleToUnion<typeof SUPPORTED_SCRIPT_LANGUAGES>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ExecutionType } from './ExecutionTypes';
|
|
2
|
+
import type { string_markdown_text } from './typeAliases';
|
|
3
|
+
import type { string_name } from './typeAliases';
|
|
4
|
+
/**
|
|
5
|
+
* TaskProgress represents the progress of a Promptbook execution.
|
|
6
|
+
*/
|
|
7
|
+
export type TaskProgress = {
|
|
8
|
+
/**
|
|
9
|
+
* The unique name of the task.
|
|
10
|
+
*
|
|
11
|
+
* Note: This is not supposed to be displayed to the user.
|
|
12
|
+
* It is used to identify the task in the code, for example as react key
|
|
13
|
+
*/
|
|
14
|
+
readonly name: string_name;
|
|
15
|
+
/**
|
|
16
|
+
* Title of the task.
|
|
17
|
+
*
|
|
18
|
+
* Note: This is supposed to be displayed to the user.
|
|
19
|
+
* Note: This is trimmed and stripped of HTML tags and emojis
|
|
20
|
+
*/
|
|
21
|
+
readonly title: string_markdown_text;
|
|
22
|
+
/**
|
|
23
|
+
* Does the task started?
|
|
24
|
+
*/
|
|
25
|
+
readonly isStarted: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Is task done?
|
|
28
|
+
*/
|
|
29
|
+
readonly isDone: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The type of the execution.
|
|
32
|
+
* Note: The Promptbook library reports everything, in the app level you can filter out the execution types that you don't want to show to the user.
|
|
33
|
+
*/
|
|
34
|
+
readonly executionType: ExecutionType;
|
|
35
|
+
/**
|
|
36
|
+
* The parameter name that is being processed.
|
|
37
|
+
*/
|
|
38
|
+
readonly parameterName: string_name;
|
|
39
|
+
/**
|
|
40
|
+
* The parameter value or null if the parameter is not yet processed.
|
|
41
|
+
*/
|
|
42
|
+
readonly parameterValue: string | null;
|
|
43
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PromptResult } from '../../execution/PromptResult';
|
|
2
|
+
import type { Prompt } from '../Prompt';
|
|
3
|
+
import type { string_markdown_text } from '../typeAliases';
|
|
4
|
+
import type { string_promptbook_url } from '../typeAliases';
|
|
5
|
+
import type { string_version } from '../typeAliases';
|
|
6
|
+
/**
|
|
7
|
+
* ExecutionReport is result of executing one promptbook
|
|
8
|
+
* It is kind of a variant of the promptbook usefull for debugging, logging and transparency for users.
|
|
9
|
+
*
|
|
10
|
+
* It can have 2 formats:
|
|
11
|
+
* - **.md file** created from the **JSON** format
|
|
12
|
+
* - _(this)_ **JSON** format
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/webgptorg/promptbook#execution-report
|
|
15
|
+
*/
|
|
16
|
+
export type ExecutionReportJson = {
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier of the promptbook from promptbook which was executed
|
|
19
|
+
*/
|
|
20
|
+
readonly promptbookUrl?: string_promptbook_url;
|
|
21
|
+
/**
|
|
22
|
+
* Title of from promptbook which was executed
|
|
23
|
+
*/
|
|
24
|
+
readonly title?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Version from promptbook which was executed
|
|
27
|
+
*/
|
|
28
|
+
readonly promptbookUsedVersion: string_version;
|
|
29
|
+
/**
|
|
30
|
+
* Version from promptbook which was requested by promptbook
|
|
31
|
+
*/
|
|
32
|
+
readonly promptbookRequestedVersion?: string_version;
|
|
33
|
+
/**
|
|
34
|
+
* Description of the promptbook which was executed
|
|
35
|
+
*/
|
|
36
|
+
readonly description?: string_markdown_text;
|
|
37
|
+
/**
|
|
38
|
+
* Sequence of prompt templates in order which were executed
|
|
39
|
+
*/
|
|
40
|
+
readonly promptExecutions: Array<{
|
|
41
|
+
/**
|
|
42
|
+
* The prompt wich was executed
|
|
43
|
+
*/
|
|
44
|
+
prompt: Omit<Prompt, 'promptbookUrl' | 'parameters'>;
|
|
45
|
+
/**
|
|
46
|
+
* Result of the prompt execution (if not failed during LLM execution)
|
|
47
|
+
*/
|
|
48
|
+
result?: PromptResult;
|
|
49
|
+
/**
|
|
50
|
+
* The error which occured during LLM execution or during postprocessing or expectation checking
|
|
51
|
+
*
|
|
52
|
+
* Note: It makes sense to have both error and result defined, for example when the result not pass expectations
|
|
53
|
+
*/
|
|
54
|
+
error?: {
|
|
55
|
+
message: string;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExecutionReport is result of executing one promptbook
|
|
3
|
+
* It is kind of a variant of the promptbook usefull for debugging, logging and transparency for users.
|
|
4
|
+
*
|
|
5
|
+
* It can have 2 formats:
|
|
6
|
+
* - _(this)_ **.md file** created from the **JSON** format
|
|
7
|
+
* - **JSON** format
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/webgptorg/promptbook#execution-report
|
|
10
|
+
*/
|
|
11
|
+
export type ExecutionReportString = string & {
|
|
12
|
+
readonly _type: 'ExecutionReportString';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* TODO: Better validation or remove branded type and make it just string
|
|
16
|
+
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { number_percent } from '../typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Options for generating an execution report string
|
|
4
|
+
*/
|
|
5
|
+
export type ExecutionReportStringOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* The tax rate to be applied, expressed as a percentage from 0 to 1 (=100%) or even more
|
|
8
|
+
*/
|
|
9
|
+
taxRate: number_percent;
|
|
10
|
+
/**
|
|
11
|
+
* The width of the charts in the report
|
|
12
|
+
*/
|
|
13
|
+
chartsWidth: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Default options for generating an execution report string
|
|
17
|
+
*/
|
|
18
|
+
export declare const ExecutionReportStringOptionsDefaults: {
|
|
19
|
+
taxRate: number;
|
|
20
|
+
chartsWidth: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExecutionReportJson } from './ExecutionReportJson';
|
|
2
|
+
import type { ExecutionReportString } from './ExecutionReportString';
|
|
3
|
+
import type { ExecutionReportStringOptions } from './ExecutionReportStringOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Converts execution report from JSON to string format
|
|
6
|
+
*/
|
|
7
|
+
export declare function executionReportJsonToString(executionReportJson: ExecutionReportJson, options?: Partial<ExecutionReportStringOptions>): ExecutionReportString;
|
|
8
|
+
/**
|
|
9
|
+
* TODO: Add mermaid chart for every report
|
|
10
|
+
* TODO: [🧠] Allow to filter out some parts of the report by options
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|