@promptbook/utils 0.41.4 → 0.41.101
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 +6 -0
- package/esm/index.es.js +1719 -1681
- package/esm/index.es.js.map +1 -1
- 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 +38 -38
- package/esm/typings/_packages/wizzard.index.d.ts +5 -5
- package/esm/typings/config.d.ts +4 -4
- package/esm/typings/conversion/prettify/PrettifyOptions.d.ts +7 -7
- package/esm/typings/conversion/prettify/prettifyPromptbookString.d.ts +11 -10
- package/esm/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -9
- 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 +9 -7
- package/umd/index.umd.js +1722 -1685
- package/umd/index.umd.js.map +1 -1
- 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 +38 -38
- package/umd/typings/_packages/wizzard.index.d.ts +5 -5
- package/umd/typings/config.d.ts +4 -4
- package/umd/typings/conversion/prettify/PrettifyOptions.d.ts +7 -7
- package/umd/typings/conversion/prettify/prettifyPromptbookString.d.ts +11 -10
- package/umd/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -9
- 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,10 +1,11 @@
|
|
|
1
|
-
import { PromptbookString } from '../../types/PromptbookString';
|
|
2
|
-
import type { PrettifyOptions } from './PrettifyOptions';
|
|
3
|
-
/**
|
|
4
|
-
* !!!
|
|
5
|
-
*/
|
|
6
|
-
export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): PromptbookString;
|
|
7
|
-
/**
|
|
8
|
-
* TODO:
|
|
9
|
-
* TODO: [
|
|
10
|
-
|
|
1
|
+
import { PromptbookString } from '../../types/PromptbookString';
|
|
2
|
+
import type { PrettifyOptions } from './PrettifyOptions';
|
|
3
|
+
/**
|
|
4
|
+
* !!!
|
|
5
|
+
*/
|
|
6
|
+
export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): PromptbookString;
|
|
7
|
+
/**
|
|
8
|
+
* TODO: Maybe use some Mermaid library instead of string templating
|
|
9
|
+
* TODO: [🧠] Should this be here OR in other folder
|
|
10
|
+
* TODO: [🕌] When more than 2 functionalities, split into separate functions
|
|
11
|
+
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* !!! Initialize
|
|
3
|
-
*/
|
|
4
|
-
export declare function prettifyPromptbookStringCli(): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* TODO: [🥠] Do not export to utils directly, its just for CLI script
|
|
7
|
-
* TODO: [
|
|
8
|
-
* Note: 11:11
|
|
9
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
* !!! Initialize
|
|
3
|
+
*/
|
|
4
|
+
export declare function prettifyPromptbookStringCli(): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* TODO: [🥠] Do not export to utils directly, its just for CLI script
|
|
7
|
+
* TODO: [🕌] When more functionalities, rename
|
|
8
|
+
* Note: 11:11
|
|
9
|
+
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import { PromptbookString } from '../types/PromptbookString';
|
|
3
|
-
/**
|
|
4
|
-
* Parse promptbook from string format to JSON format
|
|
5
|
-
*
|
|
6
|
-
* Note: This function does not validate logic of the pipeline only the syntax
|
|
7
|
-
*/
|
|
8
|
-
export declare function promptbookStringToJson(promptbookString: PromptbookString): PromptbookJson;
|
|
9
|
-
/**
|
|
10
|
-
* TODO: Report here line/column of error
|
|
11
|
-
* TODO: Use spaceTrim more effectively
|
|
12
|
-
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
13
|
-
*/
|
|
1
|
+
import { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
|
|
2
|
+
import { PromptbookString } from '../types/PromptbookString';
|
|
3
|
+
/**
|
|
4
|
+
* Parse promptbook from string format to JSON format
|
|
5
|
+
*
|
|
6
|
+
* Note: This function does not validate logic of the pipeline only the syntax
|
|
7
|
+
*/
|
|
8
|
+
export declare function promptbookStringToJson(promptbookString: PromptbookString): PromptbookJson;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: Report here line/column of error
|
|
11
|
+
* TODO: Use spaceTrim more effectively
|
|
12
|
+
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
13
|
+
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
import { PromptbookString } from '../../types/PromptbookString';
|
|
3
|
-
/**
|
|
4
|
-
* Import the text file
|
|
5
|
-
*
|
|
6
|
-
* Note: Using here custom import to work in jest tests
|
|
7
|
-
* Note: Using sync version is 💩 in the production code, but it's ok here in tests
|
|
8
|
-
*
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export declare function importPromptbook(path: `${string}.ptbk.md`): PromptbookString;
|
|
12
|
-
export declare function importPromptbook(path: `${string}.ptbk.json`): PromptbookJson;
|
|
1
|
+
import { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
+
import { PromptbookString } from '../../types/PromptbookString';
|
|
3
|
+
/**
|
|
4
|
+
* Import the text file
|
|
5
|
+
*
|
|
6
|
+
* Note: Using here custom import to work in jest tests
|
|
7
|
+
* Note: Using sync version is 💩 in the production code, but it's ok here in tests
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export declare function importPromptbook(path: `${string}.ptbk.md`): PromptbookString;
|
|
12
|
+
export declare function importPromptbook(path: `${string}.ptbk.json`): PromptbookJson;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
-
/**
|
|
3
|
-
* Validates PromptbookJson if it is logically valid.
|
|
4
|
-
*
|
|
5
|
-
* It checks:
|
|
6
|
-
* - if it has correct parameters dependency
|
|
7
|
-
*
|
|
8
|
-
* It does NOT check:
|
|
9
|
-
* - if it is valid json
|
|
10
|
-
* - if it is meaningful
|
|
11
|
-
*
|
|
12
|
-
* @param promptbook valid or invalid PromptbookJson
|
|
13
|
-
* @throws {Error} if invalid
|
|
14
|
-
*/
|
|
15
|
-
export declare function validatePromptbookJson(promptbook: PromptbookJson): void;
|
|
16
|
-
/**
|
|
17
|
-
* TODO: [🧠] Work with promptbookVersion
|
|
18
|
-
* TODO: Use here some json-schema, Zod or something similar and change it to:
|
|
19
|
-
* > /**
|
|
20
|
-
* > * Validates PromptbookJson if it is logically valid.
|
|
21
|
-
* > *
|
|
22
|
-
* > * It checks:
|
|
23
|
-
* > * - it has a valid structure
|
|
24
|
-
* > * - ...
|
|
25
|
-
* > ex port function validatePromptbookJson(promptbook: unknown): asserts promptbook is PromptbookJson {
|
|
26
|
-
*/
|
|
1
|
+
import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
|
|
2
|
+
/**
|
|
3
|
+
* Validates PromptbookJson if it is logically valid.
|
|
4
|
+
*
|
|
5
|
+
* It checks:
|
|
6
|
+
* - if it has correct parameters dependency
|
|
7
|
+
*
|
|
8
|
+
* It does NOT check:
|
|
9
|
+
* - if it is valid json
|
|
10
|
+
* - if it is meaningful
|
|
11
|
+
*
|
|
12
|
+
* @param promptbook valid or invalid PromptbookJson
|
|
13
|
+
* @throws {Error} if invalid
|
|
14
|
+
*/
|
|
15
|
+
export declare function validatePromptbookJson(promptbook: PromptbookJson): void;
|
|
16
|
+
/**
|
|
17
|
+
* TODO: [🧠] Work with promptbookVersion
|
|
18
|
+
* TODO: Use here some json-schema, Zod or something similar and change it to:
|
|
19
|
+
* > /**
|
|
20
|
+
* > * Validates PromptbookJson if it is logically valid.
|
|
21
|
+
* > *
|
|
22
|
+
* > * It checks:
|
|
23
|
+
* > * - it has a valid structure
|
|
24
|
+
* > * - ...
|
|
25
|
+
* > ex port function validatePromptbookJson(promptbook: unknown): asserts promptbook is PromptbookJson {
|
|
26
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { string_javascript, string_javascript_name } from '../../types/typeAliases';
|
|
2
|
-
/**
|
|
3
|
-
* Parses the given script and returns the list of all used variables that are not defined in the script
|
|
4
|
-
*
|
|
5
|
-
* @param script from which to extract the variables
|
|
6
|
-
* @returns the list of variable names
|
|
7
|
-
*
|
|
8
|
-
* @private within the promptbookStringToJson
|
|
9
|
-
*/
|
|
10
|
-
export declare function extractVariables(script: string_javascript): Array<string_javascript_name>;
|
|
1
|
+
import { string_javascript, string_javascript_name } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Parses the given script and returns the list of all used variables that are not defined in the script
|
|
4
|
+
*
|
|
5
|
+
* @param script from which to extract the variables
|
|
6
|
+
* @returns the list of variable names
|
|
7
|
+
*
|
|
8
|
+
* @private within the promptbookStringToJson
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractVariables(script: string_javascript): Array<string_javascript_name>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Command } from '../../types/Command';
|
|
2
|
-
import type { string_markdown_text } from '../../types/typeAliases';
|
|
3
|
-
/**
|
|
4
|
-
* Parses one line of ul/ol to command
|
|
5
|
-
*
|
|
6
|
-
* @private within the promptbookStringToJson
|
|
7
|
-
*/
|
|
8
|
-
export declare function parseCommand(listItem: string_markdown_text): Command;
|
|
1
|
+
import type { Command } from '../../types/Command';
|
|
2
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Parses one line of ul/ol to command
|
|
5
|
+
*
|
|
6
|
+
* @private within the promptbookStringToJson
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseCommand(listItem: string_markdown_text): Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
/**
|
|
3
|
-
* TODO: [🧠] Probbably change syntax MODEL VARIANT -> MODEL
|
|
4
|
-
*/
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* TODO: [🧠] Probbably change syntax MODEL VARIANT -> MODEL
|
|
4
|
+
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Function parseNumber will parse number from string
|
|
3
|
-
*
|
|
4
|
-
* Unlike Number.parseInt, Number.parseFloat it will never ever result in NaN
|
|
5
|
-
* Note: it also works only with decimal numbers
|
|
6
|
-
*
|
|
7
|
-
* @private within the parseCommand
|
|
8
|
-
*/
|
|
9
|
-
export declare function parseNumber(value: string | number): number;
|
|
10
|
-
/**
|
|
11
|
-
* TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
|
|
12
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
* Function parseNumber will parse number from string
|
|
3
|
+
*
|
|
4
|
+
* Unlike Number.parseInt, Number.parseFloat it will never ever result in NaN
|
|
5
|
+
* Note: it also works only with decimal numbers
|
|
6
|
+
*
|
|
7
|
+
* @private within the parseCommand
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseNumber(value: string | number): number;
|
|
10
|
+
/**
|
|
11
|
+
* TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
|
|
12
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
3
|
-
*
|
|
4
|
-
* Note: This is a kindof subtype of PromptbookExecutionError
|
|
5
|
-
*/
|
|
6
|
-
export declare class ExpectError extends Error {
|
|
7
|
-
readonly name = "ExpectError";
|
|
8
|
-
constructor(message: string);
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
3
|
+
*
|
|
4
|
+
* Note: This is a kindof subtype of PromptbookExecutionError
|
|
5
|
+
*/
|
|
6
|
+
export declare class ExpectError extends Error {
|
|
7
|
+
readonly name = "ExpectError";
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error indicates that the requested resource (for example promptbook in the library ) was not found
|
|
3
|
-
*/
|
|
4
|
-
export declare class NotFoundError extends Error {
|
|
5
|
-
readonly name = "NotFoundError";
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This error indicates that the requested resource (for example promptbook in the library ) was not found
|
|
3
|
+
*/
|
|
4
|
+
export declare class NotFoundError extends Error {
|
|
5
|
+
readonly name = "NotFoundError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error indicates errors during the execution of the promptbook
|
|
3
|
-
*/
|
|
4
|
-
export declare class PromptbookExecutionError extends Error {
|
|
5
|
-
readonly name = "PromptbookExecutionError";
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This error indicates errors during the execution of the promptbook
|
|
3
|
+
*/
|
|
4
|
+
export declare class PromptbookExecutionError extends Error {
|
|
5
|
+
readonly name = "PromptbookExecutionError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
|
|
3
|
-
*/
|
|
4
|
-
export declare class PromptbookLogicError extends Error {
|
|
5
|
-
readonly name = "PromptbookLogicError";
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
|
|
3
|
+
*/
|
|
4
|
+
export declare class PromptbookLogicError extends Error {
|
|
5
|
+
readonly name = "PromptbookLogicError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error indicates errors in referencing promptbooks between each other
|
|
3
|
-
*/
|
|
4
|
-
export declare class PromptbookReferenceError extends Error {
|
|
5
|
-
readonly name = "PromptbookReferenceError";
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This error indicates errors in referencing promptbooks between each other
|
|
3
|
+
*/
|
|
4
|
+
export declare class PromptbookReferenceError extends Error {
|
|
5
|
+
readonly name = "PromptbookReferenceError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
|
|
3
|
-
*/
|
|
4
|
-
export declare class PromptbookSyntaxError extends Error {
|
|
5
|
-
readonly name = "PromptbookSyntaxError";
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
|
|
3
|
+
*/
|
|
4
|
+
export declare class PromptbookSyntaxError extends Error {
|
|
5
|
+
readonly name = "PromptbookSyntaxError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error type indicates that the error should not happen and its last check before crashing with some other error
|
|
3
|
-
*/
|
|
4
|
-
export declare class UnexpectedError extends Error {
|
|
5
|
-
readonly name = "UnexpectedError";
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This error type indicates that the error should not happen and its last check before crashing with some other error
|
|
3
|
+
*/
|
|
4
|
+
export declare class UnexpectedError extends Error {
|
|
5
|
+
readonly name = "UnexpectedError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type CommonExecutionToolsOptions = {
|
|
2
|
-
/**
|
|
3
|
-
* If true, the internal executions will be logged
|
|
4
|
-
*/
|
|
5
|
-
readonly isVerbose?: boolean;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
9
|
-
*/
|
|
1
|
+
export type CommonExecutionToolsOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* If true, the internal executions will be logged
|
|
4
|
+
*/
|
|
5
|
+
readonly isVerbose?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
9
|
+
*/
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { NaturalExecutionTools } from './NaturalExecutionTools';
|
|
2
|
-
import { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
3
|
-
import { UserInterfaceTools } from './UserInterfaceTools';
|
|
4
|
-
/**
|
|
5
|
-
* All the tools needed to execute prompts (template pipelines).
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/webgptorg/promptbook#execution-tools
|
|
8
|
-
*/
|
|
9
|
-
export type ExecutionTools = {
|
|
10
|
-
/**
|
|
11
|
-
* Tools for executing prompts to large language models like GPT-4
|
|
12
|
-
*/
|
|
13
|
-
natural: NaturalExecutionTools;
|
|
14
|
-
/**
|
|
15
|
-
* Tools for executing scripts
|
|
16
|
-
*
|
|
17
|
-
* Note: You can pass multiple ScriptExecutionTools, they will be tried one by one until one of them supports the script
|
|
18
|
-
* If none of them supports the script, an error is thrown
|
|
19
|
-
*/
|
|
20
|
-
script: Array<ScriptExecutionTools>;
|
|
21
|
-
/**
|
|
22
|
-
* Tools for interacting with the user
|
|
23
|
-
*/
|
|
24
|
-
userInterface: UserInterfaceTools;
|
|
25
|
-
};
|
|
1
|
+
import { NaturalExecutionTools } from './NaturalExecutionTools';
|
|
2
|
+
import { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
3
|
+
import { UserInterfaceTools } from './UserInterfaceTools';
|
|
4
|
+
/**
|
|
5
|
+
* All the tools needed to execute prompts (template pipelines).
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/webgptorg/promptbook#execution-tools
|
|
8
|
+
*/
|
|
9
|
+
export type ExecutionTools = {
|
|
10
|
+
/**
|
|
11
|
+
* Tools for executing prompts to large language models like GPT-4
|
|
12
|
+
*/
|
|
13
|
+
natural: NaturalExecutionTools;
|
|
14
|
+
/**
|
|
15
|
+
* Tools for executing scripts
|
|
16
|
+
*
|
|
17
|
+
* Note: You can pass multiple ScriptExecutionTools, they will be tried one by one until one of them supports the script
|
|
18
|
+
* If none of them supports the script, an error is thrown
|
|
19
|
+
*/
|
|
20
|
+
script: Array<ScriptExecutionTools>;
|
|
21
|
+
/**
|
|
22
|
+
* Tools for interacting with the user
|
|
23
|
+
*/
|
|
24
|
+
userInterface: UserInterfaceTools;
|
|
25
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Prompt } from '../types/Prompt';
|
|
2
|
-
import { PromptChatResult, PromptCompletionResult } from './PromptResult';
|
|
3
|
-
/**
|
|
4
|
-
* Vontainer for all the tools needed to execute prompts to large language models like GPT-4
|
|
5
|
-
* On its interface it exposes common methods for prompt execution.
|
|
6
|
-
* Inside (in constructor) it calls OpenAI, Azure, GPU, proxy, cache, logging,...
|
|
7
|
-
*
|
|
8
|
-
* @see https://github.com/webgptorg/promptbook#natural-execution-tools
|
|
9
|
-
*/
|
|
10
|
-
export type NaturalExecutionTools = {
|
|
11
|
-
/**
|
|
12
|
-
* Use a chat model
|
|
13
|
-
*/
|
|
14
|
-
gptChat(prompt: Prompt): Promise<PromptChatResult>;
|
|
15
|
-
/**
|
|
16
|
-
* Use a completion model
|
|
17
|
-
*/
|
|
18
|
-
gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* TODO: [🏳] gptChat -> chat, gptComplete -> complete, translate
|
|
22
|
-
* TODO: [🧠] Should or should not there be a word "GPT" in both gptComplete and gptChat
|
|
23
|
-
*/
|
|
1
|
+
import { Prompt } from '../types/Prompt';
|
|
2
|
+
import { PromptChatResult, PromptCompletionResult } from './PromptResult';
|
|
3
|
+
/**
|
|
4
|
+
* Vontainer for all the tools needed to execute prompts to large language models like GPT-4
|
|
5
|
+
* On its interface it exposes common methods for prompt execution.
|
|
6
|
+
* Inside (in constructor) it calls OpenAI, Azure, GPU, proxy, cache, logging,...
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/webgptorg/promptbook#natural-execution-tools
|
|
9
|
+
*/
|
|
10
|
+
export type NaturalExecutionTools = {
|
|
11
|
+
/**
|
|
12
|
+
* Use a chat model
|
|
13
|
+
*/
|
|
14
|
+
gptChat(prompt: Prompt): Promise<PromptChatResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Use a completion model
|
|
17
|
+
*/
|
|
18
|
+
gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* TODO: [🏳] gptChat -> chat, gptComplete -> complete, translate
|
|
22
|
+
* TODO: [🧠] Should or should not there be a word "GPT" in both gptComplete and gptChat
|
|
23
|
+
*/
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import type { number_positive_or_zero, number_tokens, number_usd, string_date_iso8601, string_model_name } from '.././types/typeAliases';
|
|
2
|
-
/**
|
|
3
|
-
* Prompt result is the simplest concept of execution.
|
|
4
|
-
* It is the result of executing one prompt _(NOT a template)_.
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/webgptorg/promptbook#prompt-result
|
|
7
|
-
*/
|
|
8
|
-
export type PromptResult = PromptCompletionResult | PromptChatResult;
|
|
9
|
-
/**
|
|
10
|
-
* Prompt completion result
|
|
11
|
-
* It contains only the following text NOT the whole completion
|
|
12
|
-
*/
|
|
13
|
-
export type PromptCompletionResult = PromptCommonResult;
|
|
14
|
-
/**
|
|
15
|
-
* Prompt chat result
|
|
16
|
-
*/
|
|
17
|
-
export type PromptChatResult = PromptCommonResult & {};
|
|
18
|
-
export type PromptCommonResult = {
|
|
19
|
-
/**
|
|
20
|
-
* Exact text response from the model
|
|
21
|
-
*/
|
|
22
|
-
readonly content: string;
|
|
23
|
-
/**
|
|
24
|
-
* Name of the model used to generate the response
|
|
25
|
-
*/
|
|
26
|
-
readonly model: string_model_name;
|
|
27
|
-
/**
|
|
28
|
-
* Timing
|
|
29
|
-
*/
|
|
30
|
-
readonly timing: {
|
|
31
|
-
/**
|
|
32
|
-
* Start of the execution
|
|
33
|
-
*/
|
|
34
|
-
start: string_date_iso8601;
|
|
35
|
-
/**
|
|
36
|
-
* First token generated
|
|
37
|
-
*/
|
|
38
|
-
firstToken?: string_date_iso8601;
|
|
39
|
-
/**
|
|
40
|
-
* End of the execution
|
|
41
|
-
*/
|
|
42
|
-
complete: string_date_iso8601;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Usage of the prompt execution
|
|
46
|
-
*/
|
|
47
|
-
readonly usage: {
|
|
48
|
-
/**
|
|
49
|
-
* Cost of the execution in USD
|
|
50
|
-
*
|
|
51
|
-
* If the cost is unknown, the value is `'UNKNOWN'`
|
|
52
|
-
*/
|
|
53
|
-
price: (number_positive_or_zero & number_usd) | 'UNKNOWN';
|
|
54
|
-
/**
|
|
55
|
-
* Number of tokens used in the input aka. `prompt_tokens`
|
|
56
|
-
*/
|
|
57
|
-
inputTokens: number_tokens;
|
|
58
|
-
/**
|
|
59
|
-
* Number of tokens used in the output aka. `completion_tokens`
|
|
60
|
-
*/
|
|
61
|
-
outputTokens: number_tokens;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Raw response from the model
|
|
65
|
-
*/
|
|
66
|
-
readonly rawResponse: object;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* TODO: [🧠] Maybe timing more accurate then seconds?
|
|
70
|
-
* TODO: [🧠] Should here be link to the prompt?
|
|
71
|
-
* TODO: [🧠] Maybe type raw properly - not onject but OpenAI.result.whatever
|
|
72
|
-
* TODO: [🧠] Maybe remove redundant raw.choices.text
|
|
73
|
-
* TODO: Log raw even if prompt failed - log the raw error
|
|
74
|
-
*/
|
|
1
|
+
import type { number_positive_or_zero, number_tokens, number_usd, string_date_iso8601, string_model_name } from '.././types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Prompt result is the simplest concept of execution.
|
|
4
|
+
* It is the result of executing one prompt _(NOT a template)_.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/webgptorg/promptbook#prompt-result
|
|
7
|
+
*/
|
|
8
|
+
export type PromptResult = PromptCompletionResult | PromptChatResult;
|
|
9
|
+
/**
|
|
10
|
+
* Prompt completion result
|
|
11
|
+
* It contains only the following text NOT the whole completion
|
|
12
|
+
*/
|
|
13
|
+
export type PromptCompletionResult = PromptCommonResult;
|
|
14
|
+
/**
|
|
15
|
+
* Prompt chat result
|
|
16
|
+
*/
|
|
17
|
+
export type PromptChatResult = PromptCommonResult & {};
|
|
18
|
+
export type PromptCommonResult = {
|
|
19
|
+
/**
|
|
20
|
+
* Exact text response from the model
|
|
21
|
+
*/
|
|
22
|
+
readonly content: string;
|
|
23
|
+
/**
|
|
24
|
+
* Name of the model used to generate the response
|
|
25
|
+
*/
|
|
26
|
+
readonly model: string_model_name;
|
|
27
|
+
/**
|
|
28
|
+
* Timing
|
|
29
|
+
*/
|
|
30
|
+
readonly timing: {
|
|
31
|
+
/**
|
|
32
|
+
* Start of the execution
|
|
33
|
+
*/
|
|
34
|
+
start: string_date_iso8601;
|
|
35
|
+
/**
|
|
36
|
+
* First token generated
|
|
37
|
+
*/
|
|
38
|
+
firstToken?: string_date_iso8601;
|
|
39
|
+
/**
|
|
40
|
+
* End of the execution
|
|
41
|
+
*/
|
|
42
|
+
complete: string_date_iso8601;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Usage of the prompt execution
|
|
46
|
+
*/
|
|
47
|
+
readonly usage: {
|
|
48
|
+
/**
|
|
49
|
+
* Cost of the execution in USD
|
|
50
|
+
*
|
|
51
|
+
* If the cost is unknown, the value is `'UNKNOWN'`
|
|
52
|
+
*/
|
|
53
|
+
price: (number_positive_or_zero & number_usd) | 'UNKNOWN';
|
|
54
|
+
/**
|
|
55
|
+
* Number of tokens used in the input aka. `prompt_tokens`
|
|
56
|
+
*/
|
|
57
|
+
inputTokens: number_tokens;
|
|
58
|
+
/**
|
|
59
|
+
* Number of tokens used in the output aka. `completion_tokens`
|
|
60
|
+
*/
|
|
61
|
+
outputTokens: number_tokens;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Raw response from the model
|
|
65
|
+
*/
|
|
66
|
+
readonly rawResponse: object;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* TODO: [🧠] Maybe timing more accurate then seconds?
|
|
70
|
+
* TODO: [🧠] Should here be link to the prompt?
|
|
71
|
+
* TODO: [🧠] Maybe type raw properly - not onject but OpenAI.result.whatever
|
|
72
|
+
* TODO: [🧠] Maybe remove redundant raw.choices.text
|
|
73
|
+
* TODO: Log raw even if prompt failed - log the raw error
|
|
74
|
+
*/
|