@promptbook/openai 0.63.0-1 → 0.63.0-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/esm/index.es.js +12 -14
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +2 -0
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +6 -4
- package/esm/typings/src/_packages/types.index.d.ts +0 -48
- package/esm/typings/src/_packages/utils.index.d.ts +6 -2
- package/esm/typings/src/cli/cli-commands/about.d.ts +11 -0
- package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -2
- package/esm/typings/src/cli/cli-commands/make.d.ts +4 -1
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
- package/esm/typings/src/cli/promptbookCli.d.ts +3 -1
- package/esm/typings/src/cli/test/ptbk.d.ts +2 -0
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -2
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +2 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +0 -1
- package/esm/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +2 -0
- package/esm/typings/src/commands/index.d.ts +2 -0
- package/esm/typings/src/config.d.ts +33 -5
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +1 -0
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +8 -1
- package/esm/typings/src/errors/_ExpectError.d.ts +2 -1
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +2 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +3 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -0
- package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -0
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
- package/esm/typings/src/execution/utils/computeUsageCounts.d.ts +1 -1
- package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +3 -0
- package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +3 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +2 -0
- package/esm/typings/src/formats/index.d.ts +2 -0
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +2 -0
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +2 -0
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +2 -0
- package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +2 -0
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +4 -2
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -0
- package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +1 -1
- package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +2 -0
- package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +2 -0
- package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +1 -1
- package/esm/typings/src/types/Arrayable.d.ts +1 -1
- package/esm/typings/src/types/ModelVariant.d.ts +8 -7
- package/esm/typings/src/types/PipelineJson/Expectations.d.ts +10 -4
- package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +1 -1
- package/esm/typings/src/types/ScriptLanguage.d.ts +6 -4
- package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +1 -0
- package/esm/typings/src/types/typeAliases.d.ts +2 -1
- package/esm/typings/src/utils/arrayableToArray.d.ts +1 -1
- package/esm/typings/src/utils/deepFreeze.d.ts +6 -5
- package/esm/typings/src/utils/files/isDirectoryExisting.d.ts +13 -0
- package/esm/typings/src/utils/files/isFileExisting.d.ts +12 -0
- package/esm/typings/src/utils/files/listAllFiles.d.ts +15 -0
- package/esm/typings/src/utils/getCurrentIsoDate.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.d.ts +3 -1
- package/esm/typings/src/utils/validators/email/isValidEmail.d.ts +2 -0
- package/package.json +10 -10
- package/umd/index.umd.js +12 -14
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/types/execution-report/config.d.ts +0 -8
- package/umd/typings/promptbook-collection/index.d.ts +0 -252
- package/umd/typings/src/_packages/anthropic-claude.index.d.ts +0 -6
- package/umd/typings/src/_packages/azure-openai.index.d.ts +0 -6
- package/umd/typings/src/_packages/browser.index.d.ts +0 -6
- package/umd/typings/src/_packages/cli.index.d.ts +0 -4
- package/umd/typings/src/_packages/core.index.d.ts +0 -124
- package/umd/typings/src/_packages/execute-javascript.index.d.ts +0 -8
- package/umd/typings/src/_packages/fake-llm.index.d.ts +0 -6
- package/umd/typings/src/_packages/langtail.index.d.ts +0 -6
- package/umd/typings/src/_packages/markdown-utils.index.d.ts +0 -36
- package/umd/typings/src/_packages/node.index.d.ts +0 -8
- package/umd/typings/src/_packages/openai.index.d.ts +0 -8
- package/umd/typings/src/_packages/remote-client.index.d.ts +0 -8
- package/umd/typings/src/_packages/remote-server.index.d.ts +0 -6
- package/umd/typings/src/_packages/types.index.d.ts +0 -462
- package/umd/typings/src/_packages/utils.index.d.ts +0 -130
- package/umd/typings/src/cli/cli-commands/hello.d.ts +0 -10
- package/umd/typings/src/cli/cli-commands/make.d.ts +0 -10
- package/umd/typings/src/cli/cli-commands/prettify.d.ts +0 -10
- package/umd/typings/src/cli/main.d.ts +0 -12
- package/umd/typings/src/cli/promptbookCli.d.ts +0 -10
- package/umd/typings/src/collection/PipelineCollection.d.ts +0 -25
- package/umd/typings/src/collection/SimplePipelineCollection.d.ts +0 -38
- package/umd/typings/src/collection/collectionToJson.d.ts +0 -13
- package/umd/typings/src/collection/collectionToJson.test.d.ts +0 -7
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +0 -48
- package/umd/typings/src/collection/constructors/createCollectionFromJson.d.ts +0 -13
- package/umd/typings/src/collection/constructors/createCollectionFromPromise.d.ts +0 -23
- package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +0 -29
- package/umd/typings/src/collection/constructors/createSubcollection.d.ts +0 -13
- package/umd/typings/src/commands/BLOCK/BlockCommand.d.ts +0 -11
- package/umd/typings/src/commands/BLOCK/BlockTypes.d.ts +0 -15
- package/umd/typings/src/commands/BLOCK/blockCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/EXPECT/ExpectAmountCommand.d.ts +0 -14
- package/umd/typings/src/commands/EXPECT/ExpectCommand.d.ts +0 -9
- package/umd/typings/src/commands/EXPECT/ExpectFormatCommand.d.ts +0 -7
- package/umd/typings/src/commands/EXPECT/expectCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/EXPECT/expectCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/JOKER/JokerCommand.d.ts +0 -11
- package/umd/typings/src/commands/JOKER/jokerCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/JOKER/jokerCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +0 -11
- package/umd/typings/src/commands/KNOWLEDGE/knowledgeCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +0 -13
- package/umd/typings/src/commands/MODEL/modelCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/MODEL/modelCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/PARAMETER/ParameterCommand.d.ts +0 -15
- package/umd/typings/src/commands/PARAMETER/parameterCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +0 -13
- package/umd/typings/src/commands/PERSONA/personaCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/PERSONA/personaCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/POSTPROCESS/PostprocessCommand.d.ts +0 -11
- package/umd/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +0 -11
- package/umd/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/URL/UrlCommand.d.ts +0 -10
- package/umd/typings/src/commands/URL/urlCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/URL/urlCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/X_ACTION/ActionCommand.d.ts +0 -9
- package/umd/typings/src/commands/X_ACTION/actionCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/X_ACTION/actionCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +0 -9
- package/umd/typings/src/commands/X_INSTRUMENT/instrumentCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +0 -9
- package/umd/typings/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +0 -10
- package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +0 -13
- package/umd/typings/src/commands/_common/parseCommand.d.ts +0 -12
- package/umd/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
- package/umd/typings/src/commands/_common/types/Command.d.ts +0 -6
- package/umd/typings/src/commands/_common/types/CommandParser.d.ts +0 -64
- package/umd/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +0 -9
- package/umd/typings/src/commands/index.d.ts +0 -4
- package/umd/typings/src/config.d.ts +0 -87
- package/umd/typings/src/config.test.d.ts +0 -4
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +0 -16
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +0 -38
- package/umd/typings/src/conversion/pipelineStringToJson.test.d.ts +0 -1
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +0 -29
- package/umd/typings/src/conversion/pipelineStringToJsonSync.test.d.ts +0 -1
- package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +0 -13
- package/umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts +0 -12
- package/umd/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -27
- package/umd/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.d.ts +0 -14
- package/umd/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.test.d.ts +0 -1
- package/umd/typings/src/conversion/utils/extractVariables.d.ts +0 -14
- package/umd/typings/src/conversion/utils/extractVariables.test.d.ts +0 -1
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +0 -26
- package/umd/typings/src/conversion/utils/renameParameter.test.d.ts +0 -1
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.d.ts +0 -16
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.test.d.ts +0 -1
- package/umd/typings/src/conversion/utils/titleToName.d.ts +0 -9
- package/umd/typings/src/conversion/utils/titleToName.test.d.ts +0 -1
- package/umd/typings/src/conversion/validation/_importPipeline.d.ts +0 -22
- package/umd/typings/src/conversion/validation/pipelineStringToJson-syntaxErrors.test.d.ts +0 -1
- package/umd/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -4
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +0 -37
- package/umd/typings/src/conversion/validation/validatePipeline.test.d.ts +0 -1
- package/umd/typings/src/errors/CollectionError.d.ts +0 -9
- package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +0 -9
- package/umd/typings/src/errors/LimitReachedError.d.ts +0 -9
- package/umd/typings/src/errors/NotFoundError.d.ts +0 -9
- package/umd/typings/src/errors/NotYetImplementedError.d.ts +0 -9
- package/umd/typings/src/errors/ParsingError.d.ts +0 -9
- package/umd/typings/src/errors/PipelineExecutionError.d.ts +0 -9
- package/umd/typings/src/errors/PipelineLogicError.d.ts +0 -9
- package/umd/typings/src/errors/ReferenceError.d.ts +0 -9
- package/umd/typings/src/errors/UnexpectedError.d.ts +0 -9
- package/umd/typings/src/errors/VersionMismatchError.d.ts +0 -10
- package/umd/typings/src/errors/_ExpectError.d.ts +0 -10
- package/umd/typings/src/execution/CommonExecutionToolsOptions.d.ts +0 -10
- package/umd/typings/src/execution/EmbeddingVector.d.ts +0 -8
- package/umd/typings/src/execution/ExecutionTools.d.ts +0 -33
- package/umd/typings/src/execution/LlmExecutionTools.d.ts +0 -72
- package/umd/typings/src/execution/PipelineExecutor.d.ts +0 -64
- package/umd/typings/src/execution/PromptResult.d.ts +0 -99
- package/umd/typings/src/execution/PromptResultUsage.d.ts +0 -29
- package/umd/typings/src/execution/ScriptExecutionTools.d.ts +0 -39
- package/umd/typings/src/execution/UncertainNumber.d.ts +0 -18
- package/umd/typings/src/execution/UserInterfaceTools.d.ts +0 -46
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +0 -12
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +0 -71
- package/umd/typings/src/execution/embeddingVectorToString.d.ts +0 -7
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +0 -4
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +0 -9
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +0 -5
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +0 -11
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +0 -4
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +0 -7
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +0 -1
- package/umd/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +0 -5
- package/umd/typings/src/execution/utils/addUsage.d.ts +0 -65
- package/umd/typings/src/execution/utils/addUsage.test.d.ts +0 -1
- package/umd/typings/src/execution/utils/checkExpectations.d.ts +0 -27
- package/umd/typings/src/execution/utils/checkExpectations.test.d.ts +0 -1
- package/umd/typings/src/execution/utils/computeUsageCounts.d.ts +0 -10
- package/umd/typings/src/execution/utils/forEachAsync.d.ts +0 -19
- package/umd/typings/src/execution/utils/uncertainNumber.d.ts +0 -9
- package/umd/typings/src/execution/utils/usageToHuman.d.ts +0 -17
- package/umd/typings/src/execution/utils/usageToHuman.test.d.ts +0 -1
- package/umd/typings/src/execution/utils/usageToWorktime.d.ts +0 -12
- package/umd/typings/src/execution/utils/usageToWorktime.test.d.ts +0 -1
- package/umd/typings/src/expectations/drafts/isDomainNameFree.d.ts +0 -6
- package/umd/typings/src/expectations/drafts/isGithubNameFree.d.ts +0 -6
- package/umd/typings/src/formats/_common/FormatDefinition.d.ts +0 -70
- package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +0 -12
- package/umd/typings/src/formats/index.d.ts +0 -4
- package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +0 -16
- package/umd/typings/src/formats/json/utils/isValidJsonString.d.ts +0 -6
- package/umd/typings/src/formats/json/utils/isValidJsonString.test.d.ts +0 -1
- package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +0 -14
- package/umd/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -16
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +0 -17
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +0 -14
- package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +0 -22
- package/umd/typings/src/knowledge/dialogs/user-interface-execution-tools.test.d.ts +0 -1
- package/umd/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +0 -37
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +0 -18
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +0 -1
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +0 -2
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +0 -14
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +0 -4
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +0 -13
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +0 -1
- package/umd/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +0 -37
- package/umd/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +0 -20
- package/umd/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +0 -21
- package/umd/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -29
- package/umd/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +0 -16
- package/umd/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +0 -19
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -15
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +0 -17
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -36
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +0 -52
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +0 -12
- package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +0 -22
- package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -6
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -50
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +0 -36
- package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +0 -5
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +0 -17
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +0 -13
- package/umd/typings/src/llm-providers/langtail/playground/playground.d.ts +0 -2
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -36
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -40
- package/umd/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +0 -14
- package/umd/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +0 -1
- package/umd/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +0 -1
- package/umd/typings/src/llm-providers/mocked/test/joker.test.d.ts +0 -4
- package/umd/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -5
- package/umd/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -4
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +0 -54
- package/umd/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +0 -21
- package/umd/typings/src/llm-providers/multiple/playground/playground.d.ts +0 -2
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +0 -68
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +0 -20
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +0 -14
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.test.d.ts +0 -1
- package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +0 -16
- package/umd/typings/src/llm-providers/openai/computeUsage.test.d.ts +0 -1
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +0 -29
- package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +0 -5
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +0 -56
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +0 -26
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Error.d.ts +0 -11
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Progress.d.ts +0 -12
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Request.d.ts +0 -17
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Response.d.ts +0 -12
- package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +0 -37
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +0 -21
- package/umd/typings/src/personas/preparePersona.d.ts +0 -15
- package/umd/typings/src/personas/preparePersona.test.d.ts +0 -1
- package/umd/typings/src/postprocessing/utils/extractBlock.d.ts +0 -17
- package/umd/typings/src/prepare/PrepareOptions.d.ts +0 -22
- package/umd/typings/src/prepare/isPipelinePrepared.d.ts +0 -15
- package/umd/typings/src/prepare/isPipelinePrepared.test.d.ts +0 -1
- package/umd/typings/src/prepare/preparePipeline.d.ts +0 -16
- package/umd/typings/src/prepare/prepareTemplates.d.ts +0 -32
- package/umd/typings/src/prepare/unpreparePipeline.d.ts +0 -12
- package/umd/typings/src/scripting/_test/custom-function-async.test.ts.test.d.ts +0 -1
- package/umd/typings/src/scripting/_test/custom-function-missing.test.d.ts +0 -1
- package/umd/typings/src/scripting/_test/custom-function-with-dependencies.test.d.ts +0 -1
- package/umd/typings/src/scripting/_test/custom-function.test.d.ts +0 -1
- package/umd/typings/src/scripting/_test/postprocessing.test.d.ts +0 -1
- package/umd/typings/src/scripting/_test/script-execution-errors.test.d.ts +0 -1
- package/umd/typings/src/scripting/_test/script-execution-tools.test.d.ts +0 -1
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +0 -22
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -4
- package/umd/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +0 -8
- package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -26
- package/umd/typings/src/scripting/javascript/postprocessing-functions.d.ts +0 -51
- package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +0 -12
- package/umd/typings/src/scripting/javascript/utils/unknownToString.d.ts +0 -8
- package/umd/typings/src/scripting/python/PythonExecutionTools.d.ts +0 -16
- package/umd/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +0 -16
- package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +0 -24
- package/umd/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -5
- package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +0 -31
- package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -10
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +0 -7
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +0 -1
- package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +0 -10
- package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +0 -10
- package/umd/typings/src/storage/memory/MemoryStorage.d.ts +0 -33
- package/umd/typings/src/storage/utils/PrefixStorage.d.ts +0 -25
- package/umd/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -11
- package/umd/typings/src/types/Arrayable.d.ts +0 -10
- package/umd/typings/src/types/ModelRequirements.d.ts +0 -102
- package/umd/typings/src/types/ModelVariant.d.ts +0 -14
- package/umd/typings/src/types/PipelineJson/Expectations.d.ts +0 -32
- package/umd/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +0 -70
- package/umd/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +0 -27
- package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +0 -25
- package/umd/typings/src/types/PipelineJson/PersonaJson.d.ts +0 -41
- package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +0 -87
- package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +0 -22
- package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +0 -13
- package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +0 -13
- package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +0 -96
- package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +0 -36
- package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +0 -19
- package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +0 -12
- package/umd/typings/src/types/PipelineString.d.ts +0 -12
- package/umd/typings/src/types/Prompt.d.ts +0 -108
- package/umd/typings/src/types/ScriptLanguage.d.ts +0 -9
- package/umd/typings/src/types/TaskProgress.d.ts +0 -43
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +0 -58
- package/umd/typings/src/types/execution-report/ExecutionReportString.d.ts +0 -16
- package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +0 -25
- package/umd/typings/src/types/execution-report/config.d.ts +0 -8
- package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +0 -7
- package/umd/typings/src/types/execution-report/countWorkingDuration.test.d.ts +0 -1
- package/umd/typings/src/types/execution-report/executionReportJsonToString.d.ts +0 -13
- package/umd/typings/src/types/typeAliasEmoji.d.ts +0 -9
- package/umd/typings/src/types/typeAliases.d.ts +0 -586
- package/umd/typings/src/utils/FromtoItems.d.ts +0 -19
- package/umd/typings/src/utils/arrayableToArray.d.ts +0 -11
- package/umd/typings/src/utils/arrayableToArray.test.d.ts +0 -1
- package/umd/typings/src/utils/currentDate.d.ts +0 -8
- package/umd/typings/src/utils/deepClone.d.ts +0 -10
- package/umd/typings/src/utils/deepFreeze.d.ts +0 -22
- package/umd/typings/src/utils/emojis.d.ts +0 -23
- package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +0 -7
- package/umd/typings/src/utils/expectation-counters/countCharacters.test.d.ts +0 -1
- package/umd/typings/src/utils/expectation-counters/countLines.d.ts +0 -7
- package/umd/typings/src/utils/expectation-counters/countLines.test.d.ts +0 -1
- package/umd/typings/src/utils/expectation-counters/countPages.d.ts +0 -7
- package/umd/typings/src/utils/expectation-counters/countPages.test.d.ts +0 -1
- package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +0 -7
- package/umd/typings/src/utils/expectation-counters/countParagraphs.test.d.ts +0 -1
- package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +0 -13
- package/umd/typings/src/utils/expectation-counters/countSentences.test.d.ts +0 -1
- package/umd/typings/src/utils/expectation-counters/countWords.d.ts +0 -7
- package/umd/typings/src/utils/expectation-counters/countWords.test.d.ts +0 -1
- package/umd/typings/src/utils/expectation-counters/index.d.ts +0 -8
- package/umd/typings/src/utils/extractParameterNames.d.ts +0 -10
- package/umd/typings/src/utils/extractParameterNames.test.d.ts +0 -1
- package/umd/typings/src/utils/formatNumber.d.ts +0 -6
- package/umd/typings/src/utils/formatNumber.test.d.ts +0 -1
- package/umd/typings/src/utils/getCurrentIsoDate.d.ts +0 -7
- package/umd/typings/src/utils/isRunningInWhatever.d.ts +0 -18
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -14
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +0 -38
- package/umd/typings/src/utils/markdown/createMarkdownChart.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +0 -11
- package/umd/typings/src/utils/markdown/createMarkdownTable.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -11
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +0 -34
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +0 -15
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +0 -20
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/flattenMarkdown.d.ts +0 -17
- package/umd/typings/src/utils/markdown/flattenMarkdown.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +0 -34
- package/umd/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/prettifyMarkdown.d.ts +0 -9
- package/umd/typings/src/utils/markdown/prettifyMarkdown.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/removeContentComments.d.ts +0 -10
- package/umd/typings/src/utils/markdown/removeContentComments.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +0 -9
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.test.d.ts +0 -1
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +0 -15
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +0 -12
- package/umd/typings/src/utils/normalization/IKeywords.d.ts +0 -21
- package/umd/typings/src/utils/normalization/capitalize.d.ts +0 -6
- package/umd/typings/src/utils/normalization/capitalize.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/decapitalize.d.ts +0 -6
- package/umd/typings/src/utils/normalization/decapitalize.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/isValidKeyword.d.ts +0 -10
- package/umd/typings/src/utils/normalization/isValidKeyword.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/nameToUriPart.d.ts +0 -9
- package/umd/typings/src/utils/normalization/nameToUriPart.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/nameToUriParts.d.ts +0 -9
- package/umd/typings/src/utils/normalization/nameToUriParts.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +0 -18
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +0 -17
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +0 -26
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +0 -22
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +0 -17
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/normalizeWhitespaces.d.ts +0 -4
- package/umd/typings/src/utils/normalization/normalizeWhitespaces.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/parseKeywords.d.ts +0 -16
- package/umd/typings/src/utils/normalization/parseKeywords.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.d.ts +0 -9
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/removeDiacritics.d.ts +0 -11
- package/umd/typings/src/utils/normalization/removeDiacritics.test.d.ts +0 -1
- package/umd/typings/src/utils/normalization/searchKeywords.d.ts +0 -10
- package/umd/typings/src/utils/normalization/searchKeywords.test.d.ts +0 -1
- package/umd/typings/src/utils/organization/TODO_USE.d.ts +0 -12
- package/umd/typings/src/utils/organization/TODO_any.d.ts +0 -6
- package/umd/typings/src/utils/organization/TODO_object.d.ts +0 -6
- package/umd/typings/src/utils/organization/TODO_unknown.d.ts +0 -6
- package/umd/typings/src/utils/organization/___.d.ts +0 -6
- package/umd/typings/src/utils/organization/just.d.ts +0 -14
- package/umd/typings/src/utils/organization/keepUnused.d.ts +0 -16
- package/umd/typings/src/utils/organization/really_any.d.ts +0 -6
- package/umd/typings/src/utils/organization/really_unknown.d.ts +0 -6
- package/umd/typings/src/utils/parseNumber.d.ts +0 -16
- package/umd/typings/src/utils/parseNumber.test.d.ts +0 -1
- package/umd/typings/src/utils/random/randomSeed.d.ts +0 -8
- package/umd/typings/src/utils/removeEmojis.d.ts +0 -8
- package/umd/typings/src/utils/removeEmojis.test.d.ts +0 -1
- package/umd/typings/src/utils/removeQuotes.d.ts +0 -14
- package/umd/typings/src/utils/removeQuotes.test.d.ts +0 -1
- package/umd/typings/src/utils/replaceParameters.d.ts +0 -12
- package/umd/typings/src/utils/replaceParameters.test.d.ts +0 -1
- package/umd/typings/src/utils/sets/difference.d.ts +0 -10
- package/umd/typings/src/utils/sets/difference.test.d.ts +0 -1
- package/umd/typings/src/utils/sets/intersection.d.ts +0 -7
- package/umd/typings/src/utils/sets/intersection.test.d.ts +0 -1
- package/umd/typings/src/utils/sets/union.d.ts +0 -7
- package/umd/typings/src/utils/sets/union.test.d.ts +0 -1
- package/umd/typings/src/utils/trimCodeBlock.d.ts +0 -9
- package/umd/typings/src/utils/trimCodeBlock.test.d.ts +0 -1
- package/umd/typings/src/utils/trimEndOfCodeBlock.d.ts +0 -9
- package/umd/typings/src/utils/trimEndOfCodeBlock.test.d.ts +0 -1
- package/umd/typings/src/utils/unwrapResult.d.ts +0 -37
- package/umd/typings/src/utils/unwrapResult.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/email/isValidEmail.d.ts +0 -6
- package/umd/typings/src/utils/validators/email/isValidEmail.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +0 -9
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +0 -10
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +0 -15
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +0 -12
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +0 -11
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +0 -13
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -15
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +0 -13
- package/umd/typings/src/utils/validators/url/isValidUrl.test.d.ts +0 -1
- package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +0 -8
- package/umd/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +0 -1
- package/umd/typings/src/version.d.ts +0 -6
- /package/{umd/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts → esm/typings/src/cli/test/ptbk.test.d.ts} +0 -0
- /package/{umd/typings/src/collection/constructors/createCollectionFromJson.test.d.ts → esm/typings/src/utils/files/isDirectoryExisting.test.d.ts} +0 -0
- /package/{umd/typings/src/collection/constructors/createCollectionFromPromise.test.d.ts → esm/typings/src/utils/files/isFileExisting.test.d.ts} +0 -0
- /package/{umd/typings/src/commands/BLOCK/blockCommand.test.d.ts → esm/typings/src/utils/files/listAllFiles.test.d.ts} +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Arrayable } from '../types/Arrayable';
|
|
2
|
-
import type { LlmExecutionTools } from './LlmExecutionTools';
|
|
3
|
-
import type { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
4
|
-
import type { UserInterfaceTools } from './UserInterfaceTools';
|
|
5
|
-
/**
|
|
6
|
-
* All the tools needed to execute pipelines.
|
|
7
|
-
*
|
|
8
|
-
* @see https://github.com/webgptorg/promptbook#execution-tools
|
|
9
|
-
*/
|
|
10
|
-
export type ExecutionTools = {
|
|
11
|
-
/**
|
|
12
|
-
* Tools for executing prompts to large language models like GPT-4
|
|
13
|
-
*
|
|
14
|
-
* Tip: Combine multiple LLM execution tools - use array of LlmExecutionTools instead of single LlmExecutionTools
|
|
15
|
-
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#llm-execution-tools
|
|
16
|
-
*/
|
|
17
|
-
llm?: Arrayable<LlmExecutionTools>;
|
|
18
|
-
/**
|
|
19
|
-
* Tools for executing scripts
|
|
20
|
-
*
|
|
21
|
-
* Note: You can pass multiple ScriptExecutionTools, they will be tried one by one until one of them supports the script
|
|
22
|
-
* If none of them supports the script, an error is thrown
|
|
23
|
-
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#script-execution-tools
|
|
24
|
-
*/
|
|
25
|
-
script?: Arrayable<ScriptExecutionTools>;
|
|
26
|
-
/**
|
|
27
|
-
* Tools for interacting with the user
|
|
28
|
-
*
|
|
29
|
-
* Note: When undefined, the user interface is disabled and promptbook which requires user interaction will fail
|
|
30
|
-
* @see https://github.com/webgptorg/promptbook/?tab=readme-ov-file#user-interface-tools
|
|
31
|
-
*/
|
|
32
|
-
userInterface?: UserInterfaceTools;
|
|
33
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from 'type-fest';
|
|
2
|
-
import type { ModelVariant } from '../types/ModelVariant';
|
|
3
|
-
import type { Prompt } from '../types/Prompt';
|
|
4
|
-
import type { string_markdown } from '../types/typeAliases';
|
|
5
|
-
import type { string_markdown_text } from '../types/typeAliases';
|
|
6
|
-
import type { string_model_name } from '../types/typeAliases';
|
|
7
|
-
import type { string_title } from '../types/typeAliases';
|
|
8
|
-
import type { ChatPromptResult } from './PromptResult';
|
|
9
|
-
import type { CompletionPromptResult } from './PromptResult';
|
|
10
|
-
import type { EmbeddingPromptResult } from './PromptResult';
|
|
11
|
-
/**
|
|
12
|
-
* Container for all the tools needed to execute prompts to large language models like GPT-4
|
|
13
|
-
* On its interface it exposes common methods for prompt execution.
|
|
14
|
-
* Inside (in constructor) it calls OpenAI, Azure, GPU, proxy, cache, logging,...
|
|
15
|
-
*
|
|
16
|
-
* @see https://github.com/webgptorg/promptbook#llm-execution-tools
|
|
17
|
-
*/
|
|
18
|
-
export type LlmExecutionTools = {
|
|
19
|
-
/**
|
|
20
|
-
* Title of the model provider
|
|
21
|
-
*
|
|
22
|
-
* @example "OpenAI"
|
|
23
|
-
*/
|
|
24
|
-
readonly title: string_title & string_markdown_text;
|
|
25
|
-
/**
|
|
26
|
-
* Description of the provider
|
|
27
|
-
*
|
|
28
|
-
* @example "Use all models from OpenAI"
|
|
29
|
-
*/
|
|
30
|
-
readonly description: string_markdown;
|
|
31
|
-
/**
|
|
32
|
-
* Calls a chat model
|
|
33
|
-
*/
|
|
34
|
-
callChatModel?(prompt: Prompt): Promise<ChatPromptResult>;
|
|
35
|
-
/**
|
|
36
|
-
* Calls a completion model
|
|
37
|
-
*/
|
|
38
|
-
callCompletionModel?(prompt: Prompt): Promise<CompletionPromptResult>;
|
|
39
|
-
/**
|
|
40
|
-
* Calls an embedding model
|
|
41
|
-
*/
|
|
42
|
-
callEmbeddingModel?(prompt: Prompt): Promise<EmbeddingPromptResult>;
|
|
43
|
-
/**
|
|
44
|
-
* List all available models that can be used
|
|
45
|
-
*/
|
|
46
|
-
listModels(): Promisable<Array<AvailableModel>>;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Represents a model that can be used for prompt execution
|
|
50
|
-
*/
|
|
51
|
-
export type AvailableModel = {
|
|
52
|
-
/**
|
|
53
|
-
* The model title
|
|
54
|
-
*/
|
|
55
|
-
readonly modelTitle: string_title;
|
|
56
|
-
/**
|
|
57
|
-
* The model name aviailable
|
|
58
|
-
*/
|
|
59
|
-
readonly modelName: string_model_name;
|
|
60
|
-
/**
|
|
61
|
-
* Variant of the model
|
|
62
|
-
*/
|
|
63
|
-
readonly modelVariant: ModelVariant;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* TODO: [🏳] Add `callTranslationModel`
|
|
67
|
-
* TODO: Maybe reorder `listModels` and put it befor `callChatModel`, `callCompletionModel`, `callEmbeddingModel`
|
|
68
|
-
* TODO: [🧠] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
|
|
69
|
-
* TODO: [🍓][♐] Some heuristic to pick the best model in listed models
|
|
70
|
-
* TODO: [🧠] Should or should not there be a word "GPT" in both callCompletionModel and callChatModel
|
|
71
|
-
* TODO: [🧠][🪐] Should be common things like types, utils in folder containing A,B,C,.. or else outside this listing folder?
|
|
72
|
-
*/
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from 'type-fest';
|
|
2
|
-
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
3
|
-
import { PipelineExecutionError } from '../errors/PipelineExecutionError';
|
|
4
|
-
import type { TaskProgress } from '../types/TaskProgress';
|
|
5
|
-
import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
|
|
6
|
-
import type { Parameters } from '../types/typeAliases';
|
|
7
|
-
import type { PromptResultUsage } from './PromptResultUsage';
|
|
8
|
-
/**
|
|
9
|
-
* Executor is a simple async function that takes INPUT PARAMETERs and returns result parameters _(along with all intermediate parameters and INPUT PARAMETERs = it extends input object)_.
|
|
10
|
-
* Executor is made by combining execution tools and pipeline collection.
|
|
11
|
-
*
|
|
12
|
-
* It can be created with `createPipelineExecutor` function.
|
|
13
|
-
*
|
|
14
|
-
* @@@ almost-JSON (what about errors)
|
|
15
|
-
*
|
|
16
|
-
* @see https://github.com/webgptorg/promptbook#executor
|
|
17
|
-
*/
|
|
18
|
-
export type PipelineExecutor = {
|
|
19
|
-
(inputParameters: Parameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* @@@
|
|
23
|
-
*
|
|
24
|
-
* @@@ almost-JSON (what about errors)
|
|
25
|
-
*/
|
|
26
|
-
export type PipelineExecutorResult = {
|
|
27
|
-
/**
|
|
28
|
-
* Result parameters of the execution
|
|
29
|
-
*
|
|
30
|
-
* Note: If the execution was not successful, there are only some of the result parameters
|
|
31
|
-
*/
|
|
32
|
-
readonly outputParameters: Parameters;
|
|
33
|
-
/**
|
|
34
|
-
* Whether the execution was successful, details are aviable in `executionReport`
|
|
35
|
-
*/
|
|
36
|
-
readonly isSuccessful: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Added usage of whole execution, detailed usage is aviable in `executionReport`
|
|
39
|
-
*/
|
|
40
|
-
readonly usage: PromptResultUsage;
|
|
41
|
-
/**
|
|
42
|
-
* Errors that occured during the execution, details are aviable in `executionReport`
|
|
43
|
-
*/
|
|
44
|
-
readonly errors: Array<PipelineExecutionError | Error>;
|
|
45
|
-
/**
|
|
46
|
-
* Warnings that occured during the execution, details are aviable in `executionReport`
|
|
47
|
-
*/
|
|
48
|
-
readonly warnings: Array<PipelineExecutionError | Error>;
|
|
49
|
-
/**
|
|
50
|
-
* The report of the execution with all details
|
|
51
|
-
*/
|
|
52
|
-
readonly executionReport: ExecutionReportJson;
|
|
53
|
-
/**
|
|
54
|
-
* The prepared pipeline that was used for the execution
|
|
55
|
-
*
|
|
56
|
-
* Note: If you called `createPipelineExecutor` with fully prepared pipeline, this is the same object as this pipeline
|
|
57
|
-
* If you passed not fully prepared pipeline, this is same pipeline but fully prepared
|
|
58
|
-
*/
|
|
59
|
-
readonly preparedPipeline: PipelineJson;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* TODO: [🧠] Should this file be in /execution or /types folder?
|
|
63
|
-
* TODO: [💷] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result - BUT maybe NOT?
|
|
64
|
-
*/
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import type { string_date_iso8601 } from '../types/typeAliases';
|
|
2
|
-
import type { string_model_name } from '../types/typeAliases';
|
|
3
|
-
import type { string_prompt } from '../types/typeAliases';
|
|
4
|
-
import type { TODO_object } from '../utils/organization/TODO_object';
|
|
5
|
-
import type { EmbeddingVector } from './EmbeddingVector';
|
|
6
|
-
import type { PromptResultUsage } from './PromptResultUsage';
|
|
7
|
-
/**
|
|
8
|
-
* Prompt result is the simplest concept of execution.
|
|
9
|
-
* It is the result of executing one prompt _(NOT a template)_.
|
|
10
|
-
*
|
|
11
|
-
* @see https://github.com/webgptorg/promptbook#prompt-result
|
|
12
|
-
*/
|
|
13
|
-
export type PromptResult = CompletionPromptResult | ChatPromptResult | EmbeddingPromptResult;
|
|
14
|
-
/**
|
|
15
|
-
* Completion prompt result
|
|
16
|
-
*
|
|
17
|
-
* Note:It contains only the newly generated text NOT the whole completion
|
|
18
|
-
* Note: This is fully serializable as JSON
|
|
19
|
-
*/
|
|
20
|
-
export type CompletionPromptResult = CommonPromptResult;
|
|
21
|
-
/**
|
|
22
|
-
*Chat prompt result
|
|
23
|
-
*
|
|
24
|
-
* Note: This is fully serializable as JSON
|
|
25
|
-
*/
|
|
26
|
-
export type ChatPromptResult = CommonPromptResult & {};
|
|
27
|
-
/**
|
|
28
|
-
* Embedding prompt result
|
|
29
|
-
*
|
|
30
|
-
* Note: This is fully serializable as JSON
|
|
31
|
-
*/
|
|
32
|
-
export type EmbeddingPromptResult = Omit<CommonPromptResult, 'content'> & {
|
|
33
|
-
/**
|
|
34
|
-
* The response from the model
|
|
35
|
-
*/
|
|
36
|
-
content: EmbeddingVector;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Common properties for all prompt results
|
|
40
|
-
*
|
|
41
|
-
* Note: This is fully serializable as JSON
|
|
42
|
-
*/
|
|
43
|
-
export type CommonPromptResult = {
|
|
44
|
-
/**
|
|
45
|
-
* Exact text response from the model
|
|
46
|
-
*/
|
|
47
|
-
readonly content: string;
|
|
48
|
-
/**
|
|
49
|
-
* Name of the model used to generate the response
|
|
50
|
-
*/
|
|
51
|
-
readonly modelName: string_model_name;
|
|
52
|
-
/**
|
|
53
|
-
* Timing
|
|
54
|
-
*/
|
|
55
|
-
readonly timing: {
|
|
56
|
-
/**
|
|
57
|
-
* Start of the execution
|
|
58
|
-
*/
|
|
59
|
-
readonly start: string_date_iso8601;
|
|
60
|
-
/**
|
|
61
|
-
* First token generated
|
|
62
|
-
*/
|
|
63
|
-
readonly firstToken?: string_date_iso8601;
|
|
64
|
-
/**
|
|
65
|
-
* End of the execution
|
|
66
|
-
*/
|
|
67
|
-
readonly complete: string_date_iso8601;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Usage of the prompt execution
|
|
71
|
-
*/
|
|
72
|
-
readonly usage: PromptResultUsage;
|
|
73
|
-
/**
|
|
74
|
-
* Exact text of the prompt (with all replacements)
|
|
75
|
-
*
|
|
76
|
-
* Note: This contains redundant information
|
|
77
|
-
*/
|
|
78
|
-
readonly rawPromptContent: string_prompt;
|
|
79
|
-
/**
|
|
80
|
-
* Raw request to the model
|
|
81
|
-
*
|
|
82
|
-
* Note: This contains redundant information
|
|
83
|
-
*/
|
|
84
|
-
readonly rawRequest: TODO_object | null;
|
|
85
|
-
/**
|
|
86
|
-
* Raw response from the model
|
|
87
|
-
*
|
|
88
|
-
* Note: This contains redundant information
|
|
89
|
-
*/
|
|
90
|
-
readonly rawResponse: TODO_object;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* TODO: [🧠] Maybe timing more accurate then seconds?
|
|
94
|
-
* TODO: [🧠] Should here be link to the prompt?
|
|
95
|
-
* TODO: [🧠] Maybe type `rawResponse` properly - not onject but OpenAI.result.whatever
|
|
96
|
-
* TODO: [🧠] Maybe remove redundant raw.choices.text
|
|
97
|
-
* TODO: Log raw even if prompt failed - log the raw error
|
|
98
|
-
* TODO: [🏳] Add `TranslationPromptResult`
|
|
99
|
-
*/
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { KebabCase } from 'type-fest';
|
|
2
|
-
import type { ExpectationUnit } from '../types/PipelineJson/Expectations';
|
|
3
|
-
import type { UncertainNumber } from './UncertainNumber';
|
|
4
|
-
/**
|
|
5
|
-
* Usage statistics for one or many prompt results
|
|
6
|
-
*/
|
|
7
|
-
export type PromptResultUsage = {
|
|
8
|
-
/**
|
|
9
|
-
* Cost of the execution in USD
|
|
10
|
-
*
|
|
11
|
-
* Note: If the cost is unknown, the value 0 and isUncertain is true
|
|
12
|
-
*/
|
|
13
|
-
readonly price: UncertainNumber;
|
|
14
|
-
/**
|
|
15
|
-
* Number of whatever used in the input aka. `prompt_tokens`
|
|
16
|
-
*/
|
|
17
|
-
readonly input: PromptResultUsageCounts;
|
|
18
|
-
/**
|
|
19
|
-
* Number of tokens used in the output aka. `completion_tokens`
|
|
20
|
-
*/
|
|
21
|
-
readonly output: PromptResultUsageCounts;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Record of all possible measurable units
|
|
25
|
-
*/
|
|
26
|
-
export type PromptResultUsageCounts = Record<`${KebabCase<'TOKENS' | ExpectationUnit>}Count`, UncertainNumber>;
|
|
27
|
-
/**
|
|
28
|
-
* TODO: [🍙] Make some standart order of json properties
|
|
29
|
-
*/
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ScriptLanguage } from '../types/ScriptLanguage';
|
|
2
|
-
import type { Parameters } from '../types/typeAliases';
|
|
3
|
-
import type { string_script } from '../types/typeAliases';
|
|
4
|
-
/**
|
|
5
|
-
* Represents all the tools needed to EXECUTE SCRIPTs
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/webgptorg/promptbook#script-execution-tools
|
|
8
|
-
*/
|
|
9
|
-
export type ScriptExecutionTools = {
|
|
10
|
-
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Input for the script execution
|
|
14
|
-
*/
|
|
15
|
-
export type ScriptExecutionToolsExecuteOptions = {
|
|
16
|
-
/**
|
|
17
|
-
* Language of the script
|
|
18
|
-
*/
|
|
19
|
-
readonly scriptLanguage: ScriptLanguage;
|
|
20
|
-
/**
|
|
21
|
-
* Parameters for the script
|
|
22
|
-
* Theese parameters are passed to the script as variables
|
|
23
|
-
* For example: { "name": "John" } => const name = "John";
|
|
24
|
-
*/
|
|
25
|
-
readonly parameters: Parameters;
|
|
26
|
-
/**
|
|
27
|
-
* The content of the script to execute
|
|
28
|
-
* - It can be a single statement
|
|
29
|
-
* - It can be multiple statements separated by semicolon and return
|
|
30
|
-
* - It can be a function (but you need to call it)
|
|
31
|
-
* - It can be IIFE (immediately invoked function expression)
|
|
32
|
-
* - It can use the parameters as variables and functions from global scope
|
|
33
|
-
*/
|
|
34
|
-
readonly script: string_script;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
38
|
-
* TODO: [🧠][🪐] Should be common things like types, utils in folder containing A,B,C,.. or else outside this listing folder?
|
|
39
|
-
*/
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { number_positive } from '../types/typeAliases';
|
|
2
|
-
import type { number_usd } from '../types/typeAliases';
|
|
3
|
-
/**
|
|
4
|
-
* Number which can be uncertain
|
|
5
|
-
*
|
|
6
|
-
* Note: If the value is completelly unknown, the value 0 and isUncertain is true
|
|
7
|
-
* Note: Not using NaN or null because it looses the value which is better to be uncertain then not to be at all
|
|
8
|
-
*/
|
|
9
|
-
export type UncertainNumber = {
|
|
10
|
-
/**
|
|
11
|
-
* The numeric value
|
|
12
|
-
*/
|
|
13
|
-
readonly value: number_usd & (number_positive | 0);
|
|
14
|
-
/**
|
|
15
|
-
* Is the value uncertain
|
|
16
|
-
*/
|
|
17
|
-
readonly isUncertain?: true;
|
|
18
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { number_integer } from '../types/typeAliases';
|
|
2
|
-
import type { number_positive } from '../types/typeAliases';
|
|
3
|
-
/**
|
|
4
|
-
* Represents all the tools needed to interact with the user.
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/webgptorg/promptbook#user-interface-tools
|
|
7
|
-
*/
|
|
8
|
-
export type UserInterfaceTools = {
|
|
9
|
-
/**
|
|
10
|
-
* Asks the user to answer a free-text (multi-line) question
|
|
11
|
-
*
|
|
12
|
-
* @param options the question to ask
|
|
13
|
-
* @returns the answer from the user
|
|
14
|
-
*/
|
|
15
|
-
promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
|
|
16
|
-
};
|
|
17
|
-
export type UserInterfaceToolsPromptDialogOptions = {
|
|
18
|
-
/**
|
|
19
|
-
* Prompt title
|
|
20
|
-
*
|
|
21
|
-
* Note: This is not a prompt to language model but a prompt to the user
|
|
22
|
-
* @example "Your name"
|
|
23
|
-
*/
|
|
24
|
-
readonly promptTitle: string;
|
|
25
|
-
/**
|
|
26
|
-
* Prompt message
|
|
27
|
-
*
|
|
28
|
-
* Note: This is not a prompt to language model but a prompt to the user
|
|
29
|
-
* @example "Please enter your name, including your last name, title, etc."
|
|
30
|
-
*/
|
|
31
|
-
readonly promptMessage: string;
|
|
32
|
-
/**
|
|
33
|
-
* Default value for the input/textarea
|
|
34
|
-
*/
|
|
35
|
-
readonly defaultValue: string | null;
|
|
36
|
-
/**
|
|
37
|
-
* Placeholder for the input/textarea
|
|
38
|
-
*/
|
|
39
|
-
readonly placeholder?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Priority of the prompt
|
|
42
|
-
*
|
|
43
|
-
* Note: This would be reflected for example into the UI z-index of the prompt modal
|
|
44
|
-
*/
|
|
45
|
-
readonly priority: number_integer & number_positive;
|
|
46
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PipelineExecutor } from './PipelineExecutor';
|
|
2
|
-
/**
|
|
3
|
-
* Asserts that the execution of a promptnook is successful
|
|
4
|
-
*
|
|
5
|
-
* @param executionResult - The partial result of the promptnook execution
|
|
6
|
-
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
7
|
-
* @public exported from `@promptbook/core`
|
|
8
|
-
*/
|
|
9
|
-
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PipelineExecutor>>, 'isSuccessful' | 'errors'>): void;
|
|
10
|
-
/**
|
|
11
|
-
* TODO: [🧠] Can this return type be better typed than void
|
|
12
|
-
*/
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
2
|
-
import type { ExecutionTools } from './ExecutionTools';
|
|
3
|
-
import type { PipelineExecutor } from './PipelineExecutor';
|
|
4
|
-
type CreatePipelineExecutorSettings = {
|
|
5
|
-
/**
|
|
6
|
-
* When executor does not satisfy expectations it will be retried this amount of times
|
|
7
|
-
*
|
|
8
|
-
* @default MAX_EXECUTION_ATTEMPTS
|
|
9
|
-
*/
|
|
10
|
-
readonly maxExecutionAttempts?: number;
|
|
11
|
-
/**
|
|
12
|
-
* Maximum number of tasks running in parallel
|
|
13
|
-
*
|
|
14
|
-
* @default MAX_PARALLEL_COUNT
|
|
15
|
-
*/
|
|
16
|
-
readonly maxParallelCount?: number;
|
|
17
|
-
/**
|
|
18
|
-
* If true, the preparation logs additional information
|
|
19
|
-
*
|
|
20
|
-
* @default false
|
|
21
|
-
*/
|
|
22
|
-
readonly isVerbose?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* If you pass fully prepared pipeline, this does not matter
|
|
25
|
-
*
|
|
26
|
-
* Otherwise:
|
|
27
|
-
* If false or not set, warning is shown when pipeline is not prepared
|
|
28
|
-
* If true, warning is suppressed
|
|
29
|
-
*
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
readonly isNotPreparedWarningSupressed?: boolean;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Options for `createPipelineExecutor`
|
|
36
|
-
*/
|
|
37
|
-
interface CreatePipelineExecutorOptions {
|
|
38
|
-
/**
|
|
39
|
-
* The pipeline to be executed
|
|
40
|
-
*/
|
|
41
|
-
readonly pipeline: PipelineJson;
|
|
42
|
-
/**
|
|
43
|
-
* The execution tools to be used during the execution of the pipeline
|
|
44
|
-
*/
|
|
45
|
-
readonly tools: ExecutionTools;
|
|
46
|
-
/**
|
|
47
|
-
* Optional settings for the pipeline executor
|
|
48
|
-
*/
|
|
49
|
-
readonly settings?: Partial<CreatePipelineExecutorSettings>;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Creates executor function from pipeline and execution tools.
|
|
53
|
-
*
|
|
54
|
-
* @returns The executor function
|
|
55
|
-
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
56
|
-
* @public exported from `@promptbook/core`
|
|
57
|
-
*/
|
|
58
|
-
export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
|
|
59
|
-
export {};
|
|
60
|
-
/**
|
|
61
|
-
* TODO: Use isVerbose here (not only pass to `preparePipeline`)
|
|
62
|
-
* TODO: [🧠][🌳] Use here `countTotalUsage` and put preparation and prepared pipiline to report
|
|
63
|
-
* TODO: [🪂] Use maxParallelCount here (not only pass to `preparePipeline`)
|
|
64
|
-
* TODO: [♈] Probbably move expectations from templates to parameters
|
|
65
|
-
* TODO: [🧠] When not meet expectations in PROMPT_DIALOG, make some way to tell the user
|
|
66
|
-
* TODO: [👧] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
|
|
67
|
-
* Note: CreatePipelineExecutorOptions are just connected to PipelineExecutor so do not extract to types folder
|
|
68
|
-
* TODO: [🧠][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
|
|
69
|
-
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
70
|
-
* TODO: [🧠][💷] `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result BUT maybe NOT to preserve pure JSON object
|
|
71
|
-
*/
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AutomaticTranslator } from './AutomaticTranslator';
|
|
2
|
-
/**
|
|
3
|
-
* This will wrap an automatic translator and log each translation into the console
|
|
4
|
-
*/
|
|
5
|
-
export declare class DebugAutomaticTranslator implements AutomaticTranslator {
|
|
6
|
-
private readonly automaticTranslator;
|
|
7
|
-
constructor(automaticTranslator: AutomaticTranslator);
|
|
8
|
-
translate(message: string): Promise<string>;
|
|
9
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AutomaticTranslator } from './AutomaticTranslator';
|
|
2
|
-
import type { TranslatorOptions } from './TranslatorOptions';
|
|
3
|
-
interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
|
|
4
|
-
apiUrl?: URL;
|
|
5
|
-
}
|
|
6
|
-
export declare class LindatAutomaticTranslator implements AutomaticTranslator {
|
|
7
|
-
private readonly options;
|
|
8
|
-
constructor(options: LindatAutomaticTranslatorOptions);
|
|
9
|
-
translate(message: string): Promise<string>;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AutomaticTranslator } from './automatic-translators/AutomaticTranslator';
|
|
2
|
-
import type { TranslatorOptions } from './automatic-translators/TranslatorOptions';
|
|
3
|
-
export declare function translateMessages({ automaticTranslator, from, to, }: {
|
|
4
|
-
automaticTranslator: AutomaticTranslator;
|
|
5
|
-
} & TranslatorOptions): Promise<void>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { PromptResultUsage } from '../PromptResultUsage';
|
|
2
|
-
/**
|
|
3
|
-
* @@@
|
|
4
|
-
*
|
|
5
|
-
* @public exported from `@promptbook/core`
|
|
6
|
-
*/
|
|
7
|
-
export declare const ZERO_USAGE: import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
|
|
8
|
-
readonly price: {
|
|
9
|
-
readonly value: 0;
|
|
10
|
-
};
|
|
11
|
-
readonly input: {
|
|
12
|
-
readonly tokensCount: {
|
|
13
|
-
readonly value: 0;
|
|
14
|
-
};
|
|
15
|
-
readonly charactersCount: {
|
|
16
|
-
readonly value: 0;
|
|
17
|
-
};
|
|
18
|
-
readonly wordsCount: {
|
|
19
|
-
readonly value: 0;
|
|
20
|
-
};
|
|
21
|
-
readonly sentencesCount: {
|
|
22
|
-
readonly value: 0;
|
|
23
|
-
};
|
|
24
|
-
readonly linesCount: {
|
|
25
|
-
readonly value: 0;
|
|
26
|
-
};
|
|
27
|
-
readonly paragraphsCount: {
|
|
28
|
-
readonly value: 0;
|
|
29
|
-
};
|
|
30
|
-
readonly pagesCount: {
|
|
31
|
-
readonly value: 0;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
readonly output: {
|
|
35
|
-
readonly tokensCount: {
|
|
36
|
-
readonly value: 0;
|
|
37
|
-
};
|
|
38
|
-
readonly charactersCount: {
|
|
39
|
-
readonly value: 0;
|
|
40
|
-
};
|
|
41
|
-
readonly wordsCount: {
|
|
42
|
-
readonly value: 0;
|
|
43
|
-
};
|
|
44
|
-
readonly sentencesCount: {
|
|
45
|
-
readonly value: 0;
|
|
46
|
-
};
|
|
47
|
-
readonly linesCount: {
|
|
48
|
-
readonly value: 0;
|
|
49
|
-
};
|
|
50
|
-
readonly paragraphsCount: {
|
|
51
|
-
readonly value: 0;
|
|
52
|
-
};
|
|
53
|
-
readonly pagesCount: {
|
|
54
|
-
readonly value: 0;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
}>;
|
|
58
|
-
/**
|
|
59
|
-
* Function `addUsage` will add multiple usages into one
|
|
60
|
-
*
|
|
61
|
-
* Note: If you provide 0 values, it returns ZERO_USAGE
|
|
62
|
-
*
|
|
63
|
-
* @public exported from `@promptbook/core`
|
|
64
|
-
*/
|
|
65
|
-
export declare function addUsage(...usageItems: Array<PromptResultUsage>): PromptResultUsage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Expectations } from '../../types/PipelineJson/Expectations';
|
|
2
|
-
/**
|
|
3
|
-
* Function checkExpectations will check if the expectations on given value are met
|
|
4
|
-
*
|
|
5
|
-
* Note: There are two simmilar functions:
|
|
6
|
-
* - `checkExpectations` which throws an error if the expectations are not met
|
|
7
|
-
* - `isPassingExpectations` which returns a boolean
|
|
8
|
-
*
|
|
9
|
-
* @throws {ExpectError} if the expectations are not met
|
|
10
|
-
* @returns {void} Nothing
|
|
11
|
-
* @public exported from `@promptbook/core`
|
|
12
|
-
*/
|
|
13
|
-
export declare function checkExpectations(expectations: Expectations, value: string): void;
|
|
14
|
-
/**
|
|
15
|
-
* Function checkExpectations will check if the expectations on given value are met
|
|
16
|
-
*
|
|
17
|
-
* Note: There are two simmilar functions:
|
|
18
|
-
* - `checkExpectations` which throws an error if the expectations are not met
|
|
19
|
-
* - `isPassingExpectations` which returns a boolean
|
|
20
|
-
*
|
|
21
|
-
* @returns {boolean} True if the expectations are met
|
|
22
|
-
* @public exported from `@promptbook/core`
|
|
23
|
-
*/
|
|
24
|
-
export declare function isPassingExpectations(expectations: Expectations, value: string): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* TODO: [💝] Unite object for expecting amount and format
|
|
27
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|