@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,4 +1,4 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
/**
|
|
3
|
-
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
|
|
4
|
-
*/
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
|
|
4
|
+
*/
|
package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
/**
|
|
3
|
-
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
|
|
4
|
-
*/
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
|
|
4
|
+
*/
|
package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type { Prompt } from '../../../../types/Prompt';
|
|
2
|
-
import type { NaturalExecutionTools } from '../../../NaturalExecutionTools';
|
|
3
|
-
import type { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
|
|
4
|
-
import type { OpenAiExecutionToolsOptions } from './OpenAiExecutionToolsOptions';
|
|
5
|
-
/**
|
|
6
|
-
* Execution Tools for calling OpenAI API.
|
|
7
|
-
*/
|
|
8
|
-
export declare class OpenAiExecutionTools implements NaturalExecutionTools {
|
|
9
|
-
private readonly options;
|
|
10
|
-
/**
|
|
11
|
-
* OpenAI API client.
|
|
12
|
-
*/
|
|
13
|
-
private readonly openai;
|
|
14
|
-
constructor(options: OpenAiExecutionToolsOptions);
|
|
15
|
-
/**
|
|
16
|
-
* Calls OpenAI API to use a chat model.
|
|
17
|
-
*/
|
|
18
|
-
gptChat(prompt: Prompt): Promise<PromptChatResult>;
|
|
19
|
-
/**
|
|
20
|
-
* Calls OpenAI API to use a complete model.
|
|
21
|
-
*/
|
|
22
|
-
gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
* TODO: Maybe Create some common util for gptChat and gptComplete
|
|
27
|
-
* TODO: Maybe make custom OpenaiError
|
|
28
|
-
*/
|
|
1
|
+
import type { Prompt } from '../../../../types/Prompt';
|
|
2
|
+
import type { NaturalExecutionTools } from '../../../NaturalExecutionTools';
|
|
3
|
+
import type { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
|
|
4
|
+
import type { OpenAiExecutionToolsOptions } from './OpenAiExecutionToolsOptions';
|
|
5
|
+
/**
|
|
6
|
+
* Execution Tools for calling OpenAI API.
|
|
7
|
+
*/
|
|
8
|
+
export declare class OpenAiExecutionTools implements NaturalExecutionTools {
|
|
9
|
+
private readonly options;
|
|
10
|
+
/**
|
|
11
|
+
* OpenAI API client.
|
|
12
|
+
*/
|
|
13
|
+
private readonly openai;
|
|
14
|
+
constructor(options: OpenAiExecutionToolsOptions);
|
|
15
|
+
/**
|
|
16
|
+
* Calls OpenAI API to use a chat model.
|
|
17
|
+
*/
|
|
18
|
+
gptChat(prompt: Prompt): Promise<PromptChatResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Calls OpenAI API to use a complete model.
|
|
21
|
+
*/
|
|
22
|
+
gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
|
|
26
|
+
* TODO: Maybe Create some common util for gptChat and gptComplete
|
|
27
|
+
* TODO: Maybe make custom OpenaiError
|
|
28
|
+
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { string_token } from '../../../.././types/typeAliases';
|
|
2
|
-
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
3
|
-
/**
|
|
4
|
-
* Options for OpenAiExecutionTools
|
|
5
|
-
*/
|
|
6
|
-
export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
7
|
-
/**
|
|
8
|
-
* OpenAI API key
|
|
9
|
-
*/
|
|
10
|
-
openAiApiKey: string_token;
|
|
11
|
-
/**
|
|
12
|
-
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
13
|
-
* and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
|
|
14
|
-
*/
|
|
15
|
-
user?: string_token;
|
|
16
|
-
};
|
|
1
|
+
import { string_token } from '../../../.././types/typeAliases';
|
|
2
|
+
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Options for OpenAiExecutionTools
|
|
5
|
+
*/
|
|
6
|
+
export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
7
|
+
/**
|
|
8
|
+
* OpenAI API key
|
|
9
|
+
*/
|
|
10
|
+
openAiApiKey: string_token;
|
|
11
|
+
/**
|
|
12
|
+
* A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
13
|
+
* and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
|
|
14
|
+
*/
|
|
15
|
+
user?: string_token;
|
|
16
|
+
};
|
package/umd/typings/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type OpenAI from 'openai';
|
|
2
|
-
import type { PromptResult } from '../../../PromptResult';
|
|
3
|
-
export declare function computeOpenaiUsage(rawResponse: Pick<OpenAI.Chat.Completions.ChatCompletion | OpenAI.Completions.Completion, 'model' | 'usage'>): PromptResult['usage'];
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
|
+
import type { PromptResult } from '../../../PromptResult';
|
|
3
|
+
export declare function computeOpenaiUsage(rawResponse: Pick<OpenAI.Chat.Completions.ChatCompletion | OpenAI.Completions.Completion, 'model' | 'usage'>): PromptResult['usage'];
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Prompt } from '../../../../types/Prompt';
|
|
2
|
-
import { NaturalExecutionTools } from '../../../NaturalExecutionTools';
|
|
3
|
-
import { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
|
|
4
|
-
import { RemoteNaturalExecutionToolsOptions } from './RemoteNaturalExecutionToolsOptions';
|
|
5
|
-
/**
|
|
6
|
-
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
7
|
-
*
|
|
8
|
-
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
9
|
-
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
10
|
-
*
|
|
11
|
-
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
12
|
-
*/
|
|
13
|
-
export declare class RemoteNaturalExecutionTools implements NaturalExecutionTools {
|
|
14
|
-
private readonly options;
|
|
15
|
-
constructor(options: RemoteNaturalExecutionToolsOptions);
|
|
16
|
-
/**
|
|
17
|
-
* Creates a connection to the remote proxy server.
|
|
18
|
-
*/
|
|
19
|
-
private makeConnection;
|
|
20
|
-
/**
|
|
21
|
-
* Calls remote proxy server to use a chat model.
|
|
22
|
-
*/
|
|
23
|
-
gptChat(prompt: Prompt): Promise<PromptChatResult>;
|
|
24
|
-
/**
|
|
25
|
-
* Calls remote proxy server to use a completion model.
|
|
26
|
-
*/
|
|
27
|
-
gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
28
|
-
/**
|
|
29
|
-
* Calls remote proxy server to use both completion or chat model.
|
|
30
|
-
*/
|
|
31
|
-
private gptCommon;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* TODO: [🤹♂️] RemoteNaturalExecutionTools should extend Destroyable and implement IDestroyable
|
|
35
|
-
*/
|
|
1
|
+
import { Prompt } from '../../../../types/Prompt';
|
|
2
|
+
import { NaturalExecutionTools } from '../../../NaturalExecutionTools';
|
|
3
|
+
import { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
|
|
4
|
+
import { RemoteNaturalExecutionToolsOptions } from './RemoteNaturalExecutionToolsOptions';
|
|
5
|
+
/**
|
|
6
|
+
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
7
|
+
*
|
|
8
|
+
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
9
|
+
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
12
|
+
*/
|
|
13
|
+
export declare class RemoteNaturalExecutionTools implements NaturalExecutionTools {
|
|
14
|
+
private readonly options;
|
|
15
|
+
constructor(options: RemoteNaturalExecutionToolsOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Creates a connection to the remote proxy server.
|
|
18
|
+
*/
|
|
19
|
+
private makeConnection;
|
|
20
|
+
/**
|
|
21
|
+
* Calls remote proxy server to use a chat model.
|
|
22
|
+
*/
|
|
23
|
+
gptChat(prompt: Prompt): Promise<PromptChatResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Calls remote proxy server to use a completion model.
|
|
26
|
+
*/
|
|
27
|
+
gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Calls remote proxy server to use both completion or chat model.
|
|
30
|
+
*/
|
|
31
|
+
private gptCommon;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* TODO: [🤹♂️] RemoteNaturalExecutionTools should extend Destroyable and implement IDestroyable
|
|
35
|
+
*/
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { client_id, string_uri } from '../../../.././types/typeAliases';
|
|
2
|
-
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
3
|
-
/**
|
|
4
|
-
* Options for RemoteNaturalExecutionTools
|
|
5
|
-
*/
|
|
6
|
-
export type RemoteNaturalExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
7
|
-
/**
|
|
8
|
-
* URL of the remote PROMPTBOOK server
|
|
9
|
-
* On this server will be connected to the socket.io server
|
|
10
|
-
*/
|
|
11
|
-
readonly remoteUrl: URL;
|
|
12
|
-
/**
|
|
13
|
-
* Path for the Socket.io server to listen
|
|
14
|
-
*
|
|
15
|
-
* @default '/socket.io'
|
|
16
|
-
* @example '/promptbook/socket.io'
|
|
17
|
-
*/
|
|
18
|
-
readonly path: string_uri;
|
|
19
|
-
/**
|
|
20
|
-
* Your client ID
|
|
21
|
-
*/
|
|
22
|
-
readonly clientId: client_id;
|
|
23
|
-
};
|
|
1
|
+
import type { client_id, string_uri } from '../../../.././types/typeAliases';
|
|
2
|
+
import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Options for RemoteNaturalExecutionTools
|
|
5
|
+
*/
|
|
6
|
+
export type RemoteNaturalExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
7
|
+
/**
|
|
8
|
+
* URL of the remote PROMPTBOOK server
|
|
9
|
+
* On this server will be connected to the socket.io server
|
|
10
|
+
*/
|
|
11
|
+
readonly remoteUrl: URL;
|
|
12
|
+
/**
|
|
13
|
+
* Path for the Socket.io server to listen
|
|
14
|
+
*
|
|
15
|
+
* @default '/socket.io'
|
|
16
|
+
* @example '/promptbook/socket.io'
|
|
17
|
+
*/
|
|
18
|
+
readonly path: string_uri;
|
|
19
|
+
/**
|
|
20
|
+
* Your client ID
|
|
21
|
+
*/
|
|
22
|
+
readonly clientId: client_id;
|
|
23
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Socket.io error for remote text generation
|
|
3
|
-
*
|
|
4
|
-
* This is sent from server to client when error occurs and stops the process
|
|
5
|
-
*/
|
|
6
|
-
export interface Promptbook_Server_Error {
|
|
7
|
-
/**
|
|
8
|
-
* The error message which caused the error
|
|
9
|
-
*/
|
|
10
|
-
readonly errorMessage: string;
|
|
11
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Socket.io error for remote text generation
|
|
3
|
+
*
|
|
4
|
+
* This is sent from server to client when error occurs and stops the process
|
|
5
|
+
*/
|
|
6
|
+
export interface Promptbook_Server_Error {
|
|
7
|
+
/**
|
|
8
|
+
* The error message which caused the error
|
|
9
|
+
*/
|
|
10
|
+
readonly errorMessage: string;
|
|
11
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TaskProgress } from '../../../../../types/TaskProgress';
|
|
2
|
-
/**
|
|
3
|
-
* Socket.io progress for remote text generation
|
|
4
|
-
*
|
|
5
|
-
* This is sent from server to client arbitrarily and may be sent multiple times
|
|
6
|
-
*/
|
|
7
|
-
export interface Promptbook_Server_Progress {
|
|
8
|
-
/**
|
|
9
|
-
* The progress of text generation
|
|
10
|
-
*/
|
|
11
|
-
readonly taskProgress: TaskProgress;
|
|
12
|
-
}
|
|
1
|
+
import { TaskProgress } from '../../../../../types/TaskProgress';
|
|
2
|
+
/**
|
|
3
|
+
* Socket.io progress for remote text generation
|
|
4
|
+
*
|
|
5
|
+
* This is sent from server to client arbitrarily and may be sent multiple times
|
|
6
|
+
*/
|
|
7
|
+
export interface Promptbook_Server_Progress {
|
|
8
|
+
/**
|
|
9
|
+
* The progress of text generation
|
|
10
|
+
*/
|
|
11
|
+
readonly taskProgress: TaskProgress;
|
|
12
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { client_id } from '../../../../../types/typeAliases';
|
|
2
|
-
import type { Prompt } from '../../../../../types/Prompt';
|
|
3
|
-
/**
|
|
4
|
-
* Socket.io progress for remote text generation
|
|
5
|
-
*
|
|
6
|
-
* This is a request from client to server
|
|
7
|
-
*/
|
|
8
|
-
export interface Promptbook_Server_Request {
|
|
9
|
-
/**
|
|
10
|
-
* Client responsible for the requests
|
|
11
|
-
*/
|
|
12
|
-
readonly clientId: client_id;
|
|
13
|
-
/**
|
|
14
|
-
* The Prompt to execute
|
|
15
|
-
*/
|
|
16
|
-
readonly prompt: Prompt;
|
|
17
|
-
}
|
|
1
|
+
import type { client_id } from '../../../../../types/typeAliases';
|
|
2
|
+
import type { Prompt } from '../../../../../types/Prompt';
|
|
3
|
+
/**
|
|
4
|
+
* Socket.io progress for remote text generation
|
|
5
|
+
*
|
|
6
|
+
* This is a request from client to server
|
|
7
|
+
*/
|
|
8
|
+
export interface Promptbook_Server_Request {
|
|
9
|
+
/**
|
|
10
|
+
* Client responsible for the requests
|
|
11
|
+
*/
|
|
12
|
+
readonly clientId: client_id;
|
|
13
|
+
/**
|
|
14
|
+
* The Prompt to execute
|
|
15
|
+
*/
|
|
16
|
+
readonly prompt: Prompt;
|
|
17
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PromptResult } from '../../../../PromptResult';
|
|
2
|
-
/**
|
|
3
|
-
* Socket.io error for remote text generation
|
|
4
|
-
*
|
|
5
|
-
* This is sent from server to client when the generated text is completed
|
|
6
|
-
*/
|
|
7
|
-
export interface Promptbook_Server_Response {
|
|
8
|
-
/**
|
|
9
|
-
* The result of the prompt
|
|
10
|
-
*/
|
|
11
|
-
promptResult: PromptResult;
|
|
12
|
-
}
|
|
1
|
+
import { PromptResult } from '../../../../PromptResult';
|
|
2
|
+
/**
|
|
3
|
+
* Socket.io error for remote text generation
|
|
4
|
+
*
|
|
5
|
+
* This is sent from server to client when the generated text is completed
|
|
6
|
+
*/
|
|
7
|
+
export interface Promptbook_Server_Response {
|
|
8
|
+
/**
|
|
9
|
+
* The result of the prompt
|
|
10
|
+
*/
|
|
11
|
+
promptResult: PromptResult;
|
|
12
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import type { PromptbookLibrary } from '../../../../../library/PromptbookLibrary';
|
|
2
|
-
import type { client_id, string_uri } from '../../../../../types/typeAliases';
|
|
3
|
-
import type { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';
|
|
4
|
-
import type { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
|
|
5
|
-
export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
6
|
-
/**
|
|
7
|
-
* Port on which the server will listen
|
|
8
|
-
*/
|
|
9
|
-
readonly port: number;
|
|
10
|
-
/**
|
|
11
|
-
* Path for the Socket.io server to listen
|
|
12
|
-
*
|
|
13
|
-
* @default '/socket.io'
|
|
14
|
-
* @example '/promptbook/socket.io'
|
|
15
|
-
*/
|
|
16
|
-
readonly path: string_uri;
|
|
17
|
-
/**
|
|
18
|
-
* Promptbook library to use
|
|
19
|
-
*
|
|
20
|
-
* This is used to checkl validity of the prompt to prevent DDoS
|
|
21
|
-
*/
|
|
22
|
-
readonly library: PromptbookLibrary;
|
|
23
|
-
/**
|
|
24
|
-
* Creates natural execution tools for each client
|
|
25
|
-
*/
|
|
26
|
-
createNaturalExecutionTools(clientId: client_id): NaturalExecutionTools;
|
|
27
|
-
};
|
|
1
|
+
import type { PromptbookLibrary } from '../../../../../library/PromptbookLibrary';
|
|
2
|
+
import type { client_id, string_uri } from '../../../../../types/typeAliases';
|
|
3
|
+
import type { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';
|
|
4
|
+
import type { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
|
|
5
|
+
export type RemoteServerOptions = CommonExecutionToolsOptions & {
|
|
6
|
+
/**
|
|
7
|
+
* Port on which the server will listen
|
|
8
|
+
*/
|
|
9
|
+
readonly port: number;
|
|
10
|
+
/**
|
|
11
|
+
* Path for the Socket.io server to listen
|
|
12
|
+
*
|
|
13
|
+
* @default '/socket.io'
|
|
14
|
+
* @example '/promptbook/socket.io'
|
|
15
|
+
*/
|
|
16
|
+
readonly path: string_uri;
|
|
17
|
+
/**
|
|
18
|
+
* Promptbook library to use
|
|
19
|
+
*
|
|
20
|
+
* This is used to checkl validity of the prompt to prevent DDoS
|
|
21
|
+
*/
|
|
22
|
+
readonly library: PromptbookLibrary;
|
|
23
|
+
/**
|
|
24
|
+
* Creates natural execution tools for each client
|
|
25
|
+
*/
|
|
26
|
+
createNaturalExecutionTools(clientId: client_id): NaturalExecutionTools;
|
|
27
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { IDestroyable } from 'destroyable';
|
|
2
|
-
import { RemoteServerOptions } from './interfaces/RemoteServerOptions';
|
|
3
|
-
/**
|
|
4
|
-
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
5
|
-
*
|
|
6
|
-
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
7
|
-
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
8
|
-
*
|
|
9
|
-
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
10
|
-
*/
|
|
11
|
-
export declare function startRemoteServer(options: RemoteServerOptions): IDestroyable;
|
|
12
|
-
/**
|
|
13
|
-
* TODO: Handle progress - support streaming
|
|
14
|
-
* TODO: [🤹♂️] Do not hang up immediately but wait until client closes OR timeout
|
|
15
|
-
* TODO: [🤹♂️] Timeout on chat to free up resources
|
|
16
|
-
* TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
|
|
17
|
-
*/
|
|
1
|
+
import type { IDestroyable } from 'destroyable';
|
|
2
|
+
import { RemoteServerOptions } from './interfaces/RemoteServerOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
5
|
+
*
|
|
6
|
+
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
7
|
+
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
10
|
+
*/
|
|
11
|
+
export declare function startRemoteServer(options: RemoteServerOptions): IDestroyable;
|
|
12
|
+
/**
|
|
13
|
+
* TODO: Handle progress - support streaming
|
|
14
|
+
* TODO: [🤹♂️] Do not hang up immediately but wait until client closes OR timeout
|
|
15
|
+
* TODO: [🤹♂️] Timeout on chat to free up resources
|
|
16
|
+
* TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
|
|
17
|
+
*/
|
package/umd/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
-
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
|
-
/**
|
|
4
|
-
* ScriptExecutionTools for JavaScript implemented via eval
|
|
5
|
-
*
|
|
6
|
-
* Warning: It is used for testing and mocking
|
|
7
|
-
* **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare class JavascriptEvalExecutionTools implements ScriptExecutionTools {
|
|
10
|
-
private readonly options;
|
|
11
|
-
constructor(options: JavascriptExecutionToolsOptions);
|
|
12
|
-
/**
|
|
13
|
-
* Executes a JavaScript
|
|
14
|
-
*/
|
|
15
|
-
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
|
|
19
|
-
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
20
|
-
*/
|
|
1
|
+
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
+
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* ScriptExecutionTools for JavaScript implemented via eval
|
|
5
|
+
*
|
|
6
|
+
* Warning: It is used for testing and mocking
|
|
7
|
+
* **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare class JavascriptEvalExecutionTools implements ScriptExecutionTools {
|
|
10
|
+
private readonly options;
|
|
11
|
+
constructor(options: JavascriptExecutionToolsOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Executes a JavaScript
|
|
14
|
+
*/
|
|
15
|
+
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
|
|
19
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
20
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
/**
|
|
3
|
-
* TODO: !! Make shared test between JavascriptEvalExecutionTools and JavascriptExecutionTools to test the same functionality when implemented via vm2
|
|
4
|
-
*/
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* TODO: !! Make shared test between JavascriptEvalExecutionTools and JavascriptExecutionTools to test the same functionality when implemented via vm2
|
|
4
|
+
*/
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
-
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
|
-
/**
|
|
4
|
-
* ScriptExecutionTools for JavaScript implemented via vm2
|
|
5
|
-
*
|
|
6
|
-
* Warning: This is not implemented yet
|
|
7
|
-
*/
|
|
8
|
-
export declare class JavascriptExecutionTools implements ScriptExecutionTools {
|
|
9
|
-
private readonly options;
|
|
10
|
-
constructor(options: JavascriptExecutionToolsOptions);
|
|
11
|
-
/**
|
|
12
|
-
* Executes a JavaScript
|
|
13
|
-
*/
|
|
14
|
-
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* TODO: !! Pass isVerbose to constructor and use it
|
|
18
|
-
* TODO: !! Probbably make some common util createStatementToEvaluate
|
|
19
|
-
* TODO: !! Implement via vm2
|
|
20
|
-
*/
|
|
1
|
+
import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../../../ScriptExecutionTools';
|
|
2
|
+
import { JavascriptExecutionToolsOptions } from './JavascriptExecutionToolsOptions';
|
|
3
|
+
/**
|
|
4
|
+
* ScriptExecutionTools for JavaScript implemented via vm2
|
|
5
|
+
*
|
|
6
|
+
* Warning: This is not implemented yet
|
|
7
|
+
*/
|
|
8
|
+
export declare class JavascriptExecutionTools implements ScriptExecutionTools {
|
|
9
|
+
private readonly options;
|
|
10
|
+
constructor(options: JavascriptExecutionToolsOptions);
|
|
11
|
+
/**
|
|
12
|
+
* Executes a JavaScript
|
|
13
|
+
*/
|
|
14
|
+
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* TODO: !! Pass isVerbose to constructor and use it
|
|
18
|
+
* TODO: !! Probbably make some common util createStatementToEvaluate
|
|
19
|
+
* TODO: !! Implement via vm2
|
|
20
|
+
*/
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { Promisable } from 'type-fest';
|
|
2
|
-
import type { string_javascript_name } from '../../../../types/typeAliases';
|
|
3
|
-
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
4
|
-
/**
|
|
5
|
-
* Options for javascript execution
|
|
6
|
-
*/
|
|
7
|
-
export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
-
/**
|
|
9
|
-
* Functions to be executed in the JavaScript evaluation.
|
|
10
|
-
*
|
|
11
|
-
* This can be used in two ways:
|
|
12
|
-
* 1. To provide custom postprocessing functions. For this case function must receive one string and return a (promise of) string.
|
|
13
|
-
* 2. As environment for the ECECUTE SCRIPT, For this case function can be any function. [0]
|
|
14
|
-
*
|
|
15
|
-
* Note: There are also some built-in functions available:
|
|
16
|
-
* @see ./JavascriptEvalExecutionTools.ts
|
|
17
|
-
*/
|
|
18
|
-
functions?: Record<string_javascript_name, ((value: string) => Promisable<string>) | Function>;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
22
|
-
*/
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { string_javascript_name } from '../../../../types/typeAliases';
|
|
3
|
+
import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
|
|
4
|
+
/**
|
|
5
|
+
* Options for javascript execution
|
|
6
|
+
*/
|
|
7
|
+
export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
+
/**
|
|
9
|
+
* Functions to be executed in the JavaScript evaluation.
|
|
10
|
+
*
|
|
11
|
+
* This can be used in two ways:
|
|
12
|
+
* 1. To provide custom postprocessing functions. For this case function must receive one string and return a (promise of) string.
|
|
13
|
+
* 2. As environment for the ECECUTE SCRIPT, For this case function can be any function. [0]
|
|
14
|
+
*
|
|
15
|
+
* Note: There are also some built-in functions available:
|
|
16
|
+
* @see ./JavascriptEvalExecutionTools.ts
|
|
17
|
+
*/
|
|
18
|
+
functions?: Record<string_javascript_name, ((value: string) => Promisable<string>) | Function>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
22
|
+
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Does nothing, but preserves the function in the bundle
|
|
3
|
-
* Compiler is tricked into thinking the function is used
|
|
4
|
-
*
|
|
5
|
-
* @param value any function to preserve
|
|
6
|
-
* @returns nothing
|
|
7
|
-
*/
|
|
8
|
-
export declare function preserve(func: (...params: Array<any>) => unknown): void;
|
|
9
|
-
/**
|
|
10
|
-
* TODO: !! [1] This maybe does memory leak
|
|
11
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
* Does nothing, but preserves the function in the bundle
|
|
3
|
+
* Compiler is tricked into thinking the function is used
|
|
4
|
+
*
|
|
5
|
+
* @param value any function to preserve
|
|
6
|
+
* @returns nothing
|
|
7
|
+
*/
|
|
8
|
+
export declare function preserve(func: (...params: Array<any>) => unknown): void;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: !! [1] This maybe does memory leak
|
|
11
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|