@promptbook/openai 0.60.1 → 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 +37 -19
- 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 +37 -19
- 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,9 @@
|
|
|
1
|
+
import type { TupleToUnion } from 'type-fest';
|
|
2
|
+
/**
|
|
3
|
+
* Where the command can be used
|
|
4
|
+
*/
|
|
5
|
+
export type CommandUsagePlace = TupleToUnion<typeof CommandUsagePlaces>;
|
|
6
|
+
/**
|
|
7
|
+
* Where the command can be used
|
|
8
|
+
*/
|
|
9
|
+
export declare const CommandUsagePlaces: readonly ["PIPELINE_HEAD", "PIPELINE_TEMPLATE"];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All available command parsers
|
|
3
|
+
*/
|
|
4
|
+
export declare const COMMANDS: readonly [import("./_common/types/CommandParser").CommandParser<import("./BLOCK/BlockCommand").BlockCommand>, import("./_common/types/CommandParser").CommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").CommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").CommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").CommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").CommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").CommandParser<import("./PROMPTBOOK_VERSION/PromptbookVersionCommand").PromptbookVersionCommand>, import("./_common/types/CommandParser").CommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").CommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").CommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").CommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").CommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").CommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
|
|
@@ -10,3 +10,7 @@ export declare const CHARACTER_LOOP_LIMIT = 100000;
|
|
|
10
10
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
11
11
|
*/
|
|
12
12
|
export declare const PIPELINE_COLLECTION_BASE_FILENAME = "index";
|
|
13
|
+
/**
|
|
14
|
+
* The names of the parameters that are reserved for special purposes
|
|
15
|
+
*/
|
|
16
|
+
export declare const RESERVED_PARAMETER_NAMES: string[];
|
|
@@ -8,5 +8,7 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
|
|
10
10
|
/**
|
|
11
|
+
* TODO: !!!!! Implement new features and commands into `promptTemplateParameterJsonToString`
|
|
12
|
+
* TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
|
|
11
13
|
* TODO: Escape all
|
|
12
14
|
*/
|
|
@@ -4,7 +4,7 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
4
4
|
/**
|
|
5
5
|
* Options for pipelineStringToJson
|
|
6
6
|
*/
|
|
7
|
-
type PipelineStringToJsonOptions = {
|
|
7
|
+
export type PipelineStringToJsonOptions = {
|
|
8
8
|
/**
|
|
9
9
|
* Tools for processing required for knowledge processing *(not for actual execution)*
|
|
10
10
|
*/
|
|
@@ -20,13 +20,12 @@ type PipelineStringToJsonOptions = {
|
|
|
20
20
|
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
21
21
|
* @param options - Options and tools for the compilation
|
|
22
22
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
23
|
-
* @throws {
|
|
23
|
+
* @throws {ParsingError} if the promptbook string is not valid
|
|
24
24
|
*
|
|
25
25
|
* Note: This function does not validate logic of the pipeline only the syntax
|
|
26
26
|
* Note: This function acts as compilation process
|
|
27
27
|
*/
|
|
28
28
|
export declare function pipelineStringToJson(pipelineString: PipelineString, options?: PipelineStringToJsonOptions): Promise<PipelineJson>;
|
|
29
|
-
export {};
|
|
30
29
|
/**
|
|
31
30
|
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
32
31
|
*/
|
|
@@ -10,14 +10,16 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
10
10
|
* @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
|
|
11
11
|
* @param options - Options and tools for the compilation
|
|
12
12
|
* @returns {Promptbook} compiled in JSON format (.ptbk.json)
|
|
13
|
-
* @throws {
|
|
13
|
+
* @throws {ParsingError} if the promptbook string is not valid
|
|
14
14
|
*
|
|
15
15
|
* Note: This function does not validate logic of the pipeline only the syntax
|
|
16
16
|
* Note: This function acts as compilation process
|
|
17
17
|
*/
|
|
18
18
|
export declare function pipelineStringToJsonSync(pipelineString: PipelineString): PipelineJson;
|
|
19
19
|
/**
|
|
20
|
-
* TODO:
|
|
20
|
+
* TODO: !!!! Warn if used only sync version
|
|
21
|
+
* TODO: [🚞] Report here line/column of error
|
|
21
22
|
* TODO: Use spaceTrim more effectively
|
|
22
23
|
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
24
|
+
* TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
|
|
23
25
|
*/
|
|
@@ -5,9 +5,9 @@ import type { string_name } from '../../types/typeAliases';
|
|
|
5
5
|
*
|
|
6
6
|
* @param promptTemplate the template with used parameters
|
|
7
7
|
* @returns the set of parameter names
|
|
8
|
-
* @throws {
|
|
8
|
+
* @throws {ParsingError} if the script is invalid
|
|
9
9
|
*/
|
|
10
|
-
export declare function extractParametersFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | '
|
|
10
|
+
export declare function extractParametersFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | 'blockType' | 'content'>): Set<string_name>;
|
|
11
11
|
/**
|
|
12
12
|
* TODO: [🔣] If script require contentLanguage
|
|
13
13
|
*/
|
|
@@ -5,7 +5,7 @@ import type { string_javascript_name } from '../../types/typeAliases';
|
|
|
5
5
|
*
|
|
6
6
|
* @param script from which to extract the variables
|
|
7
7
|
* @returns the list of variable names
|
|
8
|
-
* @throws {
|
|
8
|
+
* @throws {ParsingError} if the script is invalid
|
|
9
9
|
*/
|
|
10
10
|
export declare function extractVariables(script: string_javascript): Set<string_javascript_name>;
|
|
11
11
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
5
|
-
readonly name = "
|
|
4
|
+
export declare class ParsingError extends Error {
|
|
5
|
+
readonly name = "ParsingError";
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error indicates errors during the execution of the pipeline
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
5
|
-
readonly name = "
|
|
4
|
+
export declare class PipelineExecutionError extends Error {
|
|
5
|
+
readonly name = "PipelineExecutionError";
|
|
6
6
|
constructor(message: string);
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
3
3
|
*
|
|
4
|
-
* @private Always catched and rethrown as `
|
|
5
|
-
* Note: This is a kindof subtype of
|
|
4
|
+
* @private Always catched and rethrown as `PipelineExecutionError`
|
|
5
|
+
* Note: This is a kindof subtype of PipelineExecutionError
|
|
6
6
|
*/
|
|
7
7
|
export declare class ExpectError extends Error {
|
|
8
8
|
readonly name = "ExpectError";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Arrayable } from '../types/Arrayable';
|
|
1
2
|
import type { LlmExecutionTools } from './LlmExecutionTools';
|
|
2
3
|
import type { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
3
4
|
import type { UserInterfaceTools } from './UserInterfaceTools';
|
|
@@ -10,10 +11,10 @@ export type ExecutionTools = {
|
|
|
10
11
|
/**
|
|
11
12
|
* Tools for executing prompts to large language models like GPT-4
|
|
12
13
|
*
|
|
13
|
-
* Tip: Combine multiple LLM execution tools
|
|
14
|
+
* Tip: Combine multiple LLM execution tools - use array of LlmExecutionTools instead of single LlmExecutionTools
|
|
14
15
|
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#llm-execution-tools
|
|
15
16
|
*/
|
|
16
|
-
llm
|
|
17
|
+
llm?: Arrayable<LlmExecutionTools>;
|
|
17
18
|
/**
|
|
18
19
|
* Tools for executing scripts
|
|
19
20
|
*
|
|
@@ -21,7 +22,7 @@ export type ExecutionTools = {
|
|
|
21
22
|
* If none of them supports the script, an error is thrown
|
|
22
23
|
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#script-execution-tools
|
|
23
24
|
*/
|
|
24
|
-
script
|
|
25
|
+
script?: Arrayable<ScriptExecutionTools>;
|
|
25
26
|
/**
|
|
26
27
|
* Tools for interacting with the user
|
|
27
28
|
*
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
2
|
import type { ModelVariant } from '../types/ModelRequirements';
|
|
3
3
|
import type { Prompt } from '../types/Prompt';
|
|
4
|
+
import type { string_markdown } from '../types/typeAliases';
|
|
5
|
+
import type { string_markdown_text } from '../types/typeAliases';
|
|
4
6
|
import type { string_model_name } from '../types/typeAliases';
|
|
5
7
|
import type { string_title } from '../types/typeAliases';
|
|
6
8
|
import type { PromptChatResult } from './PromptResult';
|
|
7
9
|
import type { PromptCompletionResult } from './PromptResult';
|
|
10
|
+
import type { PromptEmbeddingResult } from './PromptResult';
|
|
8
11
|
/**
|
|
9
12
|
* Container for all the tools needed to execute prompts to large language models like GPT-4
|
|
10
13
|
* On its interface it exposes common methods for prompt execution.
|
|
@@ -14,13 +17,29 @@ import type { PromptCompletionResult } from './PromptResult';
|
|
|
14
17
|
*/
|
|
15
18
|
export type LlmExecutionTools = {
|
|
16
19
|
/**
|
|
17
|
-
*
|
|
20
|
+
* Title of the model provider
|
|
21
|
+
*
|
|
22
|
+
* @example "OpenAI"
|
|
18
23
|
*/
|
|
19
|
-
|
|
24
|
+
readonly title: string_title & string_markdown_text;
|
|
20
25
|
/**
|
|
21
|
-
*
|
|
26
|
+
* Description of the provider
|
|
27
|
+
*
|
|
28
|
+
* @example "Use all models from OpenAI"
|
|
22
29
|
*/
|
|
23
|
-
|
|
30
|
+
readonly description: string_markdown;
|
|
31
|
+
/**
|
|
32
|
+
* Calls a chat model
|
|
33
|
+
*/
|
|
34
|
+
callChatModel?(prompt: Prompt): Promise<PromptChatResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Calls a completion model
|
|
37
|
+
*/
|
|
38
|
+
callCompletionModel?(prompt: Prompt): Promise<PromptCompletionResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Calls an embedding model
|
|
41
|
+
*/
|
|
42
|
+
callEmbeddingModel?(prompt: Prompt): Promise<PromptEmbeddingResult>;
|
|
24
43
|
/**
|
|
25
44
|
* List all available models that can be used
|
|
26
45
|
*/
|
|
@@ -44,8 +63,8 @@ export type AvailableModel = {
|
|
|
44
63
|
readonly modelVariant: ModelVariant;
|
|
45
64
|
};
|
|
46
65
|
/**
|
|
66
|
+
* TODO: !!!! Translation model
|
|
47
67
|
* TODO: [🧠] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
|
|
48
68
|
* TODO: [🍓][♐] Some heuristic to pick the best model in listed models
|
|
49
|
-
* TODO: [🏳] callChatModel -> chat, callCompletionModel -> complete, translate
|
|
50
69
|
* TODO: [🧠] Should or should not there be a word "GPT" in both callCompletionModel and callChatModel
|
|
51
70
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KebabCase } from 'type-fest';
|
|
2
|
-
import type { ExpectationUnit } from '../types/PipelineJson/
|
|
2
|
+
import type { ExpectationUnit } from '../types/PipelineJson/Expectations';
|
|
3
3
|
import type { number_positive } from '../types/typeAliases';
|
|
4
4
|
import type { number_usd } from '../types/typeAliases';
|
|
5
5
|
import type { string_date_iso8601 } from '../types/typeAliases';
|
|
@@ -11,7 +11,7 @@ import type { EmbeddingVector } from './EmbeddingVector';
|
|
|
11
11
|
*
|
|
12
12
|
* @see https://github.com/webgptorg/promptbook#prompt-result
|
|
13
13
|
*/
|
|
14
|
-
export type PromptResult = PromptCompletionResult | PromptChatResult;
|
|
14
|
+
export type PromptResult = PromptCompletionResult | PromptChatResult | PromptEmbeddingResult;
|
|
15
15
|
/**
|
|
16
16
|
* Prompt completion result
|
|
17
17
|
* It contains only the following text NOT the whole completion
|
|
@@ -3,7 +3,7 @@ import type { PipelineExecutor } from './PipelineExecutor';
|
|
|
3
3
|
* Asserts that the execution of a promptnook is successful
|
|
4
4
|
*
|
|
5
5
|
* @param executionResult - The partial result of the promptnook execution
|
|
6
|
-
* @throws {
|
|
6
|
+
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
7
7
|
*/
|
|
8
8
|
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PipelineExecutor>>, 'isSuccessful' | 'errors'>): void;
|
|
9
9
|
/**
|
|
@@ -6,7 +6,7 @@ import type { string_template } from '../../types/typeAliases';
|
|
|
6
6
|
* @param template the template with parameters in {curly} braces
|
|
7
7
|
* @param parameters the object with parameters
|
|
8
8
|
* @returns the template with replaced parameters
|
|
9
|
-
* @throws {
|
|
9
|
+
* @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
|
|
10
10
|
*
|
|
11
11
|
* @private within the createPipelineExecutor
|
|
12
12
|
*/
|
package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ type PrepareKnowledgeFromMarkdownOptions = {
|
|
|
8
8
|
content: string_markdown;
|
|
9
9
|
/**
|
|
10
10
|
* The LLM tools to use for the conversion and extraction of knowledge
|
|
11
|
+
*
|
|
12
|
+
* Note: If you want to use multiple LLMs, you can use `joinLlmExecutionTools` to join them first
|
|
11
13
|
*/
|
|
12
14
|
llmTools: LlmExecutionTools;
|
|
13
15
|
/**
|
|
@@ -19,3 +21,6 @@ type PrepareKnowledgeFromMarkdownOptions = {
|
|
|
19
21
|
};
|
|
20
22
|
export declare function prepareKnowledgeFromMarkdown(options: PrepareKnowledgeFromMarkdownOptions): Promise<KnowledgeJson>;
|
|
21
23
|
export {};
|
|
24
|
+
/**
|
|
25
|
+
* 11:11
|
|
26
|
+
*/
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AvailableModel } from '../../execution/LlmExecutionTools';
|
|
2
2
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
3
3
|
import type { PromptChatResult } from '../../execution/PromptResult';
|
|
4
|
-
import type { PromptCompletionResult } from '../../execution/PromptResult';
|
|
5
4
|
import type { Prompt } from '../../types/Prompt';
|
|
5
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
6
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
7
|
+
import type { string_title } from '../../types/typeAliases';
|
|
6
8
|
import type { AnthropicClaudeExecutionToolsOptions } from './AnthropicClaudeExecutionToolsOptions';
|
|
7
9
|
/**
|
|
8
10
|
* Execution Tools for calling Anthropic Claude API.
|
|
@@ -19,14 +21,12 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
|
|
|
19
21
|
* @param options which are relevant are directly passed to the Anthropic Claude client
|
|
20
22
|
*/
|
|
21
23
|
constructor(options?: AnthropicClaudeExecutionToolsOptions);
|
|
24
|
+
get title(): string_title & string_markdown_text;
|
|
25
|
+
get description(): string_markdown;
|
|
22
26
|
/**
|
|
23
27
|
* Calls Anthropic Claude API to use a chat model.
|
|
24
28
|
*/
|
|
25
29
|
callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
|
|
26
|
-
/**
|
|
27
|
-
* Calls Anthropic Claude API to use a complete model.
|
|
28
|
-
*/
|
|
29
|
-
callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
|
|
30
30
|
/**
|
|
31
31
|
* Get the model that should be used as default
|
|
32
32
|
*/
|
|
@@ -14,6 +14,7 @@ export declare const ANTHROPIC_CLAUDE_MODELS: Array<AvailableModel & {
|
|
|
14
14
|
};
|
|
15
15
|
}>;
|
|
16
16
|
/**
|
|
17
|
+
* Note: [🤖] Add models of new variant
|
|
17
18
|
* TODO: !!!! Add embedding models OR Anthropic has only chat+completion models?
|
|
18
19
|
* TODO: [🧠] Some mechanism to propagate unsureness
|
|
19
20
|
* TODO: [🧠][👮♀️] Put here more info like description, isVision, trainingDateCutoff, languages, strengths ( Top-level performance, intelligence, fluency, and understanding), contextWindow,...
|
|
@@ -3,6 +3,9 @@ import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
|
3
3
|
import type { PromptChatResult } from '../../execution/PromptResult';
|
|
4
4
|
import type { PromptCompletionResult } from '../../execution/PromptResult';
|
|
5
5
|
import type { Prompt } from '../../types/Prompt';
|
|
6
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
7
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
8
|
+
import type { string_title } from '../../types/typeAliases';
|
|
6
9
|
import type { AzureOpenAiExecutionToolsOptions } from './AzureOpenAiExecutionToolsOptions';
|
|
7
10
|
/**
|
|
8
11
|
* Execution Tools for calling Azure OpenAI API.
|
|
@@ -19,6 +22,8 @@ export declare class AzureOpenAiExecutionTools implements LlmExecutionTools {
|
|
|
19
22
|
* @param options which are relevant are directly passed to the OpenAI client
|
|
20
23
|
*/
|
|
21
24
|
constructor(options: AzureOpenAiExecutionToolsOptions);
|
|
25
|
+
get title(): string_title & string_markdown_text;
|
|
26
|
+
get description(): string_markdown;
|
|
22
27
|
/**
|
|
23
28
|
* Calls OpenAI API to use a chat model.
|
|
24
29
|
*/
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
2
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
3
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
4
|
+
import type { string_title } from '../../types/typeAliases';
|
|
2
5
|
import { OpenAiExecutionTools } from '../openai/OpenAiExecutionTools';
|
|
3
6
|
/**
|
|
4
7
|
* Execution Tools for calling OpenAI API.
|
|
5
8
|
*/
|
|
6
9
|
export declare class LangtailExecutionTools extends OpenAiExecutionTools implements LlmExecutionTools {
|
|
10
|
+
get title(): string_title & string_markdown_text;
|
|
11
|
+
get description(): string_markdown;
|
|
7
12
|
}
|
|
@@ -4,12 +4,17 @@ import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
|
4
4
|
import type { PromptChatResult } from '../../execution/PromptResult';
|
|
5
5
|
import type { PromptCompletionResult } 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
|
/**
|
|
8
11
|
* Mocked execution Tools for just echoing the requests for testing purposes.
|
|
9
12
|
*/
|
|
10
13
|
export declare class MockedEchoLlmExecutionTools implements LlmExecutionTools {
|
|
11
14
|
private readonly options;
|
|
12
15
|
constructor(options?: CommonExecutionToolsOptions);
|
|
16
|
+
get title(): string_title & string_markdown_text;
|
|
17
|
+
get description(): string_markdown;
|
|
13
18
|
/**
|
|
14
19
|
* Mocks chat model
|
|
15
20
|
*/
|
|
@@ -3,13 +3,19 @@ import type { AvailableModel } from '../../execution/LlmExecutionTools';
|
|
|
3
3
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
4
4
|
import type { PromptChatResult } from '../../execution/PromptResult';
|
|
5
5
|
import type { PromptCompletionResult } from '../../execution/PromptResult';
|
|
6
|
+
import type { PromptEmbeddingResult } from '../../execution/PromptResult';
|
|
6
7
|
import type { Prompt } from '../../types/Prompt';
|
|
8
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
9
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
10
|
+
import type { string_title } from '../../types/typeAliases';
|
|
7
11
|
/**
|
|
8
12
|
* Mocked execution Tools for just faking expected responses for testing purposes
|
|
9
13
|
*/
|
|
10
14
|
export declare class MockedFackedLlmExecutionTools implements LlmExecutionTools {
|
|
11
15
|
private readonly options;
|
|
12
16
|
constructor(options?: CommonExecutionToolsOptions);
|
|
17
|
+
get title(): string_title & string_markdown_text;
|
|
18
|
+
get description(): string_markdown;
|
|
13
19
|
/**
|
|
14
20
|
* Fakes chat model
|
|
15
21
|
*/
|
|
@@ -18,6 +24,10 @@ export declare class MockedFackedLlmExecutionTools implements LlmExecutionTools
|
|
|
18
24
|
* Fakes completion model
|
|
19
25
|
*/
|
|
20
26
|
callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptCompletionResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Fakes embedding model
|
|
29
|
+
*/
|
|
30
|
+
callEmbeddingModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptEmbeddingResult>;
|
|
21
31
|
/**
|
|
22
32
|
* List all available fake-models that can be used
|
|
23
33
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PostprocessingFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
2
|
-
import type { Expectations } from '../../types/PipelineJson/
|
|
2
|
+
import type { Expectations } from '../../types/PipelineJson/Expectations';
|
|
3
3
|
/**
|
|
4
4
|
* Gets the expectations and creates a fake text that meets the expectations
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
*/
|