@promptbook/cli 0.60.0 → 0.61.0-0
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 +4 -6
- package/esm/index.es.js +4050 -1465
- package/esm/index.es.js.map +1 -1
- package/esm/typings/promptbook-collection/index.d.ts +61 -4
- package/esm/typings/src/_packages/core.index.d.ts +8 -8
- package/esm/typings/src/_packages/markdown-utils.d.ts +17 -0
- package/esm/typings/src/_packages/types.index.d.ts +11 -6
- package/esm/typings/src/_packages/utils.index.d.ts +23 -19
- 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/collection/collectionToJson.d.ts +3 -0
- package/esm/typings/src/collection/collectionToJson.test.d.ts +6 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +2 -1
- 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/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/expectCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/JOKER/JokerCommand.d.ts +11 -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/knowledgeCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +13 -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/parameterCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +11 -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/postprocessCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +11 -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/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 +4 -0
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +2 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -3
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -2
- package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
- package/esm/typings/src/conversion/utils/extractVariables.d.ts +1 -1
- package/esm/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +3 -0
- package/esm/typings/src/errors/NotYetImplementedError.d.ts +7 -0
- package/esm/typings/src/errors/{SyntaxError.d.ts → ParsingError.d.ts} +2 -2
- package/{umd/typings/src/errors/ExecutionError.d.ts → esm/typings/src/errors/PipelineExecutionError.d.ts} +2 -2
- package/esm/typings/src/errors/_ExpectError.d.ts +2 -2
- package/esm/typings/src/execution/ExecutionTools.d.ts +4 -3
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +24 -5
- package/esm/typings/src/execution/PromptResult.d.ts +2 -2
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
- package/esm/typings/src/execution/utils/replaceParameters.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +5 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +10 -0
- package/esm/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
- 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/mocked-chat.test.d.ts +5 -0
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +14 -1
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +16 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +6 -1
- package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +13 -3
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
- package/esm/typings/src/personas/personaToModelRequirements.d.ts +6 -0
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +2 -1
- package/esm/typings/src/types/Arrayable.d.ts +10 -0
- package/esm/typings/src/types/PipelineJson/Expectations.d.ts +28 -0
- package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +16 -0
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +8 -2
- package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +7 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +6 -142
- package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +77 -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/Prompt.d.ts +3 -3
- package/esm/typings/src/types/TaskProgress.d.ts +2 -2
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -3
- package/esm/typings/src/types/typeAliases.d.ts +50 -6
- 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 +1 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/index.d.ts +2 -2
- 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 +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/normalize-to-kebab-case.d.ts +8 -1
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +8 -1
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +13 -1
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +8 -1
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +8 -1
- package/esm/typings/src/{conversion/utils → utils}/parseNumber.d.ts +1 -1
- package/esm/typings/src/utils/parseNumber.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/difference.d.ts +2 -0
- package/esm/typings/src/utils/sets/intersection.d.ts +2 -0
- package/esm/typings/src/utils/sets/union.d.ts +2 -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 +3 -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 +3 -2
- package/package.json +5 -2
- package/umd/index.umd.js +4053 -1469
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/promptbook-collection/index.d.ts +61 -4
- package/umd/typings/src/_packages/core.index.d.ts +8 -8
- package/umd/typings/src/_packages/markdown-utils.d.ts +17 -0
- package/umd/typings/src/_packages/types.index.d.ts +11 -6
- package/umd/typings/src/_packages/utils.index.d.ts +23 -19
- 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/collection/collectionToJson.d.ts +3 -0
- package/umd/typings/src/collection/collectionToJson.test.d.ts +6 -0
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +2 -1
- 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 +4 -0
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +2 -0
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +2 -3
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -2
- package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
- package/umd/typings/src/conversion/utils/extractVariables.d.ts +1 -1
- package/umd/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +3 -0
- package/umd/typings/src/errors/NotYetImplementedError.d.ts +7 -0
- package/umd/typings/src/errors/{SyntaxError.d.ts → ParsingError.d.ts} +2 -2
- package/{esm/typings/src/errors/ExecutionError.d.ts → umd/typings/src/errors/PipelineExecutionError.d.ts} +2 -2
- package/umd/typings/src/errors/_ExpectError.d.ts +2 -2
- package/umd/typings/src/execution/ExecutionTools.d.ts +4 -3
- package/umd/typings/src/execution/LlmExecutionTools.d.ts +24 -5
- package/umd/typings/src/execution/PromptResult.d.ts +2 -2
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
- package/umd/typings/src/execution/utils/checkExpectations.d.ts +1 -1
- package/umd/typings/src/execution/utils/replaceParameters.d.ts +1 -1
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +5 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -5
- package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +5 -0
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -0
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +10 -0
- package/umd/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
- 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/mocked-chat.test.d.ts +5 -0
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +14 -1
- package/umd/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +16 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +6 -1
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +13 -3
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
- package/umd/typings/src/personas/personaToModelRequirements.d.ts +6 -0
- package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +2 -1
- package/umd/typings/src/types/Arrayable.d.ts +10 -0
- package/umd/typings/src/types/PipelineJson/Expectations.d.ts +28 -0
- package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +16 -0
- package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +8 -2
- package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +7 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +6 -142
- package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +77 -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/Prompt.d.ts +3 -3
- package/umd/typings/src/types/TaskProgress.d.ts +2 -2
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -3
- package/umd/typings/src/types/typeAliases.d.ts +50 -6
- 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 +1 -0
- package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/index.d.ts +2 -2
- 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 +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/normalize-to-kebab-case.d.ts +8 -1
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +8 -1
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +13 -1
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +8 -1
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +8 -1
- package/umd/typings/src/{conversion/utils → utils}/parseNumber.d.ts +1 -1
- package/umd/typings/src/utils/parseNumber.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/difference.d.ts +2 -0
- package/umd/typings/src/utils/sets/intersection.d.ts +2 -0
- package/umd/typings/src/utils/sets/union.d.ts +2 -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 +3 -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 +3 -2
- package/esm/typings/src/cli/actions/hello.d.ts +0 -7
- package/esm/typings/src/cli/actions/make.d.ts +0 -7
- package/esm/typings/src/cli/actions/prettify.d.ts +0 -7
- package/esm/typings/src/conversion/utils/parseCommand.d.ts +0 -11
- package/esm/typings/src/conversion/utils/parseCommand.test.d.ts +0 -4
- package/esm/typings/src/errors/TemplateError.d.ts +0 -9
- package/esm/typings/src/llm-providers/mocked/mocked-chat.test.d.ts +0 -4
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionToolsOptions.d.ts +0 -24
- package/esm/typings/src/types/Command.d.ts +0 -101
- package/esm/typings/src/types/ExecutionTypes.d.ts +0 -13
- package/esm/typings/src/utils/markdown-json/MarkdownStructure.d.ts +0 -25
- package/esm/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +0 -7
- package/esm/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +0 -13
- package/umd/typings/src/cli/actions/hello.d.ts +0 -7
- package/umd/typings/src/cli/actions/make.d.ts +0 -7
- package/umd/typings/src/cli/actions/prettify.d.ts +0 -7
- package/umd/typings/src/conversion/utils/parseCommand.d.ts +0 -11
- package/umd/typings/src/conversion/utils/parseCommand.test.d.ts +0 -4
- package/umd/typings/src/errors/TemplateError.d.ts +0 -9
- package/umd/typings/src/llm-providers/mocked/mocked-chat.test.d.ts +0 -4
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionToolsOptions.d.ts +0 -24
- package/umd/typings/src/types/Command.d.ts +0 -101
- package/umd/typings/src/types/ExecutionTypes.d.ts +0 -13
- package/umd/typings/src/utils/markdown-json/MarkdownStructure.d.ts +0 -25
- package/umd/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +0 -7
- package/umd/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +0 -13
- /package/esm/typings/src/{conversion/utils/parseNumber.test.d.ts → commands/BLOCK/blockCommand.test.d.ts} +0 -0
- /package/esm/typings/src/{llm-providers/mocked/fakeTextToExpectations.test.d.ts → commands/EXPECT/expectCommand.test.d.ts} +0 -0
- /package/esm/typings/src/{llm-providers/mocked/faked-completion.test.d.ts → commands/JOKER/jokerCommand.test.d.ts} +0 -0
- /package/esm/typings/src/{utils/markdown-json/countMarkdownStructureDeepness.test.d.ts → commands/KNOWLEDGE/knowledgeCommand.test.d.ts} +0 -0
- /package/esm/typings/src/{utils/markdown-json/markdownToMarkdownStructure.test.d.ts → commands/MODEL/modelCommand.test.d.ts} +0 -0
- /package/{umd/typings/src/conversion/utils/parseNumber.test.d.ts → esm/typings/src/commands/PARAMETER/parameterCommand.test.d.ts} +0 -0
- /package/{umd/typings/src/llm-providers/mocked/fakeTextToExpectations.test.d.ts → esm/typings/src/commands/PERSONA/personaCommand.test.d.ts} +0 -0
- /package/{umd/typings/src/llm-providers/mocked/faked-completion.test.d.ts → esm/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts} +0 -0
- /package/{umd/typings/src/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts → esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts} +0 -0
- /package/{umd/typings/src/utils/markdown-json/markdownToMarkdownStructure.test.d.ts → esm/typings/src/commands/URL/urlCommand.test.d.ts} +0 -0
- /package/esm/typings/src/llm-providers/mocked/{joker.test.d.ts → test/joker.test.d.ts} +0 -0
- /package/esm/typings/src/llm-providers/mocked/{mocked-completion.test.d.ts → test/mocked-completion.test.d.ts} +0 -0
- /package/umd/typings/src/llm-providers/mocked/{joker.test.d.ts → test/joker.test.d.ts} +0 -0
- /package/umd/typings/src/llm-providers/mocked/{mocked-completion.test.d.ts → test/mocked-completion.test.d.ts} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/**
|
|
3
|
+
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPipelineExecutor.test.ts"
|
|
4
|
+
* Note: [🤖] For each new model variant consider adding new testing unit like "faked-completion.test.ts", "mocked-chat.test.ts" and "mocked-completion.test.ts"
|
|
5
|
+
*/
|
|
@@ -2,11 +2,15 @@ import type { AvailableModel } from '../../execution/LlmExecutionTools';
|
|
|
2
2
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
3
3
|
import type { PromptChatResult } from '../../execution/PromptResult';
|
|
4
4
|
import type { PromptCompletionResult } from '../../execution/PromptResult';
|
|
5
|
+
import type { PromptEmbeddingResult } from '../../execution/PromptResult';
|
|
5
6
|
import type { Prompt } from '../../types/Prompt';
|
|
7
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
8
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
9
|
+
import type { string_title } from '../../types/typeAliases';
|
|
6
10
|
/**
|
|
7
11
|
* Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
|
|
8
12
|
*
|
|
9
|
-
* @
|
|
13
|
+
* @private Internal utility of `joinLlmExecutionTools`
|
|
10
14
|
*/
|
|
11
15
|
export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
12
16
|
/**
|
|
@@ -17,6 +21,8 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
|
17
21
|
* Gets array of execution tools in order of priority
|
|
18
22
|
*/
|
|
19
23
|
constructor(...llmExecutionTools: Array<LlmExecutionTools>);
|
|
24
|
+
get title(): string_title & string_markdown_text;
|
|
25
|
+
get description(): string_markdown;
|
|
20
26
|
/**
|
|
21
27
|
* Calls the best available chat model
|
|
22
28
|
*/
|
|
@@ -25,6 +31,10 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
|
25
31
|
* Calls the best available completion model
|
|
26
32
|
*/
|
|
27
33
|
callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Calls the best available embedding model
|
|
36
|
+
*/
|
|
37
|
+
callEmbeddingModel(prompt: Prompt): Promise<PromptEmbeddingResult>;
|
|
28
38
|
/**
|
|
29
39
|
* Calls the best available model
|
|
30
40
|
*/
|
|
@@ -35,3 +45,6 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
|
|
|
35
45
|
*/
|
|
36
46
|
listModels(): Promise<Array<AvailableModel>>;
|
|
37
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* TODO: [🧠][🎛] Aggregating multiple models - have result not only from one first aviable model BUT all of them
|
|
50
|
+
*/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
2
|
+
import { MultipleLlmExecutionTools } from './MultipleLlmExecutionTools';
|
|
3
|
+
/**
|
|
4
|
+
* Joins multiple LLM Execution Tools into one
|
|
5
|
+
*
|
|
6
|
+
* @returns {LlmExecutionTools} Single wrapper for multiple LlmExecutionTools
|
|
7
|
+
*
|
|
8
|
+
* 0) If there is no LlmExecutionTools, it warns and returns valid but empty LlmExecutionTools
|
|
9
|
+
* 1) If there is only one LlmExecutionTools, it returns it wrapped in a proxy object
|
|
10
|
+
* 2) If there are multiple LlmExecutionTools, first will be used first, second will be used if the first hasn`t defined model variant or fails, etc.
|
|
11
|
+
* 3) When all LlmExecutionTools fail, it throws an error with a list of all errors merged into one
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`
|
|
15
|
+
*/
|
|
16
|
+
export declare function joinLlmExecutionTools(...llmExecutionTools: Array<LlmExecutionTools>): MultipleLlmExecutionTools;
|
|
@@ -4,6 +4,9 @@ import type { PromptChatResult } from '../../execution/PromptResult';
|
|
|
4
4
|
import type { PromptCompletionResult } from '../../execution/PromptResult';
|
|
5
5
|
import type { PromptEmbeddingResult } from '../../execution/PromptResult';
|
|
6
6
|
import type { Prompt } from '../../types/Prompt';
|
|
7
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
8
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
9
|
+
import type { string_title } from '../../types/typeAliases';
|
|
7
10
|
import type { OpenAiExecutionToolsOptions } from './OpenAiExecutionToolsOptions';
|
|
8
11
|
/**
|
|
9
12
|
* Execution Tools for calling OpenAI API.
|
|
@@ -20,6 +23,8 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
|
|
|
20
23
|
* @param options which are relevant are directly passed to the OpenAI client
|
|
21
24
|
*/
|
|
22
25
|
constructor(options?: OpenAiExecutionToolsOptions);
|
|
26
|
+
get title(): string_title & string_markdown_text;
|
|
27
|
+
get description(): string_markdown;
|
|
23
28
|
/**
|
|
24
29
|
* Calls OpenAI API to use a chat model.
|
|
25
30
|
*/
|
|
@@ -31,7 +36,7 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
|
|
|
31
36
|
/**
|
|
32
37
|
* Calls OpenAI API to use a embedding model
|
|
33
38
|
*/
|
|
34
|
-
|
|
39
|
+
callEmbeddingModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptEmbeddingResult>;
|
|
35
40
|
/**
|
|
36
41
|
* Get the model that should be used as default
|
|
37
42
|
*/
|
|
@@ -7,7 +7,7 @@ import type { Prompt } from '../../types/Prompt';
|
|
|
7
7
|
* @param promptContent The content of the prompt
|
|
8
8
|
* @param resultContent The content of the result (for embedding prompts or failed prompts pass empty string)
|
|
9
9
|
* @param rawResponse The raw response from OpenAI API
|
|
10
|
-
* @throws {
|
|
10
|
+
* @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
|
|
11
11
|
* @private internal util of `OpenAiExecutionTools`
|
|
12
12
|
*/
|
|
13
13
|
export declare function computeOpenaiUsage(promptContent: Prompt['content'], // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
|
|
@@ -15,6 +15,7 @@ export declare const OPENAI_MODELS: Array<AvailableModel & {
|
|
|
15
15
|
};
|
|
16
16
|
}>;
|
|
17
17
|
/**
|
|
18
|
+
* Note: [🤖] Add models of new variant
|
|
18
19
|
* TODO: [🧠] Some mechanism to propagate unsureness
|
|
19
20
|
* TODO: [🕚][👮♀️] Make this list dynamic - dynamically can be listed modelNames but not modelVariant, legacy status, context length and pricing
|
|
20
21
|
* TODO: [🧠][👮♀️] Put here more info like description, isVision, trainingDateCutoff, languages, strengths ( Top-level performance, intelligence, fluency, and understanding), contextWindow,...
|
|
@@ -2,7 +2,11 @@ import type { AvailableModel } from '../../execution/LlmExecutionTools';
|
|
|
2
2
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
3
3
|
import type { PromptChatResult } from '../../execution/PromptResult';
|
|
4
4
|
import type { PromptCompletionResult } from '../../execution/PromptResult';
|
|
5
|
+
import type { PromptEmbeddingResult } from '../../execution/PromptResult';
|
|
5
6
|
import type { Prompt } from '../../types/Prompt';
|
|
7
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
8
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
9
|
+
import type { string_title } from '../../types/typeAliases';
|
|
6
10
|
import type { RemoteLlmExecutionToolsOptions } from './RemoteLlmExecutionToolsOptions';
|
|
7
11
|
/**
|
|
8
12
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
@@ -15,20 +19,26 @@ import type { RemoteLlmExecutionToolsOptions } from './RemoteLlmExecutionToolsOp
|
|
|
15
19
|
export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
|
|
16
20
|
private readonly options;
|
|
17
21
|
constructor(options: RemoteLlmExecutionToolsOptions);
|
|
22
|
+
get title(): string_title & string_markdown_text;
|
|
23
|
+
get description(): string_markdown;
|
|
18
24
|
/**
|
|
19
25
|
* Creates a connection to the remote proxy server.
|
|
20
26
|
*/
|
|
21
27
|
private makeConnection;
|
|
22
28
|
/**
|
|
23
|
-
* Calls remote proxy server to use a chat model
|
|
29
|
+
* Calls remote proxy server to use a chat model
|
|
24
30
|
*/
|
|
25
31
|
callChatModel(prompt: Prompt): Promise<PromptChatResult>;
|
|
26
32
|
/**
|
|
27
|
-
* Calls remote proxy server to use a completion model
|
|
33
|
+
* Calls remote proxy server to use a completion model
|
|
28
34
|
*/
|
|
29
35
|
callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
30
36
|
/**
|
|
31
|
-
* Calls remote proxy server to use
|
|
37
|
+
* Calls remote proxy server to use a embedding model
|
|
38
|
+
*/
|
|
39
|
+
callEmbeddingModel(prompt: Prompt): Promise<PromptEmbeddingResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Calls remote proxy server to use both completion or chat model
|
|
32
42
|
*/
|
|
33
43
|
private callModelCommon;
|
|
34
44
|
/**
|
|
@@ -15,4 +15,5 @@ export declare function startRemoteServer(options: RemoteServerOptions): IDestro
|
|
|
15
15
|
* TODO: [🤹♂️] Do not hang up immediately but wait until client closes OR timeout
|
|
16
16
|
* TODO: [🤹♂️] Timeout on chat to free up resources
|
|
17
17
|
* TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
|
|
18
|
+
* TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
|
|
18
19
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { really_any } from '../../../types/typeAliases';
|
|
1
2
|
/**
|
|
2
3
|
* Does nothing, but preserves the function in the bundle
|
|
3
4
|
* Compiler is tricked into thinking the function is used
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
* @param value any function to preserve
|
|
6
7
|
* @returns nothing
|
|
7
8
|
*/
|
|
8
|
-
export declare function preserve(func: (...params: Array<
|
|
9
|
+
export declare function preserve(func: (...params: Array<really_any>) => unknown): void;
|
|
9
10
|
/**
|
|
10
11
|
* TODO: !! [1] This maybe does memory leak
|
|
11
12
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item or array of items
|
|
3
|
+
*
|
|
4
|
+
* 1) Any item except array and undefined represents array with that one item (also null)
|
|
5
|
+
* 2) Undefined represents empty array
|
|
6
|
+
* 3) Array represents itself
|
|
7
|
+
*
|
|
8
|
+
* @private Internal utility type
|
|
9
|
+
*/
|
|
10
|
+
export type Arrayable<TItem> = TItem | Array<TItem> | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { number_integer } from '../typeAliases';
|
|
2
|
+
import type { number_positive } from '../typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Expect this amount of each unit in the answer
|
|
5
|
+
*
|
|
6
|
+
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
7
|
+
*
|
|
8
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
9
|
+
*/
|
|
10
|
+
export type Expectations = Partial<Record<Lowercase<ExpectationUnit>, {
|
|
11
|
+
min?: ExpectationAmount;
|
|
12
|
+
max?: ExpectationAmount;
|
|
13
|
+
}>>;
|
|
14
|
+
/**
|
|
15
|
+
* Units of text measurement
|
|
16
|
+
*/
|
|
17
|
+
export declare const EXPECTATION_UNITS: readonly ["CHARACTERS", "WORDS", "SENTENCES", "LINES", "PARAGRAPHS", "PAGES"];
|
|
18
|
+
/**
|
|
19
|
+
* Unit of text measurement
|
|
20
|
+
*/
|
|
21
|
+
export type ExpectationUnit = typeof EXPECTATION_UNITS[number];
|
|
22
|
+
/**
|
|
23
|
+
* Amount of text measurement
|
|
24
|
+
*/
|
|
25
|
+
export type ExpectationAmount = number_integer & (number_positive | 0);
|
|
26
|
+
/**
|
|
27
|
+
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
28
|
+
*/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ModelRequirements } from '../ModelRequirements';
|
|
2
|
+
import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';
|
|
3
|
+
/**
|
|
4
|
+
* Template for prompt to LLM
|
|
5
|
+
*/
|
|
6
|
+
export type LlmTemplateJson = PromptTemplateJsonCommon & {
|
|
7
|
+
readonly blockType: 'PROMPT_TEMPLATE';
|
|
8
|
+
/**
|
|
9
|
+
* Requirements for the model
|
|
10
|
+
* - This is required only for blockType PROMPT_TEMPLATE
|
|
11
|
+
*/
|
|
12
|
+
readonly modelRequirements: ModelRequirements;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* TODO: [👙][🧠] Just selecting gpt3 or gpt4 level of modelT
|
|
16
|
+
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { string_file_path } from '../typeAliases';
|
|
1
2
|
import type { string_markdown_text } from '../typeAliases';
|
|
2
3
|
import type { string_pipeline_url } from '../typeAliases';
|
|
3
|
-
import type {
|
|
4
|
+
import type { string_semantic_version } from '../typeAliases';
|
|
4
5
|
import type { KnowledgeJson } from './KnowledgeJson';
|
|
5
6
|
import type { PromptTemplateJson } from './PromptTemplateJson';
|
|
6
7
|
import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson';
|
|
@@ -21,6 +22,10 @@ export type PipelineJson = {
|
|
|
21
22
|
* Warning: Do not hash part of the URL, hash part is used for identification of the prompt template in the pipeline
|
|
22
23
|
*/
|
|
23
24
|
readonly pipelineUrl?: string_pipeline_url;
|
|
25
|
+
/**
|
|
26
|
+
* Internal helper for tracking the source `.ptbk.md` file of the pipeline
|
|
27
|
+
*/
|
|
28
|
+
readonly sourceFile?: string_file_path;
|
|
24
29
|
/**
|
|
25
30
|
* Title of the promptbook
|
|
26
31
|
* -It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
@@ -29,7 +34,7 @@ export type PipelineJson = {
|
|
|
29
34
|
/**
|
|
30
35
|
* Version of the .ptbk.json file
|
|
31
36
|
*/
|
|
32
|
-
readonly promptbookVersion:
|
|
37
|
+
readonly promptbookVersion: string_semantic_version;
|
|
33
38
|
/**
|
|
34
39
|
* Description of the promptbook
|
|
35
40
|
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
@@ -49,6 +54,7 @@ export type PipelineJson = {
|
|
|
49
54
|
readonly knowledge: KnowledgeJson;
|
|
50
55
|
};
|
|
51
56
|
/**
|
|
57
|
+
* TODO: !!!!! Implement new commands
|
|
52
58
|
* Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a
|
|
53
59
|
* But then immediately reverted back to the single type
|
|
54
60
|
* With knowledge as part of the promptbook and collection just as a collection of promptbooks
|
|
@@ -1,145 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type { number_positive } from '../typeAliases';
|
|
7
|
-
import type { string_javascript } from '../typeAliases';
|
|
8
|
-
import type { string_javascript_name } from '../typeAliases';
|
|
9
|
-
import type { string_markdown } from '../typeAliases';
|
|
10
|
-
import type { string_markdown_text } from '../typeAliases';
|
|
11
|
-
import type { string_name } from '../typeAliases';
|
|
12
|
-
import type { string_prompt } from '../typeAliases';
|
|
13
|
-
import type { string_template } from '../typeAliases';
|
|
1
|
+
import type { ___ } from '../typeAliases';
|
|
2
|
+
import type { LlmTemplateJson } from './LlmTemplateJson';
|
|
3
|
+
import type { PromptDialogJson } from './PromptDialogJson';
|
|
4
|
+
import type { ScriptJson } from './ScriptJson';
|
|
5
|
+
import type { SimpleTemplateJson } from './SimpleTemplateJson';
|
|
14
6
|
/**
|
|
15
7
|
* Describes one prompt template in the promptbook
|
|
16
8
|
*/
|
|
17
|
-
export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptJson | PromptDialogJson;
|
|
18
|
-
/**
|
|
19
|
-
* Template for prompt to LLM
|
|
20
|
-
*/
|
|
21
|
-
export type LlmTemplateJson = PromptTemplateJsonCommon & {
|
|
22
|
-
readonly executionType: 'PROMPT_TEMPLATE';
|
|
23
|
-
/**
|
|
24
|
-
* Requirements for the model
|
|
25
|
-
* - This is required only for executionType PROMPT_TEMPLATE
|
|
26
|
-
*/
|
|
27
|
-
readonly modelRequirements: ModelRequirements;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Expect this amount of each unit in the answer
|
|
31
|
-
*
|
|
32
|
-
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
33
|
-
*
|
|
34
|
-
* Note: Expectations are performed after all postprocessing steps
|
|
35
|
-
*/
|
|
36
|
-
export type Expectations = Partial<Record<Lowercase<ExpectationUnit>, {
|
|
37
|
-
min?: ExpectationAmount;
|
|
38
|
-
max?: ExpectationAmount;
|
|
39
|
-
}>>;
|
|
40
|
-
/**
|
|
41
|
-
* Units of text measurement
|
|
42
|
-
*/
|
|
43
|
-
export declare const EXPECTATION_UNITS: readonly ["CHARACTERS", "WORDS", "SENTENCES", "LINES", "PARAGRAPHS", "PAGES"];
|
|
44
|
-
/**
|
|
45
|
-
* Unit of text measurement
|
|
46
|
-
*/
|
|
47
|
-
export type ExpectationUnit = typeof EXPECTATION_UNITS[number];
|
|
48
|
-
/**
|
|
49
|
-
* Amount of text measurement
|
|
50
|
-
*/
|
|
51
|
-
export type ExpectationAmount = number_integer & (number_positive | 0);
|
|
52
|
-
/**
|
|
53
|
-
* Template for simple concatenation of strings
|
|
54
|
-
*/
|
|
55
|
-
export interface SimpleTemplateJson extends PromptTemplateJsonCommon {
|
|
56
|
-
readonly executionType: 'SIMPLE_TEMPLATE';
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Template for script execution
|
|
60
|
-
*/
|
|
61
|
-
export interface ScriptJson extends PromptTemplateJsonCommon {
|
|
62
|
-
readonly executionType: 'SCRIPT';
|
|
63
|
-
/**
|
|
64
|
-
* Language of the script
|
|
65
|
-
* - This is required only for executionType SCRIPT
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
readonly contentLanguage?: ScriptLanguage;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Template for prompt to user
|
|
72
|
-
*/
|
|
73
|
-
export interface PromptDialogJson extends PromptTemplateJsonCommon {
|
|
74
|
-
readonly executionType: 'PROMPT_DIALOG';
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Common properties of all prompt templates
|
|
78
|
-
*/
|
|
79
|
-
interface PromptTemplateJsonCommon {
|
|
80
|
-
/**
|
|
81
|
-
* Name of the template
|
|
82
|
-
* - It must be unique across the pipeline
|
|
83
|
-
* - It should start uppercase and contain letters and numbers
|
|
84
|
-
* - The pipelineUrl together with hash and name are used to identify the prompt template in the pipeline
|
|
85
|
-
*/
|
|
86
|
-
readonly name: string_name;
|
|
87
|
-
/**
|
|
88
|
-
* Title of the prompt template
|
|
89
|
-
* It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
90
|
-
*/
|
|
91
|
-
readonly title: string;
|
|
92
|
-
/**
|
|
93
|
-
* Description of the prompt template
|
|
94
|
-
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
95
|
-
*/
|
|
96
|
-
readonly description?: string_markdown_text;
|
|
97
|
-
/**
|
|
98
|
-
* List of parameter names that are used in the prompt template and must be defined before the prompt template is executed
|
|
99
|
-
*
|
|
100
|
-
* Note: Joker is one of the dependent parameters
|
|
101
|
-
*/
|
|
102
|
-
readonly dependentParameterNames: Array<string_name>;
|
|
103
|
-
/**
|
|
104
|
-
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
105
|
-
*/
|
|
106
|
-
readonly jokers?: Array<string>;
|
|
107
|
-
/**
|
|
108
|
-
* Type of the execution
|
|
109
|
-
* This determines if the prompt template is send to LLM, user or some scripting evaluation
|
|
110
|
-
*/
|
|
111
|
-
readonly executionType: ExecutionType;
|
|
112
|
-
/**
|
|
113
|
-
* Content of the template with {placeholders} for parameters
|
|
114
|
-
*/
|
|
115
|
-
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
|
|
116
|
-
/**
|
|
117
|
-
* List of postprocessing steps that are executed after the prompt template
|
|
118
|
-
*/
|
|
119
|
-
readonly postprocessing?: Array<string_javascript_name>;
|
|
120
|
-
/**
|
|
121
|
-
* Expect this amount of each unit in the answer
|
|
122
|
-
*
|
|
123
|
-
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
124
|
-
*
|
|
125
|
-
* Note: Expectations are performed after all postprocessing steps
|
|
126
|
-
*/
|
|
127
|
-
readonly expectations?: Expectations;
|
|
128
|
-
/**
|
|
129
|
-
* Expect this format of the answer
|
|
130
|
-
*
|
|
131
|
-
* Note: Expectations are performed after all postprocessing steps
|
|
132
|
-
* @deprecated [💝]
|
|
133
|
-
*/
|
|
134
|
-
readonly expectFormat?: ExpectFormatCommand['format'];
|
|
135
|
-
/**
|
|
136
|
-
* Name of the parameter that is the result of the prompt template
|
|
137
|
-
*/
|
|
138
|
-
readonly resultingParameterName: string_name;
|
|
139
|
-
}
|
|
140
|
-
export {};
|
|
141
|
-
/**
|
|
142
|
-
* TODO: [💝] Unite object for expecting amount and format - remove expectFormat
|
|
143
|
-
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
144
|
-
* TODO: [👙][🧠] Just selecting gpt3 or gpt4 level of model
|
|
145
|
-
*/
|
|
9
|
+
export type PromptTemplateJson = LlmTemplateJson | SimpleTemplateJson | ScriptJson | PromptDialogJson | ___ | ___ | ___ | ___;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { BlockType } from '../../commands/BLOCK/BlockTypes';
|
|
2
|
+
import type { ExpectFormatCommand } from '../../commands/EXPECT/ExpectFormatCommand';
|
|
3
|
+
import type { string_javascript } from '../typeAliases';
|
|
4
|
+
import type { string_javascript_name } from '../typeAliases';
|
|
5
|
+
import type { string_markdown } from '../typeAliases';
|
|
6
|
+
import type { string_markdown_text } from '../typeAliases';
|
|
7
|
+
import type { string_name } from '../typeAliases';
|
|
8
|
+
import type { string_prompt } from '../typeAliases';
|
|
9
|
+
import type { string_template } from '../typeAliases';
|
|
10
|
+
import type { Expectations } from './Expectations';
|
|
11
|
+
/**
|
|
12
|
+
* Common properties of all prompt templates
|
|
13
|
+
*/
|
|
14
|
+
export interface PromptTemplateJsonCommon {
|
|
15
|
+
/**
|
|
16
|
+
* Name of the template
|
|
17
|
+
* - It must be unique across the pipeline
|
|
18
|
+
* - It should start uppercase and contain letters and numbers
|
|
19
|
+
* - The pipelineUrl together with hash and name are used to identify the prompt template in the pipeline
|
|
20
|
+
*/
|
|
21
|
+
readonly name: string_name;
|
|
22
|
+
/**
|
|
23
|
+
* Title of the prompt template
|
|
24
|
+
* It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
25
|
+
*/
|
|
26
|
+
readonly title: string;
|
|
27
|
+
/**
|
|
28
|
+
* Description of the prompt template
|
|
29
|
+
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
30
|
+
*/
|
|
31
|
+
readonly description?: string_markdown_text;
|
|
32
|
+
/**
|
|
33
|
+
* List of parameter names that are used in the prompt template and must be defined before the prompt template is executed
|
|
34
|
+
*
|
|
35
|
+
* Note: Joker is one of the dependent parameters
|
|
36
|
+
*/
|
|
37
|
+
readonly dependentParameterNames: Array<string_name>;
|
|
38
|
+
/**
|
|
39
|
+
* If theese parameters meet the expectations requirements, they are used instead of executing this prompt template
|
|
40
|
+
*/
|
|
41
|
+
readonly jokers?: Array<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Type of the execution
|
|
44
|
+
* This determines if the prompt template is send to LLM, user or some scripting evaluation
|
|
45
|
+
*/
|
|
46
|
+
readonly blockType: BlockType;
|
|
47
|
+
/**
|
|
48
|
+
* Content of the template with {placeholders} for parameters
|
|
49
|
+
*/
|
|
50
|
+
readonly content: (string_prompt | string_javascript | string_markdown) & string_template;
|
|
51
|
+
/**
|
|
52
|
+
* List of postprocessing steps that are executed after the prompt template
|
|
53
|
+
*/
|
|
54
|
+
readonly postprocessing?: Array<string_javascript_name>;
|
|
55
|
+
/**
|
|
56
|
+
* Expect this amount of each unit in the answer
|
|
57
|
+
*
|
|
58
|
+
* For example 5 words, 3 sentences, 2 paragraphs, ...
|
|
59
|
+
*
|
|
60
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
61
|
+
*/
|
|
62
|
+
readonly expectations?: Expectations;
|
|
63
|
+
/**
|
|
64
|
+
* Expect this format of the answer
|
|
65
|
+
*
|
|
66
|
+
* Note: Expectations are performed after all postprocessing steps
|
|
67
|
+
* @deprecated [💝]
|
|
68
|
+
*/
|
|
69
|
+
readonly expectFormat?: ExpectFormatCommand['format'];
|
|
70
|
+
/**
|
|
71
|
+
* Name of the parameter that is the result of the prompt template
|
|
72
|
+
*/
|
|
73
|
+
readonly resultingParameterName: string_name;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
|
|
77
|
+
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ScriptLanguage } from '../ScriptLanguage';
|
|
2
|
+
import type { PromptTemplateJsonCommon } from './PromptTemplateJsonCommon';
|
|
3
|
+
/**
|
|
4
|
+
* Template for script execution
|
|
5
|
+
*/
|
|
6
|
+
export interface ScriptJson extends PromptTemplateJsonCommon {
|
|
7
|
+
readonly blockType: 'SCRIPT';
|
|
8
|
+
/**
|
|
9
|
+
* Language of the script
|
|
10
|
+
* - This is required only for blockType SCRIPT
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
readonly contentLanguage?: ScriptLanguage;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { ExpectFormatCommand } from '../commands/EXPECT/ExpectFormatCommand';
|
|
1
2
|
import type { PostprocessingFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
2
|
-
import type { ExpectFormatCommand } from './Command';
|
|
3
3
|
import type { ModelRequirements } from './ModelRequirements';
|
|
4
|
-
import type { Expectations } from './PipelineJson/
|
|
4
|
+
import type { Expectations } from './PipelineJson/Expectations';
|
|
5
5
|
import type { string_name } from './typeAliases';
|
|
6
6
|
import type { string_pipeline_url_with_hashtemplate } from './typeAliases';
|
|
7
7
|
import type { string_prompt } from './typeAliases';
|
|
@@ -52,7 +52,7 @@ export type Prompt = {
|
|
|
52
52
|
*
|
|
53
53
|
* @example https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md#keywords
|
|
54
54
|
*/
|
|
55
|
-
readonly pipelineUrl
|
|
55
|
+
readonly pipelineUrl?: string_pipeline_url_with_hashtemplate;
|
|
56
56
|
/**
|
|
57
57
|
* Parameters used in the prompt
|
|
58
58
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockType } from '../commands/BLOCK/BlockTypes';
|
|
2
2
|
import type { string_markdown_text } from './typeAliases';
|
|
3
3
|
import type { string_name } from './typeAliases';
|
|
4
4
|
/**
|
|
@@ -31,7 +31,7 @@ export type TaskProgress = {
|
|
|
31
31
|
* The type of the execution.
|
|
32
32
|
* Note: The pipeline executor reports everything, in the app level you can filter out the execution types that you don't want to show to the user.
|
|
33
33
|
*/
|
|
34
|
-
readonly
|
|
34
|
+
readonly blockType: BlockType;
|
|
35
35
|
/**
|
|
36
36
|
* The parameter name that is being processed.
|
|
37
37
|
*/
|
|
@@ -2,7 +2,7 @@ import type { PromptResult } from '../../execution/PromptResult';
|
|
|
2
2
|
import type { Prompt } from '../Prompt';
|
|
3
3
|
import type { string_markdown_text } from '../typeAliases';
|
|
4
4
|
import type { string_pipeline_url } from '../typeAliases';
|
|
5
|
-
import type {
|
|
5
|
+
import type { string_semantic_version } from '../typeAliases';
|
|
6
6
|
/**
|
|
7
7
|
* ExecutionReport is result of executing one promptbook
|
|
8
8
|
* It is kind of a variant of the promptbook usefull for debugging, logging and transparency for users.
|
|
@@ -25,11 +25,11 @@ export type ExecutionReportJson = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Version from promptbook which was executed
|
|
27
27
|
*/
|
|
28
|
-
readonly promptbookUsedVersion:
|
|
28
|
+
readonly promptbookUsedVersion: string_semantic_version;
|
|
29
29
|
/**
|
|
30
30
|
* Version from promptbook which was requested by promptbook
|
|
31
31
|
*/
|
|
32
|
-
readonly promptbookRequestedVersion?:
|
|
32
|
+
readonly promptbookRequestedVersion?: string_semantic_version;
|
|
33
33
|
/**
|
|
34
34
|
* Description of the promptbook which was executed
|
|
35
35
|
*/
|