@promptbook/openai 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 +23 -21
- package/esm/index.es.js +38 -20
- 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 +2 -2
- package/umd/index.umd.js +38 -20
- 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 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { string_semantic_version } from './types/typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* The version of the Promptbook library
|
|
4
4
|
*/
|
|
5
|
-
export declare const PROMPTBOOK_VERSION:
|
|
5
|
+
export declare const PROMPTBOOK_VERSION: string_promptbook_version;
|
|
6
|
+
export type string_promptbook_version = string_semantic_version;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Command } from '../../types/Command';
|
|
2
|
-
import type { string_markdown_text } from '../../types/typeAliases';
|
|
3
|
-
/**
|
|
4
|
-
* Parses one line of ul/ol to command
|
|
5
|
-
*
|
|
6
|
-
* @returns parsed command object
|
|
7
|
-
* @throws {SyntaxError} if the command is invalid
|
|
8
|
-
*
|
|
9
|
-
* @private within the pipelineStringToJson
|
|
10
|
-
*/
|
|
11
|
-
export declare function parseCommand(listItem: string_markdown_text): Command;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error occurs during the parameter replacement in the template
|
|
3
|
-
*
|
|
4
|
-
* Note: This is a kindof subtype of ExecutionError because it occurs during the execution of the pipeline
|
|
5
|
-
*/
|
|
6
|
-
export declare class TemplateError extends Error {
|
|
7
|
-
readonly name = "TemplateError";
|
|
8
|
-
constructor(message: string);
|
|
9
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';
|
|
2
|
-
import type { client_id } from '../../types/typeAliases';
|
|
3
|
-
import type { string_uri } from '../../types/typeAliases';
|
|
4
|
-
/**
|
|
5
|
-
* Options for MultipleLlmExecutionTools
|
|
6
|
-
*/
|
|
7
|
-
export type MultipleLlmExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
-
/**
|
|
9
|
-
* URL of the multiple PROMPTBOOK server
|
|
10
|
-
* On this server will be connected to the socket.io server
|
|
11
|
-
*/
|
|
12
|
-
readonly multipleUrl: URL;
|
|
13
|
-
/**
|
|
14
|
-
* Path for the Socket.io server to listen
|
|
15
|
-
*
|
|
16
|
-
* @default '/socket.io'
|
|
17
|
-
* @example '/promptbook/socket.io'
|
|
18
|
-
*/
|
|
19
|
-
readonly path: string_uri;
|
|
20
|
-
/**
|
|
21
|
-
* Your client ID
|
|
22
|
-
*/
|
|
23
|
-
readonly clientId: client_id;
|
|
24
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { ExecutionType } from './ExecutionTypes';
|
|
2
|
-
import type { ModelRequirements } from './ModelRequirements';
|
|
3
|
-
import type { ExpectationAmount } from './PipelineJson/PromptTemplateJson';
|
|
4
|
-
import type { ExpectationUnit } from './PipelineJson/PromptTemplateJson';
|
|
5
|
-
import type { string_markdown_text } from './typeAliases';
|
|
6
|
-
import type { string_name } from './typeAliases';
|
|
7
|
-
import type { string_version } from './typeAliases';
|
|
8
|
-
/**
|
|
9
|
-
* Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
|
|
10
|
-
* It is parsed from the markdown from ul/ol items - one command per one item.
|
|
11
|
-
*/
|
|
12
|
-
export type Command = PromptbookUrlCommand | PromptbookVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
13
|
-
/**
|
|
14
|
-
* PromptbookVersion command tells which version is .promptbook file using
|
|
15
|
-
*
|
|
16
|
-
* - It is used for backward compatibility
|
|
17
|
-
* - It is defined per whole .promptbook file in the header
|
|
18
|
-
*/
|
|
19
|
-
export type PromptbookUrlCommand = {
|
|
20
|
-
readonly type: 'PIPELINE_URL';
|
|
21
|
-
readonly pipelineUrl: URL;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* PromptbookVersion command tells which version is .promptbook file using
|
|
25
|
-
*
|
|
26
|
-
* - It is used for backward compatibility
|
|
27
|
-
* - It is defined per whole .promptbook file in the header
|
|
28
|
-
*/
|
|
29
|
-
export type PromptbookVersionCommand = {
|
|
30
|
-
readonly type: 'PROMPTBOOK_VERSION';
|
|
31
|
-
readonly promptbookVersion: string_version;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Execute command tells how to execute the section
|
|
35
|
-
* It can be either prompt template, script or SIMPLE TEMPLATE etc.
|
|
36
|
-
*/
|
|
37
|
-
export type ExecuteCommand = {
|
|
38
|
-
readonly type: 'EXECUTE';
|
|
39
|
-
readonly executionType: ExecutionType;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Model command tells which model and modelRequirements to use for the prompt template. execution
|
|
43
|
-
*/
|
|
44
|
-
export type ModelCommand = {
|
|
45
|
-
readonly type: 'MODEL';
|
|
46
|
-
readonly key: keyof ModelRequirements;
|
|
47
|
-
readonly value: any;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Joker parameter is used instead of executing the prompt template if it meet the expectations requirements
|
|
51
|
-
*/
|
|
52
|
-
export type JokerCommand = {
|
|
53
|
-
readonly type: 'JOKER';
|
|
54
|
-
readonly parameterName: string_name;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Parameter command describes one parameter of the prompt template
|
|
58
|
-
*
|
|
59
|
-
* - It can tell if it is input or OUTPUT PARAMETER
|
|
60
|
-
* - It can have description
|
|
61
|
-
* - In description it can have simple formatting BUT not markdown structure or reference to other parameters
|
|
62
|
-
*/
|
|
63
|
-
export type ParameterCommand = {
|
|
64
|
-
readonly type: 'PARAMETER';
|
|
65
|
-
readonly isInput: boolean;
|
|
66
|
-
readonly isOutput: boolean;
|
|
67
|
-
readonly parameterName: string_name;
|
|
68
|
-
readonly parameterDescription: string_markdown_text | null;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Postprocess command describes which function to use for postprocessing
|
|
72
|
-
* This will be created as separate EXECUTE SCRIPT block bellow
|
|
73
|
-
*/
|
|
74
|
-
export type PostprocessCommand = {
|
|
75
|
-
readonly type: 'POSTPROCESS';
|
|
76
|
-
readonly functionName: string_name;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Expect command describes the desired output of the prompt template (after post-processing)
|
|
80
|
-
* It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs or some other shape of the output.
|
|
81
|
-
*/
|
|
82
|
-
export type ExpectCommand = ExpectAmountCommand | ExpectFormatCommand;
|
|
83
|
-
/**
|
|
84
|
-
* Expect amount command describes the desired output of the prompt template (after post-processing)
|
|
85
|
-
* It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs,...
|
|
86
|
-
*
|
|
87
|
-
* Note: LLMs work with tokens, not characters, but in Promptbooks we want to use some human-recognisable and cross-model interoperable units.
|
|
88
|
-
*/
|
|
89
|
-
export type ExpectAmountCommand = {
|
|
90
|
-
readonly type: 'EXPECT_AMOUNT';
|
|
91
|
-
readonly sign: 'EXACTLY' | 'MINIMUM' | 'MAXIMUM';
|
|
92
|
-
readonly unit: ExpectationUnit;
|
|
93
|
-
readonly amount: ExpectationAmount;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Represents a command that expects a specific format.
|
|
97
|
-
*/
|
|
98
|
-
export type ExpectFormatCommand = {
|
|
99
|
-
readonly type: 'EXPECT_FORMAT';
|
|
100
|
-
readonly format: 'JSON';
|
|
101
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TupleToUnion } from 'type-fest';
|
|
2
|
-
/**
|
|
3
|
-
* Execution type describes the way how the block is executed
|
|
4
|
-
*
|
|
5
|
-
* @see https://github.com/webgptorg/promptbook#execution-type
|
|
6
|
-
*/
|
|
7
|
-
export type ExecutionType = TupleToUnion<typeof ExecutionTypes>;
|
|
8
|
-
/**
|
|
9
|
-
* Execution type describes the way how the block is executed
|
|
10
|
-
*
|
|
11
|
-
* @see https://github.com/webgptorg/promptbook#execution-type
|
|
12
|
-
*/
|
|
13
|
-
export declare const ExecutionTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT", "PROMPT_DIALOG"];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the structure of a markdown file.
|
|
3
|
-
*
|
|
4
|
-
* @private within the package
|
|
5
|
-
*/
|
|
6
|
-
export type MarkdownStructure = {
|
|
7
|
-
/**
|
|
8
|
-
* The section level of the markdown file.
|
|
9
|
-
* h1 is level 1, h2 is level 2, etc.
|
|
10
|
-
*/
|
|
11
|
-
level: number;
|
|
12
|
-
/**
|
|
13
|
-
* The title of the markdown file.
|
|
14
|
-
*/
|
|
15
|
-
title: string;
|
|
16
|
-
/**
|
|
17
|
-
* Content of the section.
|
|
18
|
-
* It contains text, images, formatting, ul, ol, hr, blockquotes, etc. BUT not headings and sub-sections
|
|
19
|
-
*/
|
|
20
|
-
content: string;
|
|
21
|
-
/**
|
|
22
|
-
* The sub-sections of current section which are recursively structured.
|
|
23
|
-
*/
|
|
24
|
-
sections: MarkdownStructure[];
|
|
25
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { MarkdownStructure } from './MarkdownStructure';
|
|
2
|
-
/**
|
|
3
|
-
* Parse a markdown string into a MarkdownStructure object.
|
|
4
|
-
*
|
|
5
|
-
* Note: This function does work with code blocks
|
|
6
|
-
* Note: This function does not work with markdown comments
|
|
7
|
-
*
|
|
8
|
-
* @param markdown The markdown string to parse.
|
|
9
|
-
* @returns The MarkdownStructure object.
|
|
10
|
-
*
|
|
11
|
-
* @private within the package
|
|
12
|
-
*/
|
|
13
|
-
export declare function markdownToMarkdownStructure(markdown: string): MarkdownStructure;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Command } from '../../types/Command';
|
|
2
|
-
import type { string_markdown_text } from '../../types/typeAliases';
|
|
3
|
-
/**
|
|
4
|
-
* Parses one line of ul/ol to command
|
|
5
|
-
*
|
|
6
|
-
* @returns parsed command object
|
|
7
|
-
* @throws {SyntaxError} if the command is invalid
|
|
8
|
-
*
|
|
9
|
-
* @private within the pipelineStringToJson
|
|
10
|
-
*/
|
|
11
|
-
export declare function parseCommand(listItem: string_markdown_text): Command;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This error occurs during the parameter replacement in the template
|
|
3
|
-
*
|
|
4
|
-
* Note: This is a kindof subtype of ExecutionError because it occurs during the execution of the pipeline
|
|
5
|
-
*/
|
|
6
|
-
export declare class TemplateError extends Error {
|
|
7
|
-
readonly name = "TemplateError";
|
|
8
|
-
constructor(message: string);
|
|
9
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';
|
|
2
|
-
import type { client_id } from '../../types/typeAliases';
|
|
3
|
-
import type { string_uri } from '../../types/typeAliases';
|
|
4
|
-
/**
|
|
5
|
-
* Options for MultipleLlmExecutionTools
|
|
6
|
-
*/
|
|
7
|
-
export type MultipleLlmExecutionToolsOptions = CommonExecutionToolsOptions & {
|
|
8
|
-
/**
|
|
9
|
-
* URL of the multiple PROMPTBOOK server
|
|
10
|
-
* On this server will be connected to the socket.io server
|
|
11
|
-
*/
|
|
12
|
-
readonly multipleUrl: URL;
|
|
13
|
-
/**
|
|
14
|
-
* Path for the Socket.io server to listen
|
|
15
|
-
*
|
|
16
|
-
* @default '/socket.io'
|
|
17
|
-
* @example '/promptbook/socket.io'
|
|
18
|
-
*/
|
|
19
|
-
readonly path: string_uri;
|
|
20
|
-
/**
|
|
21
|
-
* Your client ID
|
|
22
|
-
*/
|
|
23
|
-
readonly clientId: client_id;
|
|
24
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { ExecutionType } from './ExecutionTypes';
|
|
2
|
-
import type { ModelRequirements } from './ModelRequirements';
|
|
3
|
-
import type { ExpectationAmount } from './PipelineJson/PromptTemplateJson';
|
|
4
|
-
import type { ExpectationUnit } from './PipelineJson/PromptTemplateJson';
|
|
5
|
-
import type { string_markdown_text } from './typeAliases';
|
|
6
|
-
import type { string_name } from './typeAliases';
|
|
7
|
-
import type { string_version } from './typeAliases';
|
|
8
|
-
/**
|
|
9
|
-
* Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
|
|
10
|
-
* It is parsed from the markdown from ul/ol items - one command per one item.
|
|
11
|
-
*/
|
|
12
|
-
export type Command = PromptbookUrlCommand | PromptbookVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
|
|
13
|
-
/**
|
|
14
|
-
* PromptbookVersion command tells which version is .promptbook file using
|
|
15
|
-
*
|
|
16
|
-
* - It is used for backward compatibility
|
|
17
|
-
* - It is defined per whole .promptbook file in the header
|
|
18
|
-
*/
|
|
19
|
-
export type PromptbookUrlCommand = {
|
|
20
|
-
readonly type: 'PIPELINE_URL';
|
|
21
|
-
readonly pipelineUrl: URL;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* PromptbookVersion command tells which version is .promptbook file using
|
|
25
|
-
*
|
|
26
|
-
* - It is used for backward compatibility
|
|
27
|
-
* - It is defined per whole .promptbook file in the header
|
|
28
|
-
*/
|
|
29
|
-
export type PromptbookVersionCommand = {
|
|
30
|
-
readonly type: 'PROMPTBOOK_VERSION';
|
|
31
|
-
readonly promptbookVersion: string_version;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Execute command tells how to execute the section
|
|
35
|
-
* It can be either prompt template, script or SIMPLE TEMPLATE etc.
|
|
36
|
-
*/
|
|
37
|
-
export type ExecuteCommand = {
|
|
38
|
-
readonly type: 'EXECUTE';
|
|
39
|
-
readonly executionType: ExecutionType;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Model command tells which model and modelRequirements to use for the prompt template. execution
|
|
43
|
-
*/
|
|
44
|
-
export type ModelCommand = {
|
|
45
|
-
readonly type: 'MODEL';
|
|
46
|
-
readonly key: keyof ModelRequirements;
|
|
47
|
-
readonly value: any;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Joker parameter is used instead of executing the prompt template if it meet the expectations requirements
|
|
51
|
-
*/
|
|
52
|
-
export type JokerCommand = {
|
|
53
|
-
readonly type: 'JOKER';
|
|
54
|
-
readonly parameterName: string_name;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Parameter command describes one parameter of the prompt template
|
|
58
|
-
*
|
|
59
|
-
* - It can tell if it is input or OUTPUT PARAMETER
|
|
60
|
-
* - It can have description
|
|
61
|
-
* - In description it can have simple formatting BUT not markdown structure or reference to other parameters
|
|
62
|
-
*/
|
|
63
|
-
export type ParameterCommand = {
|
|
64
|
-
readonly type: 'PARAMETER';
|
|
65
|
-
readonly isInput: boolean;
|
|
66
|
-
readonly isOutput: boolean;
|
|
67
|
-
readonly parameterName: string_name;
|
|
68
|
-
readonly parameterDescription: string_markdown_text | null;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Postprocess command describes which function to use for postprocessing
|
|
72
|
-
* This will be created as separate EXECUTE SCRIPT block bellow
|
|
73
|
-
*/
|
|
74
|
-
export type PostprocessCommand = {
|
|
75
|
-
readonly type: 'POSTPROCESS';
|
|
76
|
-
readonly functionName: string_name;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Expect command describes the desired output of the prompt template (after post-processing)
|
|
80
|
-
* It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs or some other shape of the output.
|
|
81
|
-
*/
|
|
82
|
-
export type ExpectCommand = ExpectAmountCommand | ExpectFormatCommand;
|
|
83
|
-
/**
|
|
84
|
-
* Expect amount command describes the desired output of the prompt template (after post-processing)
|
|
85
|
-
* It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs,...
|
|
86
|
-
*
|
|
87
|
-
* Note: LLMs work with tokens, not characters, but in Promptbooks we want to use some human-recognisable and cross-model interoperable units.
|
|
88
|
-
*/
|
|
89
|
-
export type ExpectAmountCommand = {
|
|
90
|
-
readonly type: 'EXPECT_AMOUNT';
|
|
91
|
-
readonly sign: 'EXACTLY' | 'MINIMUM' | 'MAXIMUM';
|
|
92
|
-
readonly unit: ExpectationUnit;
|
|
93
|
-
readonly amount: ExpectationAmount;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Represents a command that expects a specific format.
|
|
97
|
-
*/
|
|
98
|
-
export type ExpectFormatCommand = {
|
|
99
|
-
readonly type: 'EXPECT_FORMAT';
|
|
100
|
-
readonly format: 'JSON';
|
|
101
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TupleToUnion } from 'type-fest';
|
|
2
|
-
/**
|
|
3
|
-
* Execution type describes the way how the block is executed
|
|
4
|
-
*
|
|
5
|
-
* @see https://github.com/webgptorg/promptbook#execution-type
|
|
6
|
-
*/
|
|
7
|
-
export type ExecutionType = TupleToUnion<typeof ExecutionTypes>;
|
|
8
|
-
/**
|
|
9
|
-
* Execution type describes the way how the block is executed
|
|
10
|
-
*
|
|
11
|
-
* @see https://github.com/webgptorg/promptbook#execution-type
|
|
12
|
-
*/
|
|
13
|
-
export declare const ExecutionTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT", "PROMPT_DIALOG"];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the structure of a markdown file.
|
|
3
|
-
*
|
|
4
|
-
* @private within the package
|
|
5
|
-
*/
|
|
6
|
-
export type MarkdownStructure = {
|
|
7
|
-
/**
|
|
8
|
-
* The section level of the markdown file.
|
|
9
|
-
* h1 is level 1, h2 is level 2, etc.
|
|
10
|
-
*/
|
|
11
|
-
level: number;
|
|
12
|
-
/**
|
|
13
|
-
* The title of the markdown file.
|
|
14
|
-
*/
|
|
15
|
-
title: string;
|
|
16
|
-
/**
|
|
17
|
-
* Content of the section.
|
|
18
|
-
* It contains text, images, formatting, ul, ol, hr, blockquotes, etc. BUT not headings and sub-sections
|
|
19
|
-
*/
|
|
20
|
-
content: string;
|
|
21
|
-
/**
|
|
22
|
-
* The sub-sections of current section which are recursively structured.
|
|
23
|
-
*/
|
|
24
|
-
sections: MarkdownStructure[];
|
|
25
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { MarkdownStructure } from './MarkdownStructure';
|
|
2
|
-
/**
|
|
3
|
-
* Parse a markdown string into a MarkdownStructure object.
|
|
4
|
-
*
|
|
5
|
-
* Note: This function does work with code blocks
|
|
6
|
-
* Note: This function does not work with markdown comments
|
|
7
|
-
*
|
|
8
|
-
* @param markdown The markdown string to parse.
|
|
9
|
-
* @returns The MarkdownStructure object.
|
|
10
|
-
*
|
|
11
|
-
* @private within the package
|
|
12
|
-
*/
|
|
13
|
-
export declare function markdownToMarkdownStructure(markdown: string): MarkdownStructure;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|