@promptbook/markdown-utils 0.61.0-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +698 -0
- package/esm/index.es.js +479 -0
- package/esm/index.es.js.map +1 -0
- package/esm/typings/promptbook-collection/index.d.ts +82 -0
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +5 -0
- package/esm/typings/src/_packages/azure-openai.index.d.ts +4 -0
- package/esm/typings/src/_packages/cli.index.d.ts +10 -0
- package/esm/typings/src/_packages/core.index.d.ts +44 -0
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +48 -0
- package/esm/typings/src/_packages/fake-llm.index.d.ts +7 -0
- package/esm/typings/src/_packages/langtail.index.d.ts +4 -0
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +17 -0
- package/esm/typings/src/_packages/node.index.d.ts +4 -0
- package/esm/typings/src/_packages/openai.index.d.ts +5 -0
- package/esm/typings/src/_packages/remote-client.index.d.ts +5 -0
- package/esm/typings/src/_packages/remote-server.index.d.ts +4 -0
- package/esm/typings/src/_packages/types.index.d.ts +38 -0
- package/esm/typings/src/_packages/utils.index.d.ts +74 -0
- package/esm/typings/src/cli/cli-commands/hello.d.ts +7 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +7 -0
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +7 -0
- package/esm/typings/src/cli/promptbookCli.d.ts +9 -0
- package/esm/typings/src/collection/PipelineCollection.d.ts +25 -0
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +38 -0
- package/esm/typings/src/collection/collectionToJson.d.ts +11 -0
- package/esm/typings/src/collection/collectionToJson.test.d.ts +7 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +47 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +12 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +22 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +29 -0
- package/esm/typings/src/collection/constructors/createSubcollection.d.ts +12 -0
- package/esm/typings/src/collection/constructors/justTestFsImport.d.ts +7 -0
- package/esm/typings/src/commands/BLOCK/BlockCommand.d.ts +11 -0
- package/esm/typings/src/commands/BLOCK/BlockTypes.d.ts +13 -0
- package/esm/typings/src/commands/BLOCK/blockCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/BLOCK/blockCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/EXPECT/ExpectAmountCommand.d.ts +14 -0
- package/esm/typings/src/commands/EXPECT/ExpectCommand.d.ts +9 -0
- package/esm/typings/src/commands/EXPECT/ExpectFormatCommand.d.ts +7 -0
- package/esm/typings/src/commands/EXPECT/expectCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/JOKER/JokerCommand.d.ts +11 -0
- package/esm/typings/src/commands/JOKER/jokerCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +12 -0
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +13 -0
- package/esm/typings/src/commands/MODEL/modelCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/MODEL/modelCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PARAMETER/ParameterCommand.d.ts +15 -0
- package/esm/typings/src/commands/PARAMETER/parameterCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +11 -0
- package/esm/typings/src/commands/PERSONA/personaCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PERSONA/personaCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/POSTPROCESS/PostprocessCommand.d.ts +11 -0
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +11 -0
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/URL/UrlCommand.d.ts +10 -0
- package/esm/typings/src/commands/URL/urlCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/URL/urlCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/X_ACTION/ActionCommand.d.ts +9 -0
- package/esm/typings/src/commands/X_ACTION/actionCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +9 -0
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +10 -0
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +12 -0
- package/esm/typings/src/commands/_common/parseCommand.d.ts +12 -0
- package/esm/typings/src/commands/_common/parseCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/_common/types/Command.d.ts +6 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -0
- package/esm/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +9 -0
- package/esm/typings/src/commands/index.d.ts +4 -0
- package/esm/typings/src/config.d.ts +16 -0
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +14 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +31 -0
- package/esm/typings/src/conversion/pipelineStringToJson.test.d.ts +1 -0
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +25 -0
- package/esm/typings/src/conversion/pipelineStringToJsonSync.test.d.ts +1 -0
- package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +13 -0
- package/esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts +10 -0
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +25 -0
- package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +13 -0
- package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/extractVariables.d.ts +13 -0
- package/esm/typings/src/conversion/utils/extractVariables.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +25 -0
- package/esm/typings/src/conversion/utils/renameParameter.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/titleToName.d.ts +4 -0
- package/esm/typings/src/conversion/utils/titleToName.test.d.ts +1 -0
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +13 -0
- package/esm/typings/src/conversion/validation/pipelineStringToJson-syntaxErrors.test.d.ts +1 -0
- package/esm/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +4 -0
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +27 -0
- package/esm/typings/src/conversion/validation/validatePipeline.test.d.ts +1 -0
- package/esm/typings/src/errors/CollectionError.d.ts +7 -0
- package/esm/typings/src/errors/NotFoundError.d.ts +7 -0
- package/esm/typings/src/errors/NotYetImplementedError.d.ts +7 -0
- package/esm/typings/src/errors/ParsingError.d.ts +7 -0
- package/esm/typings/src/errors/PipelineExecutionError.d.ts +7 -0
- package/esm/typings/src/errors/PipelineLogicError.d.ts +7 -0
- package/esm/typings/src/errors/ReferenceError.d.ts +7 -0
- package/esm/typings/src/errors/UnexpectedError.d.ts +7 -0
- package/esm/typings/src/errors/_ExpectError.d.ts +10 -0
- package/esm/typings/src/execution/CommonExecutionToolsOptions.d.ts +9 -0
- package/esm/typings/src/execution/EmbeddingVector.d.ts +8 -0
- package/esm/typings/src/execution/ExecutionTools.d.ts +33 -0
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +70 -0
- package/esm/typings/src/execution/PipelineExecutor.d.ts +42 -0
- package/esm/typings/src/execution/PromptResult.d.ts +114 -0
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +38 -0
- package/esm/typings/src/execution/UserInterfaceTools.d.ts +46 -0
- package/esm/typings/src/execution/addPromptResultUsage.test.d.ts +1 -0
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +11 -0
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +42 -0
- package/esm/typings/src/execution/embeddingVectorToString.d.ts +5 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
- package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
- package/esm/typings/src/execution/utils/addUsage.d.ts +7 -0
- package/esm/typings/src/execution/utils/addUsage.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +25 -0
- package/esm/typings/src/execution/utils/checkExpectations.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/computeUsageCounts.d.ts +10 -0
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +18 -0
- package/esm/typings/src/execution/utils/replaceParameters.d.ts +13 -0
- package/esm/typings/src/execution/utils/replaceParameters.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +9 -0
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +10 -0
- package/esm/typings/src/execution/utils/usageToWorktime.test.d.ts +1 -0
- package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +6 -0
- package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +6 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +69 -0
- package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +11 -0
- package/esm/typings/src/formats/index.d.ts +4 -0
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +15 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +4 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.test.d.ts +1 -0
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +13 -0
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +15 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +15 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
- package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +17 -0
- package/esm/typings/src/knowledge/dialogs/user-interface-execution-tools.test.d.ts +1 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +2 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +26 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +19 -0
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +48 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +8 -0
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +22 -0
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +47 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +35 -0
- package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +12 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
- package/esm/typings/src/llm-providers/langtail/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +34 -0
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +38 -0
- package/esm/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +14 -0
- package/esm/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/test/joker.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
- package/esm/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +50 -0
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +16 -0
- package/esm/typings/src/llm-providers/multiple/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +65 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +18 -0
- package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +14 -0
- package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +16 -0
- package/esm/typings/src/llm-providers/openai/computeUsage.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +27 -0
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +52 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +24 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +28 -0
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +19 -0
- package/esm/typings/src/personas/personaToModelRequirements.d.ts +6 -0
- package/esm/typings/src/scripting/_test/custom-function-async.test.ts.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function-missing.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function-with-dependencies.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/postprocessing.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/script-execution-errors.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/script-execution-tools.test.d.ts +1 -0
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +7 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +12 -0
- package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +7 -0
- package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +16 -0
- package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +16 -0
- package/esm/typings/src/types/Arrayable.d.ts +10 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +43 -0
- package/esm/typings/src/types/Parameters.d.ts +14 -0
- package/esm/typings/src/types/PipelineJson/Expectations.d.ts +28 -0
- package/esm/typings/src/types/PipelineJson/KnowledgeJson.d.ts +6 -0
- package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +16 -0
- package/esm/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +28 -0
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +61 -0
- package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +7 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +9 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +77 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +26 -0
- package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +14 -0
- package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +7 -0
- package/esm/typings/src/types/PipelineString.d.ts +12 -0
- package/esm/typings/src/types/Prompt.d.ts +65 -0
- package/esm/typings/src/types/ScriptLanguage.d.ts +9 -0
- package/esm/typings/src/types/TaskProgress.d.ts +43 -0
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +58 -0
- package/esm/typings/src/types/execution-report/ExecutionReportString.d.ts +16 -0
- package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
- package/esm/typings/src/types/execution-report/config.d.ts +8 -0
- package/esm/typings/src/types/execution-report/countWorkingDuration.d.ts +7 -0
- package/esm/typings/src/types/execution-report/countWorkingDuration.test.d.ts +1 -0
- package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +11 -0
- package/esm/typings/src/types/typeAliasEmoji.d.ts +9 -0
- package/esm/typings/src/types/typeAliases.d.ts +480 -0
- package/esm/typings/src/utils/FromtoItems.d.ts +19 -0
- package/esm/typings/src/utils/arrayableToArray.d.ts +11 -0
- package/esm/typings/src/utils/arrayableToArray.test.d.ts +1 -0
- package/esm/typings/src/utils/emojis.d.ts +23 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +5 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +5 -0
- package/esm/typings/src/utils/expectation-counters/countLines.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +5 -0
- package/esm/typings/src/utils/expectation-counters/countPages.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +5 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +9 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +5 -0
- package/esm/typings/src/utils/expectation-counters/countWords.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +6 -0
- package/esm/typings/src/utils/extractParameters.d.ts +9 -0
- package/esm/typings/src/utils/extractParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/formatNumber.d.ts +6 -0
- package/esm/typings/src/utils/formatNumber.test.d.ts +1 -0
- package/esm/typings/src/utils/getCurrentIsoDate.d.ts +7 -0
- package/esm/typings/src/utils/isRunningInWhatever.d.ts +12 -0
- package/esm/typings/src/utils/just.d.ts +10 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +11 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +41 -0
- package/esm/typings/src/utils/markdown/createMarkdownChart.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +8 -0
- package/esm/typings/src/utils/markdown/createMarkdownTable.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +14 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +14 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +30 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/prettifyMarkdown.d.ts +9 -0
- package/esm/typings/src/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeContentComments.d.ts +9 -0
- package/esm/typings/src/utils/markdown/removeContentComments.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +12 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
- package/esm/typings/src/utils/normalization/IKeywords.d.ts +18 -0
- package/esm/typings/src/utils/normalization/capitalize.d.ts +5 -0
- package/esm/typings/src/utils/normalization/capitalize.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/decapitalize.d.ts +5 -0
- package/esm/typings/src/utils/normalization/decapitalize.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.d.ts +8 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +8 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +8 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +16 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +11 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +8 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +14 -0
- package/esm/typings/src/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +8 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +4 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +5 -0
- package/esm/typings/src/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/esm/typings/src/utils/parseNumber.d.ts +15 -0
- package/esm/typings/src/utils/parseNumber.test.d.ts +1 -0
- package/esm/typings/src/utils/postprocessing/extractBlock.d.ts +12 -0
- package/esm/typings/src/utils/removeEmojis.d.ts +7 -0
- package/esm/typings/src/utils/removeEmojis.test.d.ts +1 -0
- package/esm/typings/src/utils/removeQuotes.d.ts +13 -0
- package/esm/typings/src/utils/removeQuotes.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/difference.d.ts +6 -0
- package/esm/typings/src/utils/sets/difference.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/intersection.d.ts +6 -0
- package/esm/typings/src/utils/sets/intersection.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/union.d.ts +6 -0
- package/esm/typings/src/utils/sets/union.test.d.ts +1 -0
- package/esm/typings/src/utils/trimCodeBlock.d.ts +8 -0
- package/esm/typings/src/utils/trimCodeBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +7 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/unwrapResult.d.ts +36 -0
- package/esm/typings/src/utils/unwrapResult.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/email/isValidEmail.d.ts +5 -0
- package/esm/typings/src/utils/validators/email/isValidEmail.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +7 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +12 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +9 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +9 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +12 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +12 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +10 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +5 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +1 -0
- package/esm/typings/src/version.d.ts +6 -0
- package/package.json +55 -0
- package/umd/index.umd.js +502 -0
- package/umd/index.umd.js.map +1 -0
- package/umd/typings/promptbook-collection/index.d.ts +82 -0
- package/umd/typings/src/_packages/anthropic-claude.index.d.ts +5 -0
- package/umd/typings/src/_packages/azure-openai.index.d.ts +4 -0
- package/umd/typings/src/_packages/cli.index.d.ts +10 -0
- package/umd/typings/src/_packages/core.index.d.ts +44 -0
- package/umd/typings/src/_packages/execute-javascript.index.d.ts +48 -0
- package/umd/typings/src/_packages/fake-llm.index.d.ts +7 -0
- package/umd/typings/src/_packages/langtail.index.d.ts +4 -0
- package/umd/typings/src/_packages/markdown-utils.index.d.ts +17 -0
- package/umd/typings/src/_packages/node.index.d.ts +4 -0
- package/umd/typings/src/_packages/openai.index.d.ts +5 -0
- package/umd/typings/src/_packages/remote-client.index.d.ts +5 -0
- package/umd/typings/src/_packages/remote-server.index.d.ts +4 -0
- package/umd/typings/src/_packages/types.index.d.ts +38 -0
- package/umd/typings/src/_packages/utils.index.d.ts +74 -0
- package/umd/typings/src/cli/cli-commands/hello.d.ts +7 -0
- package/umd/typings/src/cli/cli-commands/make.d.ts +7 -0
- package/umd/typings/src/cli/cli-commands/prettify.d.ts +7 -0
- package/umd/typings/src/cli/promptbookCli.d.ts +9 -0
- package/umd/typings/src/collection/PipelineCollection.d.ts +25 -0
- package/umd/typings/src/collection/SimplePipelineCollection.d.ts +38 -0
- package/umd/typings/src/collection/collectionToJson.d.ts +11 -0
- package/umd/typings/src/collection/collectionToJson.test.d.ts +7 -0
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +47 -0
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromJson.d.ts +12 -0
- package/umd/typings/src/collection/constructors/createCollectionFromJson.test.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromPromise.d.ts +22 -0
- package/umd/typings/src/collection/constructors/createCollectionFromPromise.test.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +29 -0
- package/umd/typings/src/collection/constructors/createSubcollection.d.ts +12 -0
- package/umd/typings/src/collection/constructors/justTestFsImport.d.ts +7 -0
- package/umd/typings/src/commands/BLOCK/BlockCommand.d.ts +11 -0
- package/umd/typings/src/commands/BLOCK/BlockTypes.d.ts +13 -0
- package/umd/typings/src/commands/BLOCK/blockCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/BLOCK/blockCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/EXPECT/ExpectAmountCommand.d.ts +14 -0
- package/umd/typings/src/commands/EXPECT/ExpectCommand.d.ts +9 -0
- package/umd/typings/src/commands/EXPECT/ExpectFormatCommand.d.ts +7 -0
- package/umd/typings/src/commands/EXPECT/expectCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/EXPECT/expectCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/JOKER/JokerCommand.d.ts +11 -0
- package/umd/typings/src/commands/JOKER/jokerCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/JOKER/jokerCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +12 -0
- package/umd/typings/src/commands/KNOWLEDGE/knowledgeCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +13 -0
- package/umd/typings/src/commands/MODEL/modelCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/MODEL/modelCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/PARAMETER/ParameterCommand.d.ts +15 -0
- package/umd/typings/src/commands/PARAMETER/parameterCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +11 -0
- package/umd/typings/src/commands/PERSONA/personaCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/PERSONA/personaCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/POSTPROCESS/PostprocessCommand.d.ts +11 -0
- package/umd/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +11 -0
- package/umd/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/URL/UrlCommand.d.ts +10 -0
- package/umd/typings/src/commands/URL/urlCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/URL/urlCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/X_ACTION/ActionCommand.d.ts +9 -0
- package/umd/typings/src/commands/X_ACTION/actionCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/X_ACTION/actionCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +9 -0
- package/umd/typings/src/commands/X_INSTRUMENT/instrumentCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +9 -0
- package/umd/typings/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +10 -0
- package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +12 -0
- package/umd/typings/src/commands/_common/parseCommand.d.ts +12 -0
- package/umd/typings/src/commands/_common/parseCommand.test.d.ts +1 -0
- package/umd/typings/src/commands/_common/types/Command.d.ts +6 -0
- package/umd/typings/src/commands/_common/types/CommandParser.d.ts +36 -0
- package/umd/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +9 -0
- package/umd/typings/src/commands/index.d.ts +4 -0
- package/umd/typings/src/config.d.ts +16 -0
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +14 -0
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +31 -0
- package/umd/typings/src/conversion/pipelineStringToJson.test.d.ts +1 -0
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +25 -0
- package/umd/typings/src/conversion/pipelineStringToJsonSync.test.d.ts +1 -0
- package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +13 -0
- package/umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts +10 -0
- package/umd/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +25 -0
- package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +13 -0
- package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.test.d.ts +1 -0
- package/umd/typings/src/conversion/utils/extractVariables.d.ts +13 -0
- package/umd/typings/src/conversion/utils/extractVariables.test.d.ts +1 -0
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +25 -0
- package/umd/typings/src/conversion/utils/renameParameter.test.d.ts +1 -0
- package/umd/typings/src/conversion/utils/titleToName.d.ts +4 -0
- package/umd/typings/src/conversion/utils/titleToName.test.d.ts +1 -0
- package/umd/typings/src/conversion/validation/_importPipeline.d.ts +13 -0
- package/umd/typings/src/conversion/validation/pipelineStringToJson-syntaxErrors.test.d.ts +1 -0
- package/umd/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +4 -0
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +27 -0
- package/umd/typings/src/conversion/validation/validatePipeline.test.d.ts +1 -0
- package/umd/typings/src/errors/CollectionError.d.ts +7 -0
- package/umd/typings/src/errors/NotFoundError.d.ts +7 -0
- package/umd/typings/src/errors/NotYetImplementedError.d.ts +7 -0
- package/umd/typings/src/errors/ParsingError.d.ts +7 -0
- package/umd/typings/src/errors/PipelineExecutionError.d.ts +7 -0
- package/umd/typings/src/errors/PipelineLogicError.d.ts +7 -0
- package/umd/typings/src/errors/ReferenceError.d.ts +7 -0
- package/umd/typings/src/errors/UnexpectedError.d.ts +7 -0
- package/umd/typings/src/errors/_ExpectError.d.ts +10 -0
- package/umd/typings/src/execution/CommonExecutionToolsOptions.d.ts +9 -0
- package/umd/typings/src/execution/EmbeddingVector.d.ts +8 -0
- package/umd/typings/src/execution/ExecutionTools.d.ts +33 -0
- package/umd/typings/src/execution/LlmExecutionTools.d.ts +70 -0
- package/umd/typings/src/execution/PipelineExecutor.d.ts +42 -0
- package/umd/typings/src/execution/PromptResult.d.ts +114 -0
- package/umd/typings/src/execution/ScriptExecutionTools.d.ts +38 -0
- package/umd/typings/src/execution/UserInterfaceTools.d.ts +46 -0
- package/umd/typings/src/execution/addPromptResultUsage.test.d.ts +1 -0
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +11 -0
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +42 -0
- package/umd/typings/src/execution/embeddingVectorToString.d.ts +5 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
- package/umd/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
- package/umd/typings/src/execution/utils/addUsage.d.ts +7 -0
- package/umd/typings/src/execution/utils/addUsage.test.d.ts +1 -0
- package/umd/typings/src/execution/utils/checkExpectations.d.ts +25 -0
- package/umd/typings/src/execution/utils/checkExpectations.test.d.ts +1 -0
- package/umd/typings/src/execution/utils/computeUsageCounts.d.ts +10 -0
- package/umd/typings/src/execution/utils/forEachAsync.d.ts +18 -0
- package/umd/typings/src/execution/utils/replaceParameters.d.ts +13 -0
- package/umd/typings/src/execution/utils/replaceParameters.test.d.ts +1 -0
- package/umd/typings/src/execution/utils/uncertainNumber.d.ts +9 -0
- package/umd/typings/src/execution/utils/usageToWorktime.d.ts +10 -0
- package/umd/typings/src/execution/utils/usageToWorktime.test.d.ts +1 -0
- package/umd/typings/src/expectations/drafts/isDomainNameFree.d.ts +6 -0
- package/umd/typings/src/expectations/drafts/isGithubNameFree.d.ts +6 -0
- package/umd/typings/src/formats/_common/FormatDefinition.d.ts +69 -0
- package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +11 -0
- package/umd/typings/src/formats/index.d.ts +4 -0
- package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +15 -0
- package/umd/typings/src/formats/json/utils/isValidJsonString.d.ts +4 -0
- package/umd/typings/src/formats/json/utils/isValidJsonString.test.d.ts +1 -0
- package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +13 -0
- package/umd/typings/src/formats/xml/XmlFormatDefinition.d.ts +15 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +15 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
- package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +17 -0
- package/umd/typings/src/knowledge/dialogs/user-interface-execution-tools.test.d.ts +1 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +2 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +26 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +1 -0
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +19 -0
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +48 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +8 -0
- package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +22 -0
- package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +2 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +47 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +35 -0
- package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +2 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +12 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
- package/umd/typings/src/llm-providers/langtail/playground/playground.d.ts +2 -0
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +34 -0
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +38 -0
- package/umd/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +14 -0
- package/umd/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/mocked/test/joker.test.d.ts +4 -0
- package/umd/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
- package/umd/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +4 -0
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +50 -0
- package/umd/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +16 -0
- package/umd/typings/src/llm-providers/multiple/playground/playground.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +65 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +18 -0
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +14 -0
- package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +16 -0
- package/umd/typings/src/llm-providers/openai/computeUsage.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +27 -0
- package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +2 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +52 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +24 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
- package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +28 -0
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +19 -0
- package/umd/typings/src/personas/personaToModelRequirements.d.ts +6 -0
- package/umd/typings/src/scripting/_test/custom-function-async.test.ts.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/custom-function-missing.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/custom-function-with-dependencies.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/custom-function.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/postprocessing.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/script-execution-errors.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/script-execution-tools.test.d.ts +1 -0
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +7 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
- package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +12 -0
- package/umd/typings/src/scripting/javascript/utils/unknownToString.d.ts +7 -0
- package/umd/typings/src/scripting/python/PythonExecutionTools.d.ts +16 -0
- package/umd/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +16 -0
- package/umd/typings/src/types/Arrayable.d.ts +10 -0
- package/umd/typings/src/types/ModelRequirements.d.ts +43 -0
- package/umd/typings/src/types/Parameters.d.ts +14 -0
- package/umd/typings/src/types/PipelineJson/Expectations.d.ts +28 -0
- package/umd/typings/src/types/PipelineJson/KnowledgeJson.d.ts +6 -0
- package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +16 -0
- package/umd/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +28 -0
- package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +61 -0
- package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +7 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +9 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +77 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +26 -0
- package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +14 -0
- package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +7 -0
- package/umd/typings/src/types/PipelineString.d.ts +12 -0
- package/umd/typings/src/types/Prompt.d.ts +65 -0
- package/umd/typings/src/types/ScriptLanguage.d.ts +9 -0
- package/umd/typings/src/types/TaskProgress.d.ts +43 -0
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +58 -0
- package/umd/typings/src/types/execution-report/ExecutionReportString.d.ts +16 -0
- package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
- package/umd/typings/src/types/execution-report/config.d.ts +8 -0
- package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +7 -0
- package/umd/typings/src/types/execution-report/countWorkingDuration.test.d.ts +1 -0
- package/umd/typings/src/types/execution-report/executionReportJsonToString.d.ts +11 -0
- package/umd/typings/src/types/typeAliasEmoji.d.ts +9 -0
- package/umd/typings/src/types/typeAliases.d.ts +480 -0
- package/umd/typings/src/utils/FromtoItems.d.ts +19 -0
- package/umd/typings/src/utils/arrayableToArray.d.ts +11 -0
- package/umd/typings/src/utils/arrayableToArray.test.d.ts +1 -0
- package/umd/typings/src/utils/emojis.d.ts +23 -0
- package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +5 -0
- package/umd/typings/src/utils/expectation-counters/countCharacters.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countLines.d.ts +5 -0
- package/umd/typings/src/utils/expectation-counters/countLines.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countPages.d.ts +5 -0
- package/umd/typings/src/utils/expectation-counters/countPages.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +5 -0
- package/umd/typings/src/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +9 -0
- package/umd/typings/src/utils/expectation-counters/countSentences.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countWords.d.ts +5 -0
- package/umd/typings/src/utils/expectation-counters/countWords.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/index.d.ts +6 -0
- package/umd/typings/src/utils/extractParameters.d.ts +9 -0
- package/umd/typings/src/utils/extractParameters.test.d.ts +1 -0
- package/umd/typings/src/utils/formatNumber.d.ts +6 -0
- package/umd/typings/src/utils/formatNumber.test.d.ts +1 -0
- package/umd/typings/src/utils/getCurrentIsoDate.d.ts +7 -0
- package/umd/typings/src/utils/isRunningInWhatever.d.ts +12 -0
- package/umd/typings/src/utils/just.d.ts +10 -0
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +11 -0
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +41 -0
- package/umd/typings/src/utils/markdown/createMarkdownChart.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +8 -0
- package/umd/typings/src/utils/markdown/createMarkdownTable.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +14 -0
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/flattenMarkdown.d.ts +14 -0
- package/umd/typings/src/utils/markdown/flattenMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +30 -0
- package/umd/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/prettifyMarkdown.d.ts +9 -0
- package/umd/typings/src/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/removeContentComments.d.ts +9 -0
- package/umd/typings/src/utils/markdown/removeContentComments.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +12 -0
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
- package/umd/typings/src/utils/normalization/IKeywords.d.ts +18 -0
- package/umd/typings/src/utils/normalization/capitalize.d.ts +5 -0
- package/umd/typings/src/utils/normalization/capitalize.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/decapitalize.d.ts +5 -0
- package/umd/typings/src/utils/normalization/decapitalize.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/isValidKeyword.d.ts +8 -0
- package/umd/typings/src/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/nameToUriPart.d.ts +1 -0
- package/umd/typings/src/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/nameToUriParts.d.ts +1 -0
- package/umd/typings/src/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +8 -0
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +8 -0
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +16 -0
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +11 -0
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +8 -0
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/umd/typings/src/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/parseKeywords.d.ts +14 -0
- package/umd/typings/src/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.d.ts +8 -0
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/removeDiacritics.d.ts +4 -0
- package/umd/typings/src/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/searchKeywords.d.ts +5 -0
- package/umd/typings/src/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/umd/typings/src/utils/parseNumber.d.ts +15 -0
- package/umd/typings/src/utils/parseNumber.test.d.ts +1 -0
- package/umd/typings/src/utils/postprocessing/extractBlock.d.ts +12 -0
- package/umd/typings/src/utils/removeEmojis.d.ts +7 -0
- package/umd/typings/src/utils/removeEmojis.test.d.ts +1 -0
- package/umd/typings/src/utils/removeQuotes.d.ts +13 -0
- package/umd/typings/src/utils/removeQuotes.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/difference.d.ts +6 -0
- package/umd/typings/src/utils/sets/difference.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/intersection.d.ts +6 -0
- package/umd/typings/src/utils/sets/intersection.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/union.d.ts +6 -0
- package/umd/typings/src/utils/sets/union.test.d.ts +1 -0
- package/umd/typings/src/utils/trimCodeBlock.d.ts +8 -0
- package/umd/typings/src/utils/trimCodeBlock.test.d.ts +1 -0
- package/umd/typings/src/utils/trimEndOfCodeBlock.d.ts +7 -0
- package/umd/typings/src/utils/trimEndOfCodeBlock.test.d.ts +1 -0
- package/umd/typings/src/utils/unwrapResult.d.ts +36 -0
- package/umd/typings/src/utils/unwrapResult.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/email/isValidEmail.d.ts +5 -0
- package/umd/typings/src/utils/validators/email/isValidEmail.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +7 -0
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -0
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +12 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +9 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +9 -0
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +12 -0
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +12 -0
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +10 -0
- package/umd/typings/src/utils/validators/url/isValidUrl.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +5 -0
- package/umd/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +1 -0
- package/umd/typings/src/version.d.ts +6 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineString } from '../../types/PipelineString';
|
|
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
|
+
* @param path - The path to the file relative to samples/templates directory
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
export declare function importPipeline(path: `${string}.ptbk.md`): PipelineString;
|
|
13
|
+
export declare function importPipeline(path: `${string}.ptbk.json`): PipelineJson;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
2
|
+
/**
|
|
3
|
+
* Validates PipelineJson 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 pipeline valid or invalid PipelineJson
|
|
13
|
+
* @returns the same pipeline if it is logically valid
|
|
14
|
+
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
15
|
+
*/
|
|
16
|
+
export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
|
|
17
|
+
/**
|
|
18
|
+
* TODO: [🧠] Work with promptbookVersion
|
|
19
|
+
* TODO: Use here some json-schema, Zod or something similar and change it to:
|
|
20
|
+
* > /**
|
|
21
|
+
* > * Validates PipelineJson if it is logically valid.
|
|
22
|
+
* > *
|
|
23
|
+
* > * It checks:
|
|
24
|
+
* > * - it has a valid structure
|
|
25
|
+
* > * - ...
|
|
26
|
+
* > ex port function validatePipeline(promptbook: unknown): asserts promptbook is PipelineJson {
|
|
27
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +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 PipelineLogicError extends Error {
|
|
5
|
+
readonly name = "PipelineLogicError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
3
|
+
*
|
|
4
|
+
* @private Always catched and rethrown as `PipelineExecutionError`
|
|
5
|
+
* Note: This is a kindof subtype of PipelineExecutionError
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExpectError extends Error {
|
|
8
|
+
readonly name = "ExpectError";
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Arrayable } from '../types/Arrayable';
|
|
2
|
+
import type { LlmExecutionTools } from './LlmExecutionTools';
|
|
3
|
+
import type { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
4
|
+
import type { UserInterfaceTools } from './UserInterfaceTools';
|
|
5
|
+
/**
|
|
6
|
+
* All the tools needed to execute pipelines.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/webgptorg/promptbook#execution-tools
|
|
9
|
+
*/
|
|
10
|
+
export type ExecutionTools = {
|
|
11
|
+
/**
|
|
12
|
+
* Tools for executing prompts to large language models like GPT-4
|
|
13
|
+
*
|
|
14
|
+
* Tip: Combine multiple LLM execution tools - use array of LlmExecutionTools instead of single LlmExecutionTools
|
|
15
|
+
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#llm-execution-tools
|
|
16
|
+
*/
|
|
17
|
+
llm?: Arrayable<LlmExecutionTools>;
|
|
18
|
+
/**
|
|
19
|
+
* Tools for executing scripts
|
|
20
|
+
*
|
|
21
|
+
* Note: You can pass multiple ScriptExecutionTools, they will be tried one by one until one of them supports the script
|
|
22
|
+
* If none of them supports the script, an error is thrown
|
|
23
|
+
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#script-execution-tools
|
|
24
|
+
*/
|
|
25
|
+
script?: Arrayable<ScriptExecutionTools>;
|
|
26
|
+
/**
|
|
27
|
+
* Tools for interacting with the user
|
|
28
|
+
*
|
|
29
|
+
* Note: When undefined, the user interface is disabled and promptbook which requires user interaction will fail
|
|
30
|
+
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#user-interface-tools
|
|
31
|
+
*/
|
|
32
|
+
userInterface?: UserInterfaceTools;
|
|
33
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { ModelVariant } from '../types/ModelRequirements';
|
|
3
|
+
import type { Prompt } from '../types/Prompt';
|
|
4
|
+
import type { string_markdown } from '../types/typeAliases';
|
|
5
|
+
import type { string_markdown_text } from '../types/typeAliases';
|
|
6
|
+
import type { string_model_name } from '../types/typeAliases';
|
|
7
|
+
import type { string_title } from '../types/typeAliases';
|
|
8
|
+
import type { PromptChatResult } from './PromptResult';
|
|
9
|
+
import type { PromptCompletionResult } from './PromptResult';
|
|
10
|
+
import type { PromptEmbeddingResult } from './PromptResult';
|
|
11
|
+
/**
|
|
12
|
+
* Container for all the tools needed to execute prompts to large language models like GPT-4
|
|
13
|
+
* On its interface it exposes common methods for prompt execution.
|
|
14
|
+
* Inside (in constructor) it calls OpenAI, Azure, GPU, proxy, cache, logging,...
|
|
15
|
+
*
|
|
16
|
+
* @see https://github.com/webgptorg/promptbook#llm-execution-tools
|
|
17
|
+
*/
|
|
18
|
+
export type LlmExecutionTools = {
|
|
19
|
+
/**
|
|
20
|
+
* Title of the model provider
|
|
21
|
+
*
|
|
22
|
+
* @example "OpenAI"
|
|
23
|
+
*/
|
|
24
|
+
readonly title: string_title & string_markdown_text;
|
|
25
|
+
/**
|
|
26
|
+
* Description of the provider
|
|
27
|
+
*
|
|
28
|
+
* @example "Use all models from OpenAI"
|
|
29
|
+
*/
|
|
30
|
+
readonly description: string_markdown;
|
|
31
|
+
/**
|
|
32
|
+
* Calls a chat model
|
|
33
|
+
*/
|
|
34
|
+
callChatModel?(prompt: Prompt): Promise<PromptChatResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Calls a completion model
|
|
37
|
+
*/
|
|
38
|
+
callCompletionModel?(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Calls an embedding model
|
|
41
|
+
*/
|
|
42
|
+
callEmbeddingModel?(prompt: Prompt): Promise<PromptEmbeddingResult>;
|
|
43
|
+
/**
|
|
44
|
+
* List all available models that can be used
|
|
45
|
+
*/
|
|
46
|
+
listModels(): Promisable<Array<AvailableModel>>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Represents a model that can be used for prompt execution
|
|
50
|
+
*/
|
|
51
|
+
export type AvailableModel = {
|
|
52
|
+
/**
|
|
53
|
+
* The model title
|
|
54
|
+
*/
|
|
55
|
+
readonly modelTitle: string_title;
|
|
56
|
+
/**
|
|
57
|
+
* The model name aviailable
|
|
58
|
+
*/
|
|
59
|
+
readonly modelName: string_model_name;
|
|
60
|
+
/**
|
|
61
|
+
* Variant of the model
|
|
62
|
+
*/
|
|
63
|
+
readonly modelVariant: ModelVariant;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* TODO: !!!! Translation model
|
|
67
|
+
* TODO: [🧠] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
|
|
68
|
+
* TODO: [🍓][♐] Some heuristic to pick the best model in listed models
|
|
69
|
+
* TODO: [🧠] Should or should not there be a word "GPT" in both callCompletionModel and callChatModel
|
|
70
|
+
*/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Promisable } from 'type-fest';
|
|
2
|
+
import type { TaskProgress } from '../types/TaskProgress';
|
|
3
|
+
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
4
|
+
import type { string_name } from '../types/typeAliases';
|
|
5
|
+
import type { PromptResultUsage } from './PromptResult';
|
|
6
|
+
/**
|
|
7
|
+
* Executor is a simple async function that takes INPUT PARAMETERs and returns result parameters _(along with all intermediate parameters and INPUT PARAMETERs = it extends input object)_.
|
|
8
|
+
* Executor is made by combining execution tools and pipeline collection.
|
|
9
|
+
*
|
|
10
|
+
* It can be created with `createPipelineExecutor` function.
|
|
11
|
+
*
|
|
12
|
+
* @see https://github.com/webgptorg/promptbook#executor
|
|
13
|
+
*/
|
|
14
|
+
export type PipelineExecutor = {
|
|
15
|
+
(inputParameters: Record<string_name, string>, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<{
|
|
16
|
+
/**
|
|
17
|
+
* Whether the execution was successful, details are aviable in `executionReport`
|
|
18
|
+
*/
|
|
19
|
+
isSuccessful: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Added usage of whole execution, detailed usage is aviable in `executionReport`
|
|
22
|
+
*/
|
|
23
|
+
usage: PromptResultUsage;
|
|
24
|
+
/**
|
|
25
|
+
* Errors that occured during the execution, details are aviable in `executionReport`
|
|
26
|
+
*/
|
|
27
|
+
errors: Array<Error>;
|
|
28
|
+
/**
|
|
29
|
+
* The report of the execution with all details
|
|
30
|
+
*/
|
|
31
|
+
executionReport: ExecutionReportJson;
|
|
32
|
+
/**
|
|
33
|
+
* Result parameters of the execution
|
|
34
|
+
*
|
|
35
|
+
* Note: If the execution was not successful, there are only some of the result parameters
|
|
36
|
+
*/
|
|
37
|
+
outputParameters: Record<string_name, string>;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* TODO: [🧠] Should this file be in /execution or /types folder?
|
|
42
|
+
*/
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { KebabCase } from 'type-fest';
|
|
2
|
+
import type { ExpectationUnit } from '../types/PipelineJson/Expectations';
|
|
3
|
+
import type { number_positive } from '../types/typeAliases';
|
|
4
|
+
import type { number_usd } from '../types/typeAliases';
|
|
5
|
+
import type { string_date_iso8601 } from '../types/typeAliases';
|
|
6
|
+
import type { string_model_name } from '../types/typeAliases';
|
|
7
|
+
import type { EmbeddingVector } from './EmbeddingVector';
|
|
8
|
+
/**
|
|
9
|
+
* Prompt result is the simplest concept of execution.
|
|
10
|
+
* It is the result of executing one prompt _(NOT a template)_.
|
|
11
|
+
*
|
|
12
|
+
* @see https://github.com/webgptorg/promptbook#prompt-result
|
|
13
|
+
*/
|
|
14
|
+
export type PromptResult = PromptCompletionResult | PromptChatResult | PromptEmbeddingResult;
|
|
15
|
+
/**
|
|
16
|
+
* Prompt completion result
|
|
17
|
+
* It contains only the following text NOT the whole completion
|
|
18
|
+
*/
|
|
19
|
+
export type PromptCompletionResult = PromptCommonResult;
|
|
20
|
+
/**
|
|
21
|
+
* Prompt chat result
|
|
22
|
+
*/
|
|
23
|
+
export type PromptChatResult = PromptCommonResult & {};
|
|
24
|
+
/**
|
|
25
|
+
* Prompt embedding result
|
|
26
|
+
* It contains only the following text NOT the whole completion
|
|
27
|
+
*/
|
|
28
|
+
export type PromptEmbeddingResult = Omit<PromptCommonResult, 'content'> & {
|
|
29
|
+
/**
|
|
30
|
+
* The response from the model
|
|
31
|
+
*/
|
|
32
|
+
content: EmbeddingVector;
|
|
33
|
+
};
|
|
34
|
+
export type PromptCommonResult = {
|
|
35
|
+
/**
|
|
36
|
+
* Exact text response from the model
|
|
37
|
+
*/
|
|
38
|
+
readonly content: string;
|
|
39
|
+
/**
|
|
40
|
+
* Name of the model used to generate the response
|
|
41
|
+
*/
|
|
42
|
+
readonly modelName: string_model_name;
|
|
43
|
+
/**
|
|
44
|
+
* Timing
|
|
45
|
+
*/
|
|
46
|
+
readonly timing: {
|
|
47
|
+
/**
|
|
48
|
+
* Start of the execution
|
|
49
|
+
*/
|
|
50
|
+
start: string_date_iso8601;
|
|
51
|
+
/**
|
|
52
|
+
* First token generated
|
|
53
|
+
*/
|
|
54
|
+
firstToken?: string_date_iso8601;
|
|
55
|
+
/**
|
|
56
|
+
* End of the execution
|
|
57
|
+
*/
|
|
58
|
+
complete: string_date_iso8601;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Usage of the prompt execution
|
|
62
|
+
*/
|
|
63
|
+
readonly usage: PromptResultUsage;
|
|
64
|
+
/**
|
|
65
|
+
* Raw response from the model
|
|
66
|
+
*/
|
|
67
|
+
readonly rawResponse: object;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Usage statistics for one or many prompt results
|
|
71
|
+
*/
|
|
72
|
+
export type PromptResultUsage = {
|
|
73
|
+
/**
|
|
74
|
+
* Cost of the execution in USD
|
|
75
|
+
*
|
|
76
|
+
* Note: If the cost is unknown, the value 0 and isUncertain is true
|
|
77
|
+
*/
|
|
78
|
+
price: UncertainNumber;
|
|
79
|
+
/**
|
|
80
|
+
* Number of whatever used in the input aka. `prompt_tokens`
|
|
81
|
+
*/
|
|
82
|
+
input: PromptResultUsageCounts;
|
|
83
|
+
/**
|
|
84
|
+
* Number of tokens used in the output aka. `completion_tokens`
|
|
85
|
+
*/
|
|
86
|
+
output: PromptResultUsageCounts;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Record of all possible measurable units
|
|
90
|
+
*/
|
|
91
|
+
export type PromptResultUsageCounts = Record<`${KebabCase<'TOKENS' | ExpectationUnit>}Count`, UncertainNumber>;
|
|
92
|
+
/**
|
|
93
|
+
* Number which can be uncertain
|
|
94
|
+
*
|
|
95
|
+
* Note: If the value is completelly unknown, the value 0 and isUncertain is true
|
|
96
|
+
* Note: Not using NaN or null because it looses the value which is better to be uncertain then not to be at all
|
|
97
|
+
*/
|
|
98
|
+
export type UncertainNumber = {
|
|
99
|
+
/**
|
|
100
|
+
* The numeric value
|
|
101
|
+
*/
|
|
102
|
+
value: number_usd & (number_positive | 0);
|
|
103
|
+
/**
|
|
104
|
+
* Is the value uncertain
|
|
105
|
+
*/
|
|
106
|
+
isUncertain?: true;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* TODO: [🧠] Maybe timing more accurate then seconds?
|
|
110
|
+
* TODO: [🧠] Should here be link to the prompt?
|
|
111
|
+
* TODO: [🧠] Maybe type raw properly - not onject but OpenAI.result.whatever
|
|
112
|
+
* TODO: [🧠] Maybe remove redundant raw.choices.text
|
|
113
|
+
* TODO: Log raw even if prompt failed - log the raw error
|
|
114
|
+
*/
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ScriptLanguage } from '../types/ScriptLanguage';
|
|
2
|
+
import type { string_name } from '../types/typeAliases';
|
|
3
|
+
import type { string_script } from '../types/typeAliases';
|
|
4
|
+
/**
|
|
5
|
+
* Represents all the tools needed to EXECUTE SCRIPTs
|
|
6
|
+
*
|
|
7
|
+
* @see https://github.com/webgptorg/promptbook#script-execution-tools
|
|
8
|
+
*/
|
|
9
|
+
export type ScriptExecutionTools = {
|
|
10
|
+
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Input for the script execution
|
|
14
|
+
*/
|
|
15
|
+
export type ScriptExecutionToolsExecuteOptions = {
|
|
16
|
+
/**
|
|
17
|
+
* Language of the script
|
|
18
|
+
*/
|
|
19
|
+
scriptLanguage: ScriptLanguage;
|
|
20
|
+
/**
|
|
21
|
+
* Parameters for the script
|
|
22
|
+
* Theese parameters are passed to the script as variables
|
|
23
|
+
* For example: { "name": "John" } => const name = "John";
|
|
24
|
+
*/
|
|
25
|
+
parameters: Record<string_name, string>;
|
|
26
|
+
/**
|
|
27
|
+
* The content of the script to execute
|
|
28
|
+
* - It can be a single statement
|
|
29
|
+
* - It can be multiple statements separated by semicolon and return
|
|
30
|
+
* - It can be a function (but you need to call it)
|
|
31
|
+
* - It can be IIFE (immediately invoked function expression)
|
|
32
|
+
* - It can use the parameters as variables and functions from global scope
|
|
33
|
+
*/
|
|
34
|
+
script: string_script;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
38
|
+
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { number_integer } from '../types/typeAliases';
|
|
2
|
+
import type { number_positive } from '../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Represents all the tools needed to interact with the user.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/webgptorg/promptbook#user-interface-tools
|
|
7
|
+
*/
|
|
8
|
+
export type UserInterfaceTools = {
|
|
9
|
+
/**
|
|
10
|
+
* Asks the user to answer a free-text (multi-line) question
|
|
11
|
+
*
|
|
12
|
+
* @param options the question to ask
|
|
13
|
+
* @returns the answer from the user
|
|
14
|
+
*/
|
|
15
|
+
promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
|
|
16
|
+
};
|
|
17
|
+
export type UserInterfaceToolsPromptDialogOptions = {
|
|
18
|
+
/**
|
|
19
|
+
* Prompt title
|
|
20
|
+
*
|
|
21
|
+
* Note: This is not a prompt to language model but a prompt to the user
|
|
22
|
+
* @example "Your name"
|
|
23
|
+
*/
|
|
24
|
+
promptTitle: string;
|
|
25
|
+
/**
|
|
26
|
+
* Prompt message
|
|
27
|
+
*
|
|
28
|
+
* Note: This is not a prompt to language model but a prompt to the user
|
|
29
|
+
* @example "Please enter your name, including your last name, title, etc."
|
|
30
|
+
*/
|
|
31
|
+
promptMessage: string;
|
|
32
|
+
/**
|
|
33
|
+
* Default value for the input/textarea
|
|
34
|
+
*/
|
|
35
|
+
defaultValue: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Placeholder for the input/textarea
|
|
38
|
+
*/
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Priority of the prompt
|
|
42
|
+
*
|
|
43
|
+
* Note: This would be reflected for example into the UI z-index of the prompt modal
|
|
44
|
+
*/
|
|
45
|
+
priority: number_integer & number_positive;
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PipelineExecutor } from './PipelineExecutor';
|
|
2
|
+
/**
|
|
3
|
+
* Asserts that the execution of a promptnook is successful
|
|
4
|
+
*
|
|
5
|
+
* @param executionResult - The partial result of the promptnook execution
|
|
6
|
+
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
7
|
+
*/
|
|
8
|
+
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PipelineExecutor>>, 'isSuccessful' | 'errors'>): void;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: [🧠] Can this return type be better typed than void
|
|
11
|
+
*/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
|
+
import type { ExecutionTools } from './ExecutionTools';
|
|
3
|
+
import type { PipelineExecutor } from './PipelineExecutor';
|
|
4
|
+
type CreatePipelineExecutorSettings = {
|
|
5
|
+
/**
|
|
6
|
+
* When executor does not satisfy expectations it will be retried this amount of times
|
|
7
|
+
*
|
|
8
|
+
* @default 3
|
|
9
|
+
*/
|
|
10
|
+
readonly maxExecutionAttempts: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Options for creating a pipeline executor
|
|
14
|
+
*/
|
|
15
|
+
interface CreatePipelineExecutorOptions {
|
|
16
|
+
/**
|
|
17
|
+
* The pipeline to be executed
|
|
18
|
+
*/
|
|
19
|
+
readonly pipeline: PipelineJson;
|
|
20
|
+
/**
|
|
21
|
+
* The execution tools to be used during the execution of the pipeline
|
|
22
|
+
*/
|
|
23
|
+
readonly tools: ExecutionTools;
|
|
24
|
+
/**
|
|
25
|
+
* Optional settings for the pipeline executor
|
|
26
|
+
*/
|
|
27
|
+
readonly settings?: Partial<CreatePipelineExecutorSettings>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates executor function from pipeline and execution tools.
|
|
31
|
+
*
|
|
32
|
+
* @returns The executor function
|
|
33
|
+
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
34
|
+
*/
|
|
35
|
+
export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
|
|
36
|
+
export {};
|
|
37
|
+
/**
|
|
38
|
+
* TODO: [🧠] When not meet expectations in PROMPT_DIALOG, make some way to tell the user
|
|
39
|
+
* TODO: [👧] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
|
|
40
|
+
* Note: CreatePipelineExecutorOptions are just connected to PipelineExecutor so do not extract to types folder
|
|
41
|
+
* TODO: [🧠][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
|
|
42
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AutomaticTranslator } from './AutomaticTranslator';
|
|
2
|
+
/**
|
|
3
|
+
* This will wrap an automatic translator and log each translation into the console
|
|
4
|
+
*/
|
|
5
|
+
export declare class DebugAutomaticTranslator implements AutomaticTranslator {
|
|
6
|
+
private readonly automaticTranslator;
|
|
7
|
+
constructor(automaticTranslator: AutomaticTranslator);
|
|
8
|
+
translate(message: string): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AutomaticTranslator } from './AutomaticTranslator';
|
|
2
|
+
import type { TranslatorOptions } from './TranslatorOptions';
|
|
3
|
+
interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
|
|
4
|
+
apiUrl?: URL;
|
|
5
|
+
}
|
|
6
|
+
export declare class LindatAutomaticTranslator implements AutomaticTranslator {
|
|
7
|
+
private readonly options;
|
|
8
|
+
constructor(options: LindatAutomaticTranslatorOptions);
|
|
9
|
+
translate(message: string): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AutomaticTranslator } from './automatic-translators/AutomaticTranslator';
|
|
2
|
+
import type { TranslatorOptions } from './automatic-translators/TranslatorOptions';
|
|
3
|
+
export declare function translateMessages({ automaticTranslator, from, to, }: {
|
|
4
|
+
automaticTranslator: AutomaticTranslator;
|
|
5
|
+
} & TranslatorOptions): Promise<void>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PromptResultUsage } from '../PromptResult';
|
|
2
|
+
/**
|
|
3
|
+
* Function `addUsage` will add multiple usages into one
|
|
4
|
+
*
|
|
5
|
+
* Note: If you provide 0 values, it returns void usage
|
|
6
|
+
*/
|
|
7
|
+
export declare function addUsage(...usageItems: Array<PromptResultUsage>): PromptResultUsage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|