@promptbook/utils 0.41.0 → 0.41.2
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/bin/promptbook-cli.js +3 -0
- package/esm/index.es.js +794 -794
- package/esm/typings/_packages/core.index.d.ts +20 -20
- package/esm/typings/_packages/execute-javascript.index.d.ts +3 -3
- package/esm/typings/_packages/openai.index.d.ts +3 -3
- package/esm/typings/_packages/remote-client.index.d.ts +4 -4
- package/esm/typings/_packages/remote-server.index.d.ts +3 -3
- package/esm/typings/_packages/types.index.d.ts +27 -27
- package/esm/typings/_packages/utils.index.d.ts +30 -30
- package/esm/typings/_packages/wizzard.index.d.ts +5 -5
- package/esm/typings/config.d.ts +4 -4
- package/esm/typings/conversion/promptbookStringToJson.d.ts +13 -13
- package/esm/typings/conversion/test/_importPromptbook.d.ts +12 -12
- package/esm/typings/conversion/test/promptbookStringToJson-syntaxErrors.test.d.ts +1 -1
- package/esm/typings/conversion/test/promptbookStringToJson.test.d.ts +1 -1
- package/esm/typings/conversion/test/validatePromptbookJson-logicErrors.test.d.ts +1 -1
- package/esm/typings/conversion/test/validatePromptbookJson.d.ts +26 -26
- package/esm/typings/conversion/test/validatePromptbookJson.test.d.ts +1 -1
- package/esm/typings/conversion/utils/extractVariables.d.ts +10 -10
- package/esm/typings/conversion/utils/extractVariables.test.d.ts +1 -1
- package/esm/typings/conversion/utils/parseCommand.d.ts +8 -8
- package/esm/typings/conversion/utils/parseCommand.test.d.ts +4 -4
- package/esm/typings/conversion/utils/parseNumber.d.ts +12 -12
- package/esm/typings/conversion/utils/parseNumber.test.d.ts +1 -1
- package/esm/typings/errors/ExpectError.d.ts +9 -9
- package/esm/typings/errors/NotFoundError.d.ts +7 -7
- package/esm/typings/errors/PromptbookExecutionError.d.ts +7 -7
- package/esm/typings/errors/PromptbookLogicError.d.ts +7 -7
- package/esm/typings/errors/PromptbookReferenceError.d.ts +7 -7
- package/esm/typings/errors/PromptbookSyntaxError.d.ts +7 -7
- package/esm/typings/errors/UnexpectedError.d.ts +7 -7
- package/esm/typings/execution/CommonExecutionToolsOptions.d.ts +9 -9
- package/esm/typings/execution/ExecutionTools.d.ts +25 -25
- package/esm/typings/execution/NaturalExecutionTools.d.ts +23 -23
- package/esm/typings/execution/PromptResult.d.ts +74 -74
- package/esm/typings/execution/PromptbookExecutor.d.ts +39 -39
- package/esm/typings/execution/ScriptExecutionTools.d.ts +37 -37
- package/esm/typings/execution/UserInterfaceTools.d.ts +45 -45
- package/esm/typings/execution/assertsExecutionSuccessful.d.ts +11 -11
- package/esm/typings/execution/createPromptbookExecutor.d.ts +41 -41
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -22
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -4
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -4
- package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -4
- package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +28 -28
- package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -16
- package/esm/typings/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.d.ts +3 -3
- package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -35
- package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +23 -23
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -11
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -12
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -17
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -12
- package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -27
- package/esm/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts +17 -17
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -1
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -1
- package/esm/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -1
- package/esm/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -1
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -20
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -4
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -20
- package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -22
- package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -11
- package/esm/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -1
- package/esm/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -15
- package/esm/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -1
- package/esm/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -1
- package/esm/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -15
- package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -14
- package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -12
- package/esm/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -16
- package/esm/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -1
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -4
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -9
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -5
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -11
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -4
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
- package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -1
- package/esm/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -5
- package/esm/typings/execution/utils/replaceParameters.d.ts +12 -12
- package/esm/typings/execution/utils/replaceParameters.test.d.ts +1 -1
- package/esm/typings/library/PromptbookLibrary.d.ts +25 -25
- package/esm/typings/library/SimplePromptbookLibrary.d.ts +35 -35
- package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +5 -5
- package/esm/typings/library/constructors/createPromptbookLibraryFromList.d.ts +5 -5
- package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +7 -7
- package/esm/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +16 -16
- package/esm/typings/library/constructors/createPromptbookSublibrary.d.ts +6 -6
- package/esm/typings/types/Command.d.ts +98 -98
- package/esm/typings/types/ExecutionTypes.d.ts +13 -13
- package/esm/typings/types/ModelRequirements.d.ts +41 -41
- package/esm/typings/types/Parameters.d.ts +14 -14
- package/esm/typings/types/Prompt.d.ts +41 -41
- package/esm/typings/types/PromptbookJson/PromptTemplateJson.d.ts +126 -126
- package/esm/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -25
- package/esm/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -51
- package/esm/typings/types/PromptbookString.d.ts +12 -12
- package/esm/typings/types/ScriptLanguage.d.ts +9 -9
- package/esm/typings/types/TaskProgress.d.ts +42 -42
- package/esm/typings/types/execution-report/ExecutionReportJson.d.ts +56 -56
- package/esm/typings/types/execution-report/ExecutionReportString.d.ts +16 -16
- package/esm/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -21
- package/esm/typings/types/execution-report/config.d.ts +8 -8
- package/esm/typings/types/execution-report/countWorkingDuration.d.ts +7 -7
- package/esm/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -1
- package/esm/typings/types/execution-report/executionReportJsonToString.d.ts +11 -11
- package/esm/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -1
- package/esm/typings/types/typeAliasEmoji.d.ts +9 -9
- package/esm/typings/types/typeAliases.d.ts +432 -432
- package/esm/typings/utils/FromtoItems.d.ts +19 -19
- package/esm/typings/utils/emojis.d.ts +22 -22
- package/esm/typings/utils/expectation-counters/countCharacters.d.ts +5 -5
- package/esm/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countLines.d.ts +5 -5
- package/esm/typings/utils/expectation-counters/countLines.test.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countPages.d.ts +5 -5
- package/esm/typings/utils/expectation-counters/countPages.test.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countParagraphs.d.ts +5 -5
- package/esm/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countSentences.d.ts +5 -5
- package/esm/typings/utils/expectation-counters/countSentences.test.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/countWords.d.ts +5 -5
- package/esm/typings/utils/expectation-counters/countWords.test.d.ts +1 -1
- package/esm/typings/utils/expectation-counters/index.d.ts +5 -5
- package/esm/typings/utils/extractParameters.d.ts +10 -10
- package/esm/typings/utils/extractParameters.test.d.ts +1 -1
- package/esm/typings/utils/formatNumber.d.ts +6 -6
- package/esm/typings/utils/formatNumber.test.d.ts +1 -1
- package/esm/typings/utils/getCurrentIsoDate.d.ts +7 -7
- package/esm/typings/utils/isRunningInWhatever.d.ts +12 -12
- package/esm/typings/utils/isValidJsonString.d.ts +4 -4
- package/esm/typings/utils/isValidJsonString.test.d.ts +1 -1
- package/esm/typings/utils/just.d.ts +10 -10
- package/esm/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -10
- package/esm/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -1
- package/esm/typings/utils/markdown/createMarkdownChart.d.ts +41 -41
- package/esm/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -1
- package/esm/typings/utils/markdown/createMarkdownTable.d.ts +7 -7
- package/esm/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -1
- package/esm/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -6
- package/esm/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -1
- package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -27
- package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -1
- package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -13
- package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -1
- package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -19
- package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -1
- package/esm/typings/utils/markdown/prettifyMarkdown.d.ts +8 -8
- package/esm/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -1
- package/esm/typings/utils/markdown/removeContentComments.d.ts +8 -8
- package/esm/typings/utils/markdown/removeContentComments.test.d.ts +1 -1
- package/esm/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -8
- package/esm/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -1
- package/esm/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -25
- package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -7
- package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -1
- package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -13
- package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -1
- package/esm/typings/utils/postprocessing/extractBlock.d.ts +12 -12
- package/esm/typings/utils/removeEmojis.d.ts +7 -7
- package/esm/typings/utils/removeEmojis.test.d.ts +1 -1
- package/esm/typings/utils/removeQuotes.d.ts +13 -13
- package/esm/typings/utils/removeQuotes.test.d.ts +1 -1
- package/esm/typings/utils/trimCodeBlock.d.ts +8 -8
- package/esm/typings/utils/trimCodeBlock.test.d.ts +1 -1
- package/esm/typings/utils/trimEndOfCodeBlock.d.ts +7 -7
- package/esm/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -1
- package/esm/typings/utils/unwrapResult.d.ts +36 -36
- package/esm/typings/utils/unwrapResult.test.d.ts +1 -1
- package/esm/typings/utils/validators/url/isValidUrl.d.ts +7 -7
- package/esm/typings/utils/validators/url/isValidUrl.test.d.ts +1 -1
- package/esm/typings/version.d.ts +5 -5
- package/esm/typings/wizzard/Wizzard.d.ts +4 -4
- package/esm/typings/wizzard/sample.d.ts +6 -6
- package/package.json +4 -1
- package/umd/index.umd.js +794 -794
- package/umd/typings/_packages/core.index.d.ts +20 -20
- package/umd/typings/_packages/execute-javascript.index.d.ts +3 -3
- package/umd/typings/_packages/openai.index.d.ts +3 -3
- package/umd/typings/_packages/remote-client.index.d.ts +4 -4
- package/umd/typings/_packages/remote-server.index.d.ts +3 -3
- package/umd/typings/_packages/types.index.d.ts +27 -27
- package/umd/typings/_packages/utils.index.d.ts +30 -30
- package/umd/typings/_packages/wizzard.index.d.ts +5 -5
- package/umd/typings/config.d.ts +4 -4
- package/umd/typings/conversion/promptbookStringToJson.d.ts +13 -13
- package/umd/typings/conversion/test/_importPromptbook.d.ts +12 -12
- package/umd/typings/conversion/test/promptbookStringToJson-syntaxErrors.test.d.ts +1 -1
- package/umd/typings/conversion/test/promptbookStringToJson.test.d.ts +1 -1
- package/umd/typings/conversion/test/validatePromptbookJson-logicErrors.test.d.ts +1 -1
- package/umd/typings/conversion/test/validatePromptbookJson.d.ts +26 -26
- package/umd/typings/conversion/test/validatePromptbookJson.test.d.ts +1 -1
- package/umd/typings/conversion/utils/extractVariables.d.ts +10 -10
- package/umd/typings/conversion/utils/extractVariables.test.d.ts +1 -1
- package/umd/typings/conversion/utils/parseCommand.d.ts +8 -8
- package/umd/typings/conversion/utils/parseCommand.test.d.ts +4 -4
- package/umd/typings/conversion/utils/parseNumber.d.ts +12 -12
- package/umd/typings/conversion/utils/parseNumber.test.d.ts +1 -1
- package/umd/typings/errors/ExpectError.d.ts +9 -9
- package/umd/typings/errors/NotFoundError.d.ts +7 -7
- package/umd/typings/errors/PromptbookExecutionError.d.ts +7 -7
- package/umd/typings/errors/PromptbookLogicError.d.ts +7 -7
- package/umd/typings/errors/PromptbookReferenceError.d.ts +7 -7
- package/umd/typings/errors/PromptbookSyntaxError.d.ts +7 -7
- package/umd/typings/errors/UnexpectedError.d.ts +7 -7
- package/umd/typings/execution/CommonExecutionToolsOptions.d.ts +9 -9
- package/umd/typings/execution/ExecutionTools.d.ts +25 -25
- package/umd/typings/execution/NaturalExecutionTools.d.ts +23 -23
- package/umd/typings/execution/PromptResult.d.ts +74 -74
- package/umd/typings/execution/PromptbookExecutor.d.ts +39 -39
- package/umd/typings/execution/ScriptExecutionTools.d.ts +37 -37
- package/umd/typings/execution/UserInterfaceTools.d.ts +45 -45
- package/umd/typings/execution/assertsExecutionSuccessful.d.ts +11 -11
- package/umd/typings/execution/createPromptbookExecutor.d.ts +41 -41
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -22
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -4
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -4
- package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -4
- package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +28 -28
- package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -16
- package/umd/typings/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.d.ts +3 -3
- package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -35
- package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +23 -23
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -11
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -12
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -17
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -12
- package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -27
- package/umd/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts +17 -17
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -1
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -1
- package/umd/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -1
- package/umd/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -1
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -20
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -4
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -20
- package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -22
- package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -11
- package/umd/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -1
- package/umd/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -15
- package/umd/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -1
- package/umd/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -1
- package/umd/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -15
- package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -14
- package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -12
- package/umd/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -16
- package/umd/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -1
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -4
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -9
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -5
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -11
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -4
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
- package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -1
- package/umd/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -5
- package/umd/typings/execution/utils/replaceParameters.d.ts +12 -12
- package/umd/typings/execution/utils/replaceParameters.test.d.ts +1 -1
- package/umd/typings/library/PromptbookLibrary.d.ts +25 -25
- package/umd/typings/library/SimplePromptbookLibrary.d.ts +35 -35
- package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +5 -5
- package/umd/typings/library/constructors/createPromptbookLibraryFromList.d.ts +5 -5
- package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +7 -7
- package/umd/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +16 -16
- package/umd/typings/library/constructors/createPromptbookSublibrary.d.ts +6 -6
- package/umd/typings/types/Command.d.ts +98 -98
- package/umd/typings/types/ExecutionTypes.d.ts +13 -13
- package/umd/typings/types/ModelRequirements.d.ts +41 -41
- package/umd/typings/types/Parameters.d.ts +14 -14
- package/umd/typings/types/Prompt.d.ts +41 -41
- package/umd/typings/types/PromptbookJson/PromptTemplateJson.d.ts +126 -126
- package/umd/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -25
- package/umd/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -51
- package/umd/typings/types/PromptbookString.d.ts +12 -12
- package/umd/typings/types/ScriptLanguage.d.ts +9 -9
- package/umd/typings/types/TaskProgress.d.ts +42 -42
- package/umd/typings/types/execution-report/ExecutionReportJson.d.ts +56 -56
- package/umd/typings/types/execution-report/ExecutionReportString.d.ts +16 -16
- package/umd/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -21
- package/umd/typings/types/execution-report/config.d.ts +8 -8
- package/umd/typings/types/execution-report/countWorkingDuration.d.ts +7 -7
- package/umd/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -1
- package/umd/typings/types/execution-report/executionReportJsonToString.d.ts +11 -11
- package/umd/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -1
- package/umd/typings/types/typeAliasEmoji.d.ts +9 -9
- package/umd/typings/types/typeAliases.d.ts +432 -432
- package/umd/typings/utils/FromtoItems.d.ts +19 -19
- package/umd/typings/utils/emojis.d.ts +22 -22
- package/umd/typings/utils/expectation-counters/countCharacters.d.ts +5 -5
- package/umd/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countLines.d.ts +5 -5
- package/umd/typings/utils/expectation-counters/countLines.test.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countPages.d.ts +5 -5
- package/umd/typings/utils/expectation-counters/countPages.test.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countParagraphs.d.ts +5 -5
- package/umd/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countSentences.d.ts +5 -5
- package/umd/typings/utils/expectation-counters/countSentences.test.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/countWords.d.ts +5 -5
- package/umd/typings/utils/expectation-counters/countWords.test.d.ts +1 -1
- package/umd/typings/utils/expectation-counters/index.d.ts +5 -5
- package/umd/typings/utils/extractParameters.d.ts +10 -10
- package/umd/typings/utils/extractParameters.test.d.ts +1 -1
- package/umd/typings/utils/formatNumber.d.ts +6 -6
- package/umd/typings/utils/formatNumber.test.d.ts +1 -1
- package/umd/typings/utils/getCurrentIsoDate.d.ts +7 -7
- package/umd/typings/utils/isRunningInWhatever.d.ts +12 -12
- package/umd/typings/utils/isValidJsonString.d.ts +4 -4
- package/umd/typings/utils/isValidJsonString.test.d.ts +1 -1
- package/umd/typings/utils/just.d.ts +10 -10
- package/umd/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -10
- package/umd/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -1
- package/umd/typings/utils/markdown/createMarkdownChart.d.ts +41 -41
- package/umd/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -1
- package/umd/typings/utils/markdown/createMarkdownTable.d.ts +7 -7
- package/umd/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -1
- package/umd/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -6
- package/umd/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -1
- package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -27
- package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -1
- package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -13
- package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -1
- package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -19
- package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -1
- package/umd/typings/utils/markdown/prettifyMarkdown.d.ts +8 -8
- package/umd/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -1
- package/umd/typings/utils/markdown/removeContentComments.d.ts +8 -8
- package/umd/typings/utils/markdown/removeContentComments.test.d.ts +1 -1
- package/umd/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -8
- package/umd/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -1
- package/umd/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -25
- package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -7
- package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -1
- package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -13
- package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -1
- package/umd/typings/utils/postprocessing/extractBlock.d.ts +12 -12
- package/umd/typings/utils/removeEmojis.d.ts +7 -7
- package/umd/typings/utils/removeEmojis.test.d.ts +1 -1
- package/umd/typings/utils/removeQuotes.d.ts +13 -13
- package/umd/typings/utils/removeQuotes.test.d.ts +1 -1
- package/umd/typings/utils/trimCodeBlock.d.ts +8 -8
- package/umd/typings/utils/trimCodeBlock.test.d.ts +1 -1
- package/umd/typings/utils/trimEndOfCodeBlock.d.ts +7 -7
- package/umd/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -1
- package/umd/typings/utils/unwrapResult.d.ts +36 -36
- package/umd/typings/utils/unwrapResult.test.d.ts +1 -1
- package/umd/typings/utils/validators/url/isValidUrl.d.ts +7 -7
- package/umd/typings/utils/validators/url/isValidUrl.test.d.ts +1 -1
- package/umd/typings/version.d.ts +5 -5
- package/umd/typings/wizzard/Wizzard.d.ts +4 -4
- package/umd/typings/wizzard/sample.d.ts +6 -6
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
import { ExpectFormatCommand } from '../Command';
|
|
2
|
-
import { ExecutionType } from '../ExecutionTypes';
|
|
3
|
-
import { ModelRequirements } from '../ModelRequirements';
|
|
4
|
-
import { ScriptLanguage } from '../ScriptLanguage';
|
|
5
|
-
import { number_integer, number_positive_or_zero, string_javascript, string_javascript_name, string_markdown, string_name, string_prompt, string_template } from '../typeAliases';
|
|
6
|
-
/**
|
|
7
|
-
* Describes one prompt template in the promptbook
|
|
8
|
-
*/
|
|
9
|
-
export type PromptTemplateJson = NaturalTemplateJson | SimpleTemplateJson | ScriptTemplateJson | PromptDialogJson;
|
|
10
|
-
/**
|
|
11
|
-
* Template for prompt to LLM
|
|
12
|
-
*/
|
|
13
|
-
export type NaturalTemplateJson = PromptTemplateJsonCommon & {
|
|
14
|
-
readonly executionType: 'PROMPT_TEMPLATE';
|
|
15
|
-
/**
|
|
16
|
-
* Requirements for the model
|
|
17
|
-
* - This is required only for executionType PROMPT_TEMPLATE
|
|
18
|
-
*/
|
|
19
|
-
readonly modelRequirements: ModelRequirements;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Units of text measurement
|
|
23
|
-
*/
|
|
24
|
-
export declare const EXPECTATION_UNITS: readonly ["CHARACTERS", "WORDS", "SENTENCES", "PARAGRAPHS", "LINES", "PAGES"];
|
|
25
|
-
/**
|
|
26
|
-
* Unit of text measurement
|
|
27
|
-
*/
|
|
28
|
-
export type ExpectationUnit = typeof EXPECTATION_UNITS[number];
|
|
29
|
-
/**
|
|
30
|
-
* Amount of text measurement
|
|
31
|
-
*/
|
|
32
|
-
export type ExpectationAmount = number_integer & number_positive_or_zero;
|
|
33
|
-
/**
|
|
34
|
-
* Template for simple concatenation of strings
|
|
35
|
-
*/
|
|
36
|
-
interface SimpleTemplateJson extends PromptTemplateJsonCommon {
|
|
37
|
-
readonly executionType: 'SIMPLE_TEMPLATE';
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Template for script execution
|
|
41
|
-
*/
|
|
42
|
-
interface ScriptTemplateJson extends PromptTemplateJsonCommon {
|
|
43
|
-
readonly executionType: 'SCRIPT';
|
|
44
|
-
/**
|
|
45
|
-
* Language of the script
|
|
46
|
-
* - This is required only for executionType SCRIPT
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
readonly contentLanguage?: ScriptLanguage;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Template for prompt to user
|
|
53
|
-
*/
|
|
54
|
-
interface PromptDialogJson extends PromptTemplateJsonCommon {
|
|
55
|
-
readonly executionType: 'PROMPT_DIALOG';
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Common properties of all prompt templates
|
|
59
|
-
*/
|
|
60
|
-
interface PromptTemplateJsonCommon {
|
|
61
|
-
/**
|
|
62
|
-
* Name of the template
|
|
63
|
-
* - It must be unique across the pipeline
|
|
64
|
-
* - It should start uppercase and contain letters and numbers
|
|
65
|
-
* - The promptbookUrl together with hash and name are used to identify the prompt template in the pipeline
|
|
66
|
-
*/
|
|
67
|
-
readonly name: string_name;
|
|
68
|
-
/**
|
|
69
|
-
* Title of the prompt template
|
|
70
|
-
* It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
71
|
-
*/
|
|
72
|
-
readonly title: string;
|
|
73
|
-
/**
|
|
74
|
-
* Description of the prompt template
|
|
75
|
-
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
76
|
-
*/
|
|
77
|
-
readonly description?: string;
|
|
78
|
-
/**
|
|
79
|
-
* List of parameter names that are used in the prompt template and must be defined before the prompt template is executed
|
|
80
|
-
*
|
|
81
|
-
* Note: Joker is one of the dependent parameters
|
|
82
|
-
*/
|
|
83
|
-
readonly dependentParameterNames: Array<string_name>;
|
|
84
|
-
/**
|
|
85
|
-
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
86
|
-
*/
|
|
87
|
-
readonly jokers?: Array<string>;
|
|
88
|
-
/**
|
|
89
|
-
* Type of the execution
|
|
90
|
-
* This determines if the prompt template is send to LLM, user or some scripting evaluation
|
|
91
|
-
*/
|
|
92
|
-
readonly executionType: ExecutionType;
|
|
93
|
-
/**
|
|
94
|
-
* Content of the template with {placeholders} for parameters
|
|
95
|
-
*/
|
|
96
|
-
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
|
|
97
|
-
/**
|
|
98
|
-
* List of postprocessing steps that are executed after the prompt template
|
|
99
|
-
*/
|
|
100
|
-
readonly postprocessing?: Array<string_javascript_name>;
|
|
101
|
-
/**
|
|
102
|
-
* Expect this amount of each unit in the answer
|
|
103
|
-
*
|
|
104
|
-
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
105
|
-
*
|
|
106
|
-
* Note: Expectations are performed after all postprocessing steps
|
|
107
|
-
*/
|
|
108
|
-
readonly expectAmount?: Partial<Record<Lowercase<ExpectationUnit>, {
|
|
109
|
-
min?: ExpectationAmount;
|
|
110
|
-
max?: ExpectationAmount;
|
|
111
|
-
}>>;
|
|
112
|
-
/**
|
|
113
|
-
* Expect this format of the answer
|
|
114
|
-
*
|
|
115
|
-
* Note: Expectations are performed after all postprocessing steps
|
|
116
|
-
*/
|
|
117
|
-
readonly expectFormat?: ExpectFormatCommand['format'];
|
|
118
|
-
/**
|
|
119
|
-
* Name of the parameter that is the result of the prompt template
|
|
120
|
-
*/
|
|
121
|
-
readonly resultingParameterName: string_name;
|
|
122
|
-
}
|
|
123
|
-
export {};
|
|
124
|
-
/**
|
|
125
|
-
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
126
|
-
*/
|
|
1
|
+
import { ExpectFormatCommand } from '../Command';
|
|
2
|
+
import { ExecutionType } from '../ExecutionTypes';
|
|
3
|
+
import { ModelRequirements } from '../ModelRequirements';
|
|
4
|
+
import { ScriptLanguage } from '../ScriptLanguage';
|
|
5
|
+
import { number_integer, number_positive_or_zero, string_javascript, string_javascript_name, string_markdown, string_name, string_prompt, string_template } from '../typeAliases';
|
|
6
|
+
/**
|
|
7
|
+
* Describes one prompt template in the promptbook
|
|
8
|
+
*/
|
|
9
|
+
export type PromptTemplateJson = NaturalTemplateJson | SimpleTemplateJson | ScriptTemplateJson | PromptDialogJson;
|
|
10
|
+
/**
|
|
11
|
+
* Template for prompt to LLM
|
|
12
|
+
*/
|
|
13
|
+
export type NaturalTemplateJson = PromptTemplateJsonCommon & {
|
|
14
|
+
readonly executionType: 'PROMPT_TEMPLATE';
|
|
15
|
+
/**
|
|
16
|
+
* Requirements for the model
|
|
17
|
+
* - This is required only for executionType PROMPT_TEMPLATE
|
|
18
|
+
*/
|
|
19
|
+
readonly modelRequirements: ModelRequirements;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Units of text measurement
|
|
23
|
+
*/
|
|
24
|
+
export declare const EXPECTATION_UNITS: readonly ["CHARACTERS", "WORDS", "SENTENCES", "PARAGRAPHS", "LINES", "PAGES"];
|
|
25
|
+
/**
|
|
26
|
+
* Unit of text measurement
|
|
27
|
+
*/
|
|
28
|
+
export type ExpectationUnit = typeof EXPECTATION_UNITS[number];
|
|
29
|
+
/**
|
|
30
|
+
* Amount of text measurement
|
|
31
|
+
*/
|
|
32
|
+
export type ExpectationAmount = number_integer & number_positive_or_zero;
|
|
33
|
+
/**
|
|
34
|
+
* Template for simple concatenation of strings
|
|
35
|
+
*/
|
|
36
|
+
interface SimpleTemplateJson extends PromptTemplateJsonCommon {
|
|
37
|
+
readonly executionType: 'SIMPLE_TEMPLATE';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Template for script execution
|
|
41
|
+
*/
|
|
42
|
+
interface ScriptTemplateJson extends PromptTemplateJsonCommon {
|
|
43
|
+
readonly executionType: 'SCRIPT';
|
|
44
|
+
/**
|
|
45
|
+
* Language of the script
|
|
46
|
+
* - This is required only for executionType SCRIPT
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
readonly contentLanguage?: ScriptLanguage;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Template for prompt to user
|
|
53
|
+
*/
|
|
54
|
+
interface PromptDialogJson extends PromptTemplateJsonCommon {
|
|
55
|
+
readonly executionType: 'PROMPT_DIALOG';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Common properties of all prompt templates
|
|
59
|
+
*/
|
|
60
|
+
interface PromptTemplateJsonCommon {
|
|
61
|
+
/**
|
|
62
|
+
* Name of the template
|
|
63
|
+
* - It must be unique across the pipeline
|
|
64
|
+
* - It should start uppercase and contain letters and numbers
|
|
65
|
+
* - The promptbookUrl together with hash and name are used to identify the prompt template in the pipeline
|
|
66
|
+
*/
|
|
67
|
+
readonly name: string_name;
|
|
68
|
+
/**
|
|
69
|
+
* Title of the prompt template
|
|
70
|
+
* It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
71
|
+
*/
|
|
72
|
+
readonly title: string;
|
|
73
|
+
/**
|
|
74
|
+
* Description of the prompt template
|
|
75
|
+
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
76
|
+
*/
|
|
77
|
+
readonly description?: string;
|
|
78
|
+
/**
|
|
79
|
+
* List of parameter names that are used in the prompt template and must be defined before the prompt template is executed
|
|
80
|
+
*
|
|
81
|
+
* Note: Joker is one of the dependent parameters
|
|
82
|
+
*/
|
|
83
|
+
readonly dependentParameterNames: Array<string_name>;
|
|
84
|
+
/**
|
|
85
|
+
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
86
|
+
*/
|
|
87
|
+
readonly jokers?: Array<string>;
|
|
88
|
+
/**
|
|
89
|
+
* Type of the execution
|
|
90
|
+
* This determines if the prompt template is send to LLM, user or some scripting evaluation
|
|
91
|
+
*/
|
|
92
|
+
readonly executionType: ExecutionType;
|
|
93
|
+
/**
|
|
94
|
+
* Content of the template with {placeholders} for parameters
|
|
95
|
+
*/
|
|
96
|
+
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
|
|
97
|
+
/**
|
|
98
|
+
* List of postprocessing steps that are executed after the prompt template
|
|
99
|
+
*/
|
|
100
|
+
readonly postprocessing?: Array<string_javascript_name>;
|
|
101
|
+
/**
|
|
102
|
+
* Expect this amount of each unit in the answer
|
|
103
|
+
*
|
|
104
|
+
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
105
|
+
*
|
|
106
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
107
|
+
*/
|
|
108
|
+
readonly expectAmount?: Partial<Record<Lowercase<ExpectationUnit>, {
|
|
109
|
+
min?: ExpectationAmount;
|
|
110
|
+
max?: ExpectationAmount;
|
|
111
|
+
}>>;
|
|
112
|
+
/**
|
|
113
|
+
* Expect this format of the answer
|
|
114
|
+
*
|
|
115
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
116
|
+
*/
|
|
117
|
+
readonly expectFormat?: ExpectFormatCommand['format'];
|
|
118
|
+
/**
|
|
119
|
+
* Name of the parameter that is the result of the prompt template
|
|
120
|
+
*/
|
|
121
|
+
readonly resultingParameterName: string_name;
|
|
122
|
+
}
|
|
123
|
+
export {};
|
|
124
|
+
/**
|
|
125
|
+
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
126
|
+
*/
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { string_name } from '../typeAliases';
|
|
2
|
-
/**
|
|
3
|
-
* Describes one parameter of the promptbook
|
|
4
|
-
*/
|
|
5
|
-
export type PromptTemplateParameterJson = {
|
|
6
|
-
/**
|
|
7
|
-
* Name of the parameter
|
|
8
|
-
* - It must be unique across the pipeline
|
|
9
|
-
* - It should start lowercase and contain letters and numbers
|
|
10
|
-
*/
|
|
11
|
-
readonly name: string_name;
|
|
12
|
-
/**
|
|
13
|
-
* The parameter is input of the pipeline
|
|
14
|
-
*/
|
|
15
|
-
readonly isInput: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* The parameter is output of the pipeline
|
|
18
|
-
*/
|
|
19
|
-
readonly isOutput: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Description of the parameter
|
|
22
|
-
* - It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
23
|
-
*/
|
|
24
|
-
readonly description?: string;
|
|
25
|
-
};
|
|
1
|
+
import { string_name } from '../typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Describes one parameter of the promptbook
|
|
4
|
+
*/
|
|
5
|
+
export type PromptTemplateParameterJson = {
|
|
6
|
+
/**
|
|
7
|
+
* Name of the parameter
|
|
8
|
+
* - It must be unique across the pipeline
|
|
9
|
+
* - It should start lowercase and contain letters and numbers
|
|
10
|
+
*/
|
|
11
|
+
readonly name: string_name;
|
|
12
|
+
/**
|
|
13
|
+
* The parameter is input of the pipeline
|
|
14
|
+
*/
|
|
15
|
+
readonly isInput: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The parameter is output of the pipeline
|
|
18
|
+
*/
|
|
19
|
+
readonly isOutput: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Description of the parameter
|
|
22
|
+
* - It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
23
|
+
*/
|
|
24
|
+
readonly description?: string;
|
|
25
|
+
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { string_promptbook_url, string_version } from '../typeAliases';
|
|
2
|
-
import { PromptTemplateJson } from './PromptTemplateJson';
|
|
3
|
-
import { PromptTemplateParameterJson } from './PromptTemplateParameterJson';
|
|
4
|
-
/**
|
|
5
|
-
* Promptbook is the **core concept of this library**.
|
|
6
|
-
* It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
|
|
7
|
-
*
|
|
8
|
-
* @see https://github.com/webgptorg/promptbook#promptbook
|
|
9
|
-
*/
|
|
10
|
-
export type PromptbookJson = {
|
|
11
|
-
/**
|
|
12
|
-
* Unique identifier of the promptbook
|
|
13
|
-
*
|
|
14
|
-
* Note: It must be unique across all promptbooks libraries
|
|
15
|
-
* Note: It must use HTTPs URL
|
|
16
|
-
* Tip: You can do versioning in the URL
|
|
17
|
-
* For example: https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@1.0.0
|
|
18
|
-
* Warning: Do not hash part of the URL, hash part is used for identification of the prompt template in the pipeline
|
|
19
|
-
*/
|
|
20
|
-
readonly promptbookUrl?: string_promptbook_url;
|
|
21
|
-
/**
|
|
22
|
-
* Title of the promptbook
|
|
23
|
-
* -It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
24
|
-
*/
|
|
25
|
-
readonly title: string;
|
|
26
|
-
/**
|
|
27
|
-
* Version of the .ptbk.json file
|
|
28
|
-
*/
|
|
29
|
-
readonly promptbookVersion: string_version;
|
|
30
|
-
/**
|
|
31
|
-
* Description of the promptbook
|
|
32
|
-
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
33
|
-
*/
|
|
34
|
-
readonly description?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Set of variables that are used across the pipeline
|
|
37
|
-
*/
|
|
38
|
-
readonly parameters: Array<PromptTemplateParameterJson>;
|
|
39
|
-
/**
|
|
40
|
-
* Sequence of prompt templates that are chained together to form a pipeline
|
|
41
|
-
*/
|
|
42
|
-
readonly promptTemplates: Array<PromptTemplateJson>;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* TODO: [🧠] Best format of this code?
|
|
46
|
-
* There must be possible to make
|
|
47
|
-
* - Branching
|
|
48
|
-
* - Loops
|
|
49
|
-
* - Paralelization
|
|
50
|
-
* - ...and more
|
|
51
|
-
*/
|
|
1
|
+
import { string_promptbook_url, string_version } from '../typeAliases';
|
|
2
|
+
import { PromptTemplateJson } from './PromptTemplateJson';
|
|
3
|
+
import { PromptTemplateParameterJson } from './PromptTemplateParameterJson';
|
|
4
|
+
/**
|
|
5
|
+
* Promptbook is the **core concept of this library**.
|
|
6
|
+
* It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/webgptorg/promptbook#promptbook
|
|
9
|
+
*/
|
|
10
|
+
export type PromptbookJson = {
|
|
11
|
+
/**
|
|
12
|
+
* Unique identifier of the promptbook
|
|
13
|
+
*
|
|
14
|
+
* Note: It must be unique across all promptbooks libraries
|
|
15
|
+
* Note: It must use HTTPs URL
|
|
16
|
+
* Tip: You can do versioning in the URL
|
|
17
|
+
* For example: https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@1.0.0
|
|
18
|
+
* Warning: Do not hash part of the URL, hash part is used for identification of the prompt template in the pipeline
|
|
19
|
+
*/
|
|
20
|
+
readonly promptbookUrl?: string_promptbook_url;
|
|
21
|
+
/**
|
|
22
|
+
* Title of the promptbook
|
|
23
|
+
* -It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
24
|
+
*/
|
|
25
|
+
readonly title: string;
|
|
26
|
+
/**
|
|
27
|
+
* Version of the .ptbk.json file
|
|
28
|
+
*/
|
|
29
|
+
readonly promptbookVersion: string_version;
|
|
30
|
+
/**
|
|
31
|
+
* Description of the promptbook
|
|
32
|
+
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
33
|
+
*/
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Set of variables that are used across the pipeline
|
|
37
|
+
*/
|
|
38
|
+
readonly parameters: Array<PromptTemplateParameterJson>;
|
|
39
|
+
/**
|
|
40
|
+
* Sequence of prompt templates that are chained together to form a pipeline
|
|
41
|
+
*/
|
|
42
|
+
readonly promptTemplates: Array<PromptTemplateJson>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* TODO: [🧠] Best format of this code?
|
|
46
|
+
* There must be possible to make
|
|
47
|
+
* - Branching
|
|
48
|
+
* - Loops
|
|
49
|
+
* - Paralelization
|
|
50
|
+
* - ...and more
|
|
51
|
+
*/
|
|
@@ -1,12 +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
|
-
*/
|
|
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
|
+
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { 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>;
|
|
1
|
+
import { 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>;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { ExecutionType } from './ExecutionTypes';
|
|
2
|
-
import { string_markdown_text, string_name } from './typeAliases';
|
|
3
|
-
/**
|
|
4
|
-
* TaskProgress represents the progress of a Promptbook execution.
|
|
5
|
-
*/
|
|
6
|
-
export type TaskProgress = {
|
|
7
|
-
/**
|
|
8
|
-
* The unique name of the task.
|
|
9
|
-
*
|
|
10
|
-
* Note: This is not supposed to be displayed to the user.
|
|
11
|
-
* It is used to identify the task in the code, for example as react key
|
|
12
|
-
*/
|
|
13
|
-
readonly name: string_name;
|
|
14
|
-
/**
|
|
15
|
-
* Title of the task.
|
|
16
|
-
*
|
|
17
|
-
* Note: This is supposed to be displayed to the user.
|
|
18
|
-
* Note: This is trimmed and stripped of HTML tags and emojis
|
|
19
|
-
*/
|
|
20
|
-
readonly title: string_markdown_text;
|
|
21
|
-
/**
|
|
22
|
-
* Does the task started?
|
|
23
|
-
*/
|
|
24
|
-
readonly isStarted: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Is task done?
|
|
27
|
-
*/
|
|
28
|
-
readonly isDone: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* The type of the execution.
|
|
31
|
-
* 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.
|
|
32
|
-
*/
|
|
33
|
-
readonly executionType: ExecutionType;
|
|
34
|
-
/**
|
|
35
|
-
* The parameter name that is being processed.
|
|
36
|
-
*/
|
|
37
|
-
readonly parameterName: string_name;
|
|
38
|
-
/**
|
|
39
|
-
* The parameter value or null if the parameter is not yet processed.
|
|
40
|
-
*/
|
|
41
|
-
readonly parameterValue: string | null;
|
|
42
|
-
};
|
|
1
|
+
import { ExecutionType } from './ExecutionTypes';
|
|
2
|
+
import { string_markdown_text, string_name } from './typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* TaskProgress represents the progress of a Promptbook execution.
|
|
5
|
+
*/
|
|
6
|
+
export type TaskProgress = {
|
|
7
|
+
/**
|
|
8
|
+
* The unique name of the task.
|
|
9
|
+
*
|
|
10
|
+
* Note: This is not supposed to be displayed to the user.
|
|
11
|
+
* It is used to identify the task in the code, for example as react key
|
|
12
|
+
*/
|
|
13
|
+
readonly name: string_name;
|
|
14
|
+
/**
|
|
15
|
+
* Title of the task.
|
|
16
|
+
*
|
|
17
|
+
* Note: This is supposed to be displayed to the user.
|
|
18
|
+
* Note: This is trimmed and stripped of HTML tags and emojis
|
|
19
|
+
*/
|
|
20
|
+
readonly title: string_markdown_text;
|
|
21
|
+
/**
|
|
22
|
+
* Does the task started?
|
|
23
|
+
*/
|
|
24
|
+
readonly isStarted: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Is task done?
|
|
27
|
+
*/
|
|
28
|
+
readonly isDone: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The type of the execution.
|
|
31
|
+
* 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.
|
|
32
|
+
*/
|
|
33
|
+
readonly executionType: ExecutionType;
|
|
34
|
+
/**
|
|
35
|
+
* The parameter name that is being processed.
|
|
36
|
+
*/
|
|
37
|
+
readonly parameterName: string_name;
|
|
38
|
+
/**
|
|
39
|
+
* The parameter value or null if the parameter is not yet processed.
|
|
40
|
+
*/
|
|
41
|
+
readonly parameterValue: string | null;
|
|
42
|
+
};
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import type { PromptResult } from '../../execution/PromptResult';
|
|
2
|
-
import type { Prompt } from '../Prompt';
|
|
3
|
-
import type { string_promptbook_url, string_version } from '../typeAliases';
|
|
4
|
-
/**
|
|
5
|
-
* ExecutionReport is result of executing one promptbook
|
|
6
|
-
* It is kind of a variant of the promptbook usefull for debugging, logging and transparency for users.
|
|
7
|
-
*
|
|
8
|
-
* It can have 2 formats:
|
|
9
|
-
* - **.md file** created from the **JSON** format
|
|
10
|
-
* - _(this)_ **JSON** format
|
|
11
|
-
*
|
|
12
|
-
* @see https://github.com/webgptorg/promptbook#execution-report
|
|
13
|
-
*/
|
|
14
|
-
export type ExecutionReportJson = {
|
|
15
|
-
/**
|
|
16
|
-
* Unique identifier of the promptbook from promptbook which was executed
|
|
17
|
-
*/
|
|
18
|
-
readonly promptbookUrl?: string_promptbook_url;
|
|
19
|
-
/**
|
|
20
|
-
* Title of from promptbook which was executed
|
|
21
|
-
*/
|
|
22
|
-
readonly title?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Version from promptbook which was executed
|
|
25
|
-
*/
|
|
26
|
-
readonly promptbookUsedVersion: string_version;
|
|
27
|
-
/**
|
|
28
|
-
* Version from promptbook which was requested by promptbook
|
|
29
|
-
*/
|
|
30
|
-
readonly promptbookRequestedVersion?: string_version;
|
|
31
|
-
/**
|
|
32
|
-
* Description of the promptbook which was executed
|
|
33
|
-
*/
|
|
34
|
-
readonly description?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Sequence of prompt templates in order which were executed
|
|
37
|
-
*/
|
|
38
|
-
readonly promptExecutions: Array<{
|
|
39
|
-
/**
|
|
40
|
-
* The prompt wich was executed
|
|
41
|
-
*/
|
|
42
|
-
prompt: Omit<Prompt, 'promptbookUrl' | 'parameters'>;
|
|
43
|
-
/**
|
|
44
|
-
* Result of the prompt execution (if not failed during LLM execution)
|
|
45
|
-
*/
|
|
46
|
-
result?: PromptResult;
|
|
47
|
-
/**
|
|
48
|
-
* The error which occured during LLM execution or during postprocessing or expectation checking
|
|
49
|
-
*
|
|
50
|
-
* Note: It makes sense to have both error and result defined, for example when the result not pass expectations
|
|
51
|
-
*/
|
|
52
|
-
error?: {
|
|
53
|
-
message: string;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
56
|
-
};
|
|
1
|
+
import type { PromptResult } from '../../execution/PromptResult';
|
|
2
|
+
import type { Prompt } from '../Prompt';
|
|
3
|
+
import type { string_promptbook_url, string_version } from '../typeAliases';
|
|
4
|
+
/**
|
|
5
|
+
* ExecutionReport is result of executing one promptbook
|
|
6
|
+
* It is kind of a variant of the promptbook usefull for debugging, logging and transparency for users.
|
|
7
|
+
*
|
|
8
|
+
* It can have 2 formats:
|
|
9
|
+
* - **.md file** created from the **JSON** format
|
|
10
|
+
* - _(this)_ **JSON** format
|
|
11
|
+
*
|
|
12
|
+
* @see https://github.com/webgptorg/promptbook#execution-report
|
|
13
|
+
*/
|
|
14
|
+
export type ExecutionReportJson = {
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier of the promptbook from promptbook which was executed
|
|
17
|
+
*/
|
|
18
|
+
readonly promptbookUrl?: string_promptbook_url;
|
|
19
|
+
/**
|
|
20
|
+
* Title of from promptbook which was executed
|
|
21
|
+
*/
|
|
22
|
+
readonly title?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Version from promptbook which was executed
|
|
25
|
+
*/
|
|
26
|
+
readonly promptbookUsedVersion: string_version;
|
|
27
|
+
/**
|
|
28
|
+
* Version from promptbook which was requested by promptbook
|
|
29
|
+
*/
|
|
30
|
+
readonly promptbookRequestedVersion?: string_version;
|
|
31
|
+
/**
|
|
32
|
+
* Description of the promptbook which was executed
|
|
33
|
+
*/
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Sequence of prompt templates in order which were executed
|
|
37
|
+
*/
|
|
38
|
+
readonly promptExecutions: Array<{
|
|
39
|
+
/**
|
|
40
|
+
* The prompt wich was executed
|
|
41
|
+
*/
|
|
42
|
+
prompt: Omit<Prompt, 'promptbookUrl' | 'parameters'>;
|
|
43
|
+
/**
|
|
44
|
+
* Result of the prompt execution (if not failed during LLM execution)
|
|
45
|
+
*/
|
|
46
|
+
result?: PromptResult;
|
|
47
|
+
/**
|
|
48
|
+
* The error which occured during LLM execution or during postprocessing or expectation checking
|
|
49
|
+
*
|
|
50
|
+
* Note: It makes sense to have both error and result defined, for example when the result not pass expectations
|
|
51
|
+
*/
|
|
52
|
+
error?: {
|
|
53
|
+
message: string;
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
};
|