@promptbook/browser 0.63.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 +702 -0
- package/esm/index.es.js +220 -0
- package/esm/index.es.js.map +1 -0
- package/esm/typings/promptbook-collection/index.d.ts +252 -0
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +6 -0
- package/esm/typings/src/_packages/azure-openai.index.d.ts +6 -0
- package/esm/typings/src/_packages/browser.index.d.ts +6 -0
- package/esm/typings/src/_packages/cli.index.d.ts +4 -0
- package/esm/typings/src/_packages/core.index.d.ts +124 -0
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +8 -0
- package/esm/typings/src/_packages/fake-llm.index.d.ts +6 -0
- package/esm/typings/src/_packages/langtail.index.d.ts +6 -0
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +36 -0
- package/esm/typings/src/_packages/node.index.d.ts +8 -0
- package/esm/typings/src/_packages/openai.index.d.ts +8 -0
- package/esm/typings/src/_packages/remote-client.index.d.ts +8 -0
- package/esm/typings/src/_packages/remote-server.index.d.ts +6 -0
- package/esm/typings/src/_packages/types.index.d.ts +462 -0
- package/esm/typings/src/_packages/utils.index.d.ts +130 -0
- package/esm/typings/src/cli/cli-commands/hello.d.ts +10 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +10 -0
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +10 -0
- package/esm/typings/src/cli/main.d.ts +12 -0
- package/esm/typings/src/cli/promptbookCli.d.ts +10 -0
- package/esm/typings/src/collection/PipelineCollection.d.ts +25 -0
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +38 -0
- package/esm/typings/src/collection/collectionToJson.d.ts +13 -0
- package/esm/typings/src/collection/collectionToJson.test.d.ts +7 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +48 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +13 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +23 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +29 -0
- package/esm/typings/src/collection/constructors/createSubcollection.d.ts +13 -0
- package/esm/typings/src/commands/BLOCK/BlockCommand.d.ts +11 -0
- package/esm/typings/src/commands/BLOCK/BlockTypes.d.ts +15 -0
- package/esm/typings/src/commands/BLOCK/blockCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/BLOCK/blockCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/EXPECT/ExpectAmountCommand.d.ts +14 -0
- package/esm/typings/src/commands/EXPECT/ExpectCommand.d.ts +9 -0
- package/esm/typings/src/commands/EXPECT/ExpectFormatCommand.d.ts +7 -0
- package/esm/typings/src/commands/EXPECT/expectCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/JOKER/JokerCommand.d.ts +11 -0
- package/esm/typings/src/commands/JOKER/jokerCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +11 -0
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +13 -0
- package/esm/typings/src/commands/MODEL/modelCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/MODEL/modelCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PARAMETER/ParameterCommand.d.ts +15 -0
- package/esm/typings/src/commands/PARAMETER/parameterCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +13 -0
- package/esm/typings/src/commands/PERSONA/personaCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PERSONA/personaCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/POSTPROCESS/PostprocessCommand.d.ts +11 -0
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +11 -0
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/URL/UrlCommand.d.ts +10 -0
- package/esm/typings/src/commands/URL/urlCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/URL/urlCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/X_ACTION/ActionCommand.d.ts +9 -0
- package/esm/typings/src/commands/X_ACTION/actionCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +9 -0
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +10 -0
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +13 -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 +64 -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 +87 -0
- package/esm/typings/src/config.test.d.ts +4 -0
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +16 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +38 -0
- package/esm/typings/src/conversion/pipelineStringToJson.test.d.ts +1 -0
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +29 -0
- package/esm/typings/src/conversion/pipelineStringToJsonSync.test.d.ts +1 -0
- package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +13 -0
- package/esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts +12 -0
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +27 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.d.ts +14 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/extractVariables.d.ts +14 -0
- package/esm/typings/src/conversion/utils/extractVariables.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +26 -0
- package/esm/typings/src/conversion/utils/renameParameter.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +16 -0
- package/esm/typings/src/conversion/utils/stringifyPipelineJson.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/titleToName.d.ts +9 -0
- package/esm/typings/src/conversion/utils/titleToName.test.d.ts +1 -0
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +22 -0
- package/esm/typings/src/conversion/validation/pipelineStringToJson-syntaxErrors.test.d.ts +1 -0
- package/esm/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +4 -0
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +37 -0
- package/esm/typings/src/conversion/validation/validatePipeline.test.d.ts +1 -0
- package/esm/typings/src/errors/CollectionError.d.ts +9 -0
- package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +9 -0
- package/esm/typings/src/errors/LimitReachedError.d.ts +9 -0
- package/esm/typings/src/errors/NotFoundError.d.ts +9 -0
- package/esm/typings/src/errors/NotYetImplementedError.d.ts +9 -0
- package/esm/typings/src/errors/ParsingError.d.ts +9 -0
- package/esm/typings/src/errors/PipelineExecutionError.d.ts +9 -0
- package/esm/typings/src/errors/PipelineLogicError.d.ts +9 -0
- package/esm/typings/src/errors/ReferenceError.d.ts +9 -0
- package/esm/typings/src/errors/UnexpectedError.d.ts +9 -0
- package/esm/typings/src/errors/VersionMismatchError.d.ts +10 -0
- package/esm/typings/src/errors/_ExpectError.d.ts +10 -0
- package/esm/typings/src/execution/CommonExecutionToolsOptions.d.ts +10 -0
- package/esm/typings/src/execution/EmbeddingVector.d.ts +8 -0
- package/esm/typings/src/execution/ExecutionTools.d.ts +33 -0
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +72 -0
- package/esm/typings/src/execution/PipelineExecutor.d.ts +64 -0
- package/esm/typings/src/execution/PromptResult.d.ts +99 -0
- package/esm/typings/src/execution/PromptResultUsage.d.ts +29 -0
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +39 -0
- package/esm/typings/src/execution/UncertainNumber.d.ts +18 -0
- package/esm/typings/src/execution/UserInterfaceTools.d.ts +46 -0
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +12 -0
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +71 -0
- package/esm/typings/src/execution/embeddingVectorToString.d.ts +7 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
- package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
- package/esm/typings/src/execution/utils/addUsage.d.ts +65 -0
- package/esm/typings/src/execution/utils/addUsage.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +27 -0
- package/esm/typings/src/execution/utils/checkExpectations.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/computeUsageCounts.d.ts +10 -0
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +19 -0
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +9 -0
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +17 -0
- package/esm/typings/src/execution/utils/usageToHuman.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +12 -0
- package/esm/typings/src/execution/utils/usageToWorktime.test.d.ts +1 -0
- package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +6 -0
- package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +6 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +70 -0
- package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +12 -0
- package/esm/typings/src/formats/index.d.ts +4 -0
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +16 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +6 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.test.d.ts +1 -0
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +14 -0
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +16 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +17 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +14 -0
- package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +22 -0
- package/esm/typings/src/knowledge/dialogs/user-interface-execution-tools.test.d.ts +1 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +37 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +2 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +14 -0
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +4 -0
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +13 -0
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +37 -0
- package/esm/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +20 -0
- package/esm/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +21 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +16 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +19 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +15 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +17 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +36 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +52 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +12 -0
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +22 -0
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +6 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +50 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +36 -0
- package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +5 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +17 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +13 -0
- package/esm/typings/src/llm-providers/langtail/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +36 -0
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +40 -0
- package/esm/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +14 -0
- package/esm/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/test/joker.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
- package/esm/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +54 -0
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +21 -0
- package/esm/typings/src/llm-providers/multiple/playground/playground.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +68 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +20 -0
- package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +14 -0
- package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +16 -0
- package/esm/typings/src/llm-providers/openai/computeUsage.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +29 -0
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +5 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +56 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +26 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
- package/esm/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +37 -0
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +21 -0
- package/esm/typings/src/personas/preparePersona.d.ts +15 -0
- package/esm/typings/src/personas/preparePersona.test.d.ts +1 -0
- package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +17 -0
- package/esm/typings/src/prepare/PrepareOptions.d.ts +22 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +15 -0
- package/esm/typings/src/prepare/isPipelinePrepared.test.d.ts +1 -0
- package/esm/typings/src/prepare/preparePipeline.d.ts +16 -0
- package/esm/typings/src/prepare/prepareTemplates.d.ts +32 -0
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +12 -0
- package/esm/typings/src/scripting/_test/custom-function-async.test.ts.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function-missing.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function-with-dependencies.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/postprocessing.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/script-execution-errors.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/script-execution-tools.test.d.ts +1 -0
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +22 -0
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +8 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +51 -0
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +12 -0
- package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +8 -0
- package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +16 -0
- package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +16 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +24 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
- package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +31 -0
- package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +10 -0
- package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
- package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +10 -0
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +10 -0
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +33 -0
- package/esm/typings/src/storage/utils/PrefixStorage.d.ts +25 -0
- package/esm/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
- package/esm/typings/src/types/Arrayable.d.ts +10 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +102 -0
- package/esm/typings/src/types/ModelVariant.d.ts +14 -0
- package/esm/typings/src/types/PipelineJson/Expectations.d.ts +32 -0
- package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +70 -0
- package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +27 -0
- package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +25 -0
- package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +41 -0
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +87 -0
- package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +22 -0
- package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +13 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +13 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +96 -0
- package/esm/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +36 -0
- package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +19 -0
- package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +12 -0
- package/esm/typings/src/types/PipelineString.d.ts +12 -0
- package/esm/typings/src/types/Prompt.d.ts +108 -0
- package/esm/typings/src/types/ScriptLanguage.d.ts +9 -0
- package/esm/typings/src/types/TaskProgress.d.ts +43 -0
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +58 -0
- package/esm/typings/src/types/execution-report/ExecutionReportString.d.ts +16 -0
- package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +25 -0
- package/esm/typings/src/types/execution-report/config.d.ts +8 -0
- package/esm/typings/src/types/execution-report/countWorkingDuration.d.ts +7 -0
- package/esm/typings/src/types/execution-report/countWorkingDuration.test.d.ts +1 -0
- package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +13 -0
- package/esm/typings/src/types/typeAliasEmoji.d.ts +9 -0
- package/esm/typings/src/types/typeAliases.d.ts +586 -0
- package/esm/typings/src/utils/FromtoItems.d.ts +19 -0
- package/esm/typings/src/utils/arrayableToArray.d.ts +11 -0
- package/esm/typings/src/utils/arrayableToArray.test.d.ts +1 -0
- package/esm/typings/src/utils/currentDate.d.ts +8 -0
- package/esm/typings/src/utils/deepClone.d.ts +10 -0
- package/esm/typings/src/utils/deepFreeze.d.ts +22 -0
- package/esm/typings/src/utils/emojis.d.ts +23 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countLines.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countPages.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +13 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countWords.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +8 -0
- package/esm/typings/src/utils/extractParameterNames.d.ts +10 -0
- package/esm/typings/src/utils/extractParameterNames.test.d.ts +1 -0
- package/esm/typings/src/utils/formatNumber.d.ts +6 -0
- package/esm/typings/src/utils/formatNumber.test.d.ts +1 -0
- package/esm/typings/src/utils/getCurrentIsoDate.d.ts +7 -0
- package/esm/typings/src/utils/isRunningInWhatever.d.ts +18 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +14 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +38 -0
- package/esm/typings/src/utils/markdown/createMarkdownChart.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +11 -0
- package/esm/typings/src/utils/markdown/createMarkdownTable.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +11 -0
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +34 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +15 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +20 -0
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +17 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +34 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/prettifyMarkdown.d.ts +9 -0
- package/esm/typings/src/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeContentComments.d.ts +10 -0
- package/esm/typings/src/utils/markdown/removeContentComments.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +9 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +15 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +12 -0
- package/esm/typings/src/utils/normalization/IKeywords.d.ts +21 -0
- package/esm/typings/src/utils/normalization/capitalize.d.ts +6 -0
- package/esm/typings/src/utils/normalization/capitalize.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/decapitalize.d.ts +6 -0
- package/esm/typings/src/utils/normalization/decapitalize.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.d.ts +10 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +9 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +9 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +18 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +17 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +26 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +22 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +17 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +16 -0
- package/esm/typings/src/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +9 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +11 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +10 -0
- package/esm/typings/src/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +12 -0
- package/esm/typings/src/utils/organization/TODO_any.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_object.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_unknown.d.ts +6 -0
- package/esm/typings/src/utils/organization/___.d.ts +6 -0
- package/esm/typings/src/utils/organization/just.d.ts +14 -0
- package/esm/typings/src/utils/organization/keepUnused.d.ts +16 -0
- package/esm/typings/src/utils/organization/really_any.d.ts +6 -0
- package/esm/typings/src/utils/organization/really_unknown.d.ts +6 -0
- package/esm/typings/src/utils/parseNumber.d.ts +16 -0
- package/esm/typings/src/utils/parseNumber.test.d.ts +1 -0
- package/esm/typings/src/utils/random/randomSeed.d.ts +8 -0
- package/esm/typings/src/utils/removeEmojis.d.ts +8 -0
- package/esm/typings/src/utils/removeEmojis.test.d.ts +1 -0
- package/esm/typings/src/utils/removeQuotes.d.ts +14 -0
- package/esm/typings/src/utils/removeQuotes.test.d.ts +1 -0
- package/esm/typings/src/utils/replaceParameters.d.ts +12 -0
- package/esm/typings/src/utils/replaceParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/difference.d.ts +10 -0
- package/esm/typings/src/utils/sets/difference.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/intersection.d.ts +7 -0
- package/esm/typings/src/utils/sets/intersection.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/union.d.ts +7 -0
- package/esm/typings/src/utils/sets/union.test.d.ts +1 -0
- package/esm/typings/src/utils/trimCodeBlock.d.ts +9 -0
- package/esm/typings/src/utils/trimCodeBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +9 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/unwrapResult.d.ts +37 -0
- package/esm/typings/src/utils/unwrapResult.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/email/isValidEmail.d.ts +6 -0
- package/esm/typings/src/utils/validators/email/isValidEmail.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +9 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +10 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +15 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +12 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +11 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +13 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +15 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +13 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +8 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +1 -0
- package/esm/typings/src/version.d.ts +8 -0
- package/package.json +53 -0
- package/umd/index.umd.js +230 -0
- package/umd/index.umd.js.map +1 -0
- package/umd/typings/promptbook-collection/index.d.ts +252 -0
- package/umd/typings/src/_packages/anthropic-claude.index.d.ts +6 -0
- package/umd/typings/src/_packages/azure-openai.index.d.ts +6 -0
- package/umd/typings/src/_packages/browser.index.d.ts +6 -0
- package/umd/typings/src/_packages/cli.index.d.ts +4 -0
- package/umd/typings/src/_packages/core.index.d.ts +124 -0
- package/umd/typings/src/_packages/execute-javascript.index.d.ts +8 -0
- package/umd/typings/src/_packages/fake-llm.index.d.ts +6 -0
- package/umd/typings/src/_packages/langtail.index.d.ts +6 -0
- package/umd/typings/src/_packages/markdown-utils.index.d.ts +36 -0
- package/umd/typings/src/_packages/node.index.d.ts +8 -0
- package/umd/typings/src/_packages/openai.index.d.ts +8 -0
- package/umd/typings/src/_packages/remote-client.index.d.ts +8 -0
- package/umd/typings/src/_packages/remote-server.index.d.ts +6 -0
- package/umd/typings/src/_packages/types.index.d.ts +462 -0
- package/umd/typings/src/_packages/utils.index.d.ts +130 -0
- package/umd/typings/src/cli/cli-commands/hello.d.ts +10 -0
- package/umd/typings/src/cli/cli-commands/make.d.ts +10 -0
- package/umd/typings/src/cli/cli-commands/prettify.d.ts +10 -0
- package/umd/typings/src/cli/main.d.ts +12 -0
- package/umd/typings/src/cli/promptbookCli.d.ts +10 -0
- package/umd/typings/src/collection/PipelineCollection.d.ts +25 -0
- package/umd/typings/src/collection/SimplePipelineCollection.d.ts +38 -0
- package/umd/typings/src/collection/collectionToJson.d.ts +13 -0
- package/umd/typings/src/collection/collectionToJson.test.d.ts +7 -0
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +48 -0
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromJson.d.ts +13 -0
- package/umd/typings/src/collection/constructors/createCollectionFromJson.test.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromPromise.d.ts +23 -0
- package/umd/typings/src/collection/constructors/createCollectionFromPromise.test.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +29 -0
- package/umd/typings/src/collection/constructors/createSubcollection.d.ts +13 -0
- package/umd/typings/src/commands/BLOCK/BlockCommand.d.ts +11 -0
- package/umd/typings/src/commands/BLOCK/BlockTypes.d.ts +15 -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 +11 -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 +13 -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 +13 -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 +64 -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 +87 -0
- package/umd/typings/src/config.test.d.ts +4 -0
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +16 -0
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +38 -0
- package/umd/typings/src/conversion/pipelineStringToJson.test.d.ts +1 -0
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +29 -0
- package/umd/typings/src/conversion/pipelineStringToJsonSync.test.d.ts +1 -0
- package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +13 -0
- package/umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts +12 -0
- package/umd/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +27 -0
- package/umd/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.d.ts +14 -0
- package/umd/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.test.d.ts +1 -0
- package/umd/typings/src/conversion/utils/extractVariables.d.ts +14 -0
- package/umd/typings/src/conversion/utils/extractVariables.test.d.ts +1 -0
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +26 -0
- package/umd/typings/src/conversion/utils/renameParameter.test.d.ts +1 -0
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.d.ts +16 -0
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.test.d.ts +1 -0
- package/umd/typings/src/conversion/utils/titleToName.d.ts +9 -0
- package/umd/typings/src/conversion/utils/titleToName.test.d.ts +1 -0
- package/umd/typings/src/conversion/validation/_importPipeline.d.ts +22 -0
- package/umd/typings/src/conversion/validation/pipelineStringToJson-syntaxErrors.test.d.ts +1 -0
- package/umd/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +4 -0
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +37 -0
- package/umd/typings/src/conversion/validation/validatePipeline.test.d.ts +1 -0
- package/umd/typings/src/errors/CollectionError.d.ts +9 -0
- package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +9 -0
- package/umd/typings/src/errors/LimitReachedError.d.ts +9 -0
- package/umd/typings/src/errors/NotFoundError.d.ts +9 -0
- package/umd/typings/src/errors/NotYetImplementedError.d.ts +9 -0
- package/umd/typings/src/errors/ParsingError.d.ts +9 -0
- package/umd/typings/src/errors/PipelineExecutionError.d.ts +9 -0
- package/umd/typings/src/errors/PipelineLogicError.d.ts +9 -0
- package/umd/typings/src/errors/ReferenceError.d.ts +9 -0
- package/umd/typings/src/errors/UnexpectedError.d.ts +9 -0
- package/umd/typings/src/errors/VersionMismatchError.d.ts +10 -0
- package/umd/typings/src/errors/_ExpectError.d.ts +10 -0
- package/umd/typings/src/execution/CommonExecutionToolsOptions.d.ts +10 -0
- package/umd/typings/src/execution/EmbeddingVector.d.ts +8 -0
- package/umd/typings/src/execution/ExecutionTools.d.ts +33 -0
- package/umd/typings/src/execution/LlmExecutionTools.d.ts +72 -0
- package/umd/typings/src/execution/PipelineExecutor.d.ts +64 -0
- package/umd/typings/src/execution/PromptResult.d.ts +99 -0
- package/umd/typings/src/execution/PromptResultUsage.d.ts +29 -0
- package/umd/typings/src/execution/ScriptExecutionTools.d.ts +39 -0
- package/umd/typings/src/execution/UncertainNumber.d.ts +18 -0
- package/umd/typings/src/execution/UserInterfaceTools.d.ts +46 -0
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +12 -0
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +71 -0
- package/umd/typings/src/execution/embeddingVectorToString.d.ts +7 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
- package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
- package/umd/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
- package/umd/typings/src/execution/utils/addUsage.d.ts +65 -0
- package/umd/typings/src/execution/utils/addUsage.test.d.ts +1 -0
- package/umd/typings/src/execution/utils/checkExpectations.d.ts +27 -0
- package/umd/typings/src/execution/utils/checkExpectations.test.d.ts +1 -0
- package/umd/typings/src/execution/utils/computeUsageCounts.d.ts +10 -0
- package/umd/typings/src/execution/utils/forEachAsync.d.ts +19 -0
- package/umd/typings/src/execution/utils/uncertainNumber.d.ts +9 -0
- package/umd/typings/src/execution/utils/usageToHuman.d.ts +17 -0
- package/umd/typings/src/execution/utils/usageToHuman.test.d.ts +1 -0
- package/umd/typings/src/execution/utils/usageToWorktime.d.ts +12 -0
- package/umd/typings/src/execution/utils/usageToWorktime.test.d.ts +1 -0
- package/umd/typings/src/expectations/drafts/isDomainNameFree.d.ts +6 -0
- package/umd/typings/src/expectations/drafts/isGithubNameFree.d.ts +6 -0
- package/umd/typings/src/formats/_common/FormatDefinition.d.ts +70 -0
- package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +12 -0
- package/umd/typings/src/formats/index.d.ts +4 -0
- package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +16 -0
- package/umd/typings/src/formats/json/utils/isValidJsonString.d.ts +6 -0
- package/umd/typings/src/formats/json/utils/isValidJsonString.test.d.ts +1 -0
- package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +14 -0
- package/umd/typings/src/formats/xml/XmlFormatDefinition.d.ts +16 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +17 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +14 -0
- package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +22 -0
- package/umd/typings/src/knowledge/dialogs/user-interface-execution-tools.test.d.ts +1 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +37 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +2 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +14 -0
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +4 -0
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +13 -0
- package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +37 -0
- package/umd/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +20 -0
- package/umd/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +21 -0
- package/umd/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
- package/umd/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +16 -0
- package/umd/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +19 -0
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +15 -0
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +17 -0
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +36 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +52 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +12 -0
- package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +22 -0
- package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +6 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +50 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +36 -0
- package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +5 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +17 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +13 -0
- package/umd/typings/src/llm-providers/langtail/playground/playground.d.ts +2 -0
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +36 -0
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +40 -0
- package/umd/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +14 -0
- package/umd/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/mocked/test/joker.test.d.ts +4 -0
- package/umd/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
- package/umd/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +4 -0
- package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +54 -0
- package/umd/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +21 -0
- package/umd/typings/src/llm-providers/multiple/playground/playground.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +68 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +20 -0
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +14 -0
- package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +16 -0
- package/umd/typings/src/llm-providers/openai/computeUsage.test.d.ts +1 -0
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +29 -0
- package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +5 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +56 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +26 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
- package/umd/typings/src/llm-providers/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
- package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +37 -0
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +21 -0
- package/umd/typings/src/personas/preparePersona.d.ts +15 -0
- package/umd/typings/src/personas/preparePersona.test.d.ts +1 -0
- package/umd/typings/src/postprocessing/utils/extractBlock.d.ts +17 -0
- package/umd/typings/src/prepare/PrepareOptions.d.ts +22 -0
- package/umd/typings/src/prepare/isPipelinePrepared.d.ts +15 -0
- package/umd/typings/src/prepare/isPipelinePrepared.test.d.ts +1 -0
- package/umd/typings/src/prepare/preparePipeline.d.ts +16 -0
- package/umd/typings/src/prepare/prepareTemplates.d.ts +32 -0
- package/umd/typings/src/prepare/unpreparePipeline.d.ts +12 -0
- package/umd/typings/src/scripting/_test/custom-function-async.test.ts.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/custom-function-missing.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/custom-function-with-dependencies.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/custom-function.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/postprocessing.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/script-execution-errors.test.d.ts +1 -0
- package/umd/typings/src/scripting/_test/script-execution-tools.test.d.ts +1 -0
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +22 -0
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +8 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
- package/umd/typings/src/scripting/javascript/postprocessing-functions.d.ts +51 -0
- package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +12 -0
- package/umd/typings/src/scripting/javascript/utils/unknownToString.d.ts +8 -0
- package/umd/typings/src/scripting/python/PythonExecutionTools.d.ts +16 -0
- package/umd/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +16 -0
- package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +24 -0
- package/umd/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
- package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +31 -0
- package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +10 -0
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
- package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
- package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +10 -0
- package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +10 -0
- package/umd/typings/src/storage/memory/MemoryStorage.d.ts +33 -0
- package/umd/typings/src/storage/utils/PrefixStorage.d.ts +25 -0
- package/umd/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
- package/umd/typings/src/types/Arrayable.d.ts +10 -0
- package/umd/typings/src/types/ModelRequirements.d.ts +102 -0
- package/umd/typings/src/types/ModelVariant.d.ts +14 -0
- package/umd/typings/src/types/PipelineJson/Expectations.d.ts +32 -0
- package/umd/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +70 -0
- package/umd/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +27 -0
- package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +25 -0
- package/umd/typings/src/types/PipelineJson/PersonaJson.d.ts +41 -0
- package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +87 -0
- package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +22 -0
- package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +13 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +13 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +96 -0
- package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +36 -0
- package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +19 -0
- package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +12 -0
- package/umd/typings/src/types/PipelineString.d.ts +12 -0
- package/umd/typings/src/types/Prompt.d.ts +108 -0
- package/umd/typings/src/types/ScriptLanguage.d.ts +9 -0
- package/umd/typings/src/types/TaskProgress.d.ts +43 -0
- package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +58 -0
- package/umd/typings/src/types/execution-report/ExecutionReportString.d.ts +16 -0
- package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +25 -0
- package/umd/typings/src/types/execution-report/config.d.ts +8 -0
- package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +7 -0
- package/umd/typings/src/types/execution-report/countWorkingDuration.test.d.ts +1 -0
- package/umd/typings/src/types/execution-report/executionReportJsonToString.d.ts +13 -0
- package/umd/typings/src/types/typeAliasEmoji.d.ts +9 -0
- package/umd/typings/src/types/typeAliases.d.ts +586 -0
- package/umd/typings/src/utils/FromtoItems.d.ts +19 -0
- package/umd/typings/src/utils/arrayableToArray.d.ts +11 -0
- package/umd/typings/src/utils/arrayableToArray.test.d.ts +1 -0
- package/umd/typings/src/utils/currentDate.d.ts +8 -0
- package/umd/typings/src/utils/deepClone.d.ts +10 -0
- package/umd/typings/src/utils/deepFreeze.d.ts +22 -0
- package/umd/typings/src/utils/emojis.d.ts +23 -0
- package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +7 -0
- package/umd/typings/src/utils/expectation-counters/countCharacters.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countLines.d.ts +7 -0
- package/umd/typings/src/utils/expectation-counters/countLines.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countPages.d.ts +7 -0
- package/umd/typings/src/utils/expectation-counters/countPages.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +7 -0
- package/umd/typings/src/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +13 -0
- package/umd/typings/src/utils/expectation-counters/countSentences.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/countWords.d.ts +7 -0
- package/umd/typings/src/utils/expectation-counters/countWords.test.d.ts +1 -0
- package/umd/typings/src/utils/expectation-counters/index.d.ts +8 -0
- package/umd/typings/src/utils/extractParameterNames.d.ts +10 -0
- package/umd/typings/src/utils/extractParameterNames.test.d.ts +1 -0
- package/umd/typings/src/utils/formatNumber.d.ts +6 -0
- package/umd/typings/src/utils/formatNumber.test.d.ts +1 -0
- package/umd/typings/src/utils/getCurrentIsoDate.d.ts +7 -0
- package/umd/typings/src/utils/isRunningInWhatever.d.ts +18 -0
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +14 -0
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +38 -0
- package/umd/typings/src/utils/markdown/createMarkdownChart.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +11 -0
- package/umd/typings/src/utils/markdown/createMarkdownTable.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +11 -0
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +34 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +15 -0
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +20 -0
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/flattenMarkdown.d.ts +17 -0
- package/umd/typings/src/utils/markdown/flattenMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +34 -0
- package/umd/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/prettifyMarkdown.d.ts +9 -0
- package/umd/typings/src/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/removeContentComments.d.ts +10 -0
- package/umd/typings/src/utils/markdown/removeContentComments.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +9 -0
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +15 -0
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +12 -0
- package/umd/typings/src/utils/normalization/IKeywords.d.ts +21 -0
- package/umd/typings/src/utils/normalization/capitalize.d.ts +6 -0
- package/umd/typings/src/utils/normalization/capitalize.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/decapitalize.d.ts +6 -0
- package/umd/typings/src/utils/normalization/decapitalize.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/isValidKeyword.d.ts +10 -0
- package/umd/typings/src/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/nameToUriPart.d.ts +9 -0
- package/umd/typings/src/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/nameToUriParts.d.ts +9 -0
- package/umd/typings/src/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +18 -0
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +17 -0
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +26 -0
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +22 -0
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +17 -0
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/umd/typings/src/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/parseKeywords.d.ts +16 -0
- package/umd/typings/src/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.d.ts +9 -0
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/removeDiacritics.d.ts +11 -0
- package/umd/typings/src/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/umd/typings/src/utils/normalization/searchKeywords.d.ts +10 -0
- package/umd/typings/src/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/umd/typings/src/utils/organization/TODO_USE.d.ts +12 -0
- package/umd/typings/src/utils/organization/TODO_any.d.ts +6 -0
- package/umd/typings/src/utils/organization/TODO_object.d.ts +6 -0
- package/umd/typings/src/utils/organization/TODO_unknown.d.ts +6 -0
- package/umd/typings/src/utils/organization/___.d.ts +6 -0
- package/umd/typings/src/utils/organization/just.d.ts +14 -0
- package/umd/typings/src/utils/organization/keepUnused.d.ts +16 -0
- package/umd/typings/src/utils/organization/really_any.d.ts +6 -0
- package/umd/typings/src/utils/organization/really_unknown.d.ts +6 -0
- package/umd/typings/src/utils/parseNumber.d.ts +16 -0
- package/umd/typings/src/utils/parseNumber.test.d.ts +1 -0
- package/umd/typings/src/utils/random/randomSeed.d.ts +8 -0
- package/umd/typings/src/utils/removeEmojis.d.ts +8 -0
- package/umd/typings/src/utils/removeEmojis.test.d.ts +1 -0
- package/umd/typings/src/utils/removeQuotes.d.ts +14 -0
- package/umd/typings/src/utils/removeQuotes.test.d.ts +1 -0
- package/umd/typings/src/utils/replaceParameters.d.ts +12 -0
- package/umd/typings/src/utils/replaceParameters.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/difference.d.ts +10 -0
- package/umd/typings/src/utils/sets/difference.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/intersection.d.ts +7 -0
- package/umd/typings/src/utils/sets/intersection.test.d.ts +1 -0
- package/umd/typings/src/utils/sets/union.d.ts +7 -0
- package/umd/typings/src/utils/sets/union.test.d.ts +1 -0
- package/umd/typings/src/utils/trimCodeBlock.d.ts +9 -0
- package/umd/typings/src/utils/trimCodeBlock.test.d.ts +1 -0
- package/umd/typings/src/utils/trimEndOfCodeBlock.d.ts +9 -0
- package/umd/typings/src/utils/trimEndOfCodeBlock.test.d.ts +1 -0
- package/umd/typings/src/utils/unwrapResult.d.ts +37 -0
- package/umd/typings/src/utils/unwrapResult.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/email/isValidEmail.d.ts +6 -0
- package/umd/typings/src/utils/validators/email/isValidEmail.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +9 -0
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +10 -0
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +15 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +12 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +11 -0
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +13 -0
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +15 -0
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +13 -0
- package/umd/typings/src/utils/validators/url/isValidUrl.test.d.ts +1 -0
- package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +8 -0
- package/umd/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +1 -0
- package/umd/typings/src/version.d.ts +8 -0
package/README.md
ADDED
|
@@ -0,0 +1,702 @@
|
|
|
1
|
+
#  Promptbook
|
|
2
|
+
|
|
3
|
+
Supercharge your use of large language models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
[ Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
|
|
9
|
+
[ Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
|
|
10
|
+
[](https://snyk.io/test/github/webgptorg/promptbook)
|
|
11
|
+
[](https://github.com/webgptorg/promptbook/issues)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 📦 Package `@promptbook/browser`
|
|
18
|
+
|
|
19
|
+
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
20
|
+
- This package `@promptbook/browser` is one part of the promptbook ecosystem.
|
|
21
|
+
|
|
22
|
+
To install this package, run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Install entire promptbook ecosystem
|
|
26
|
+
npm i ptbk
|
|
27
|
+
|
|
28
|
+
# Install just this package to save space
|
|
29
|
+
npm i @promptbook/browser
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Core of the library for Browser runtime, it contains the main logic for promptbooks which uses browser-specific things like `localStorage`.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
> 💡 This package does not make sense on its own, look at [all promptbook packages](#-packages) or just install all by `npm i ptbk`
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
42
|
+
|
|
43
|
+
## 🤍 The Promptbook Whitepaper
|
|
44
|
+
|
|
45
|
+
When you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, or whatever, it doesn't matter how it is integrated. Whether it's the direct calling of a REST API, using the SDK, hardcoding the prompt in the source code, or importing a text file, the process remains the same.
|
|
46
|
+
|
|
47
|
+
If you need something more advanced or want to extend the capabilities of LLMs, you generally have three ways to proceed:
|
|
48
|
+
|
|
49
|
+
1. **Fine-tune** the model to your specifications or even train your own.
|
|
50
|
+
2. **Prompt-engineer** the prompt to the best shape you can achieve.
|
|
51
|
+
3. Use **multiple prompts** in a pipeline to get the best result.
|
|
52
|
+
|
|
53
|
+
In any of these situations, but especially in (3), the Promptbook library can make your life easier and make **orchestraror for your prompts**.
|
|
54
|
+
|
|
55
|
+
- **Separation of concerns** between prompt engineer and programmer; between code files and prompt files; and between prompts and their execution logic.
|
|
56
|
+
- Set up a **common format** for prompts that is interchangeable between projects and language/technology stacks.
|
|
57
|
+
- **Preprocessing** and cleaning the input data from the user.
|
|
58
|
+
- Use default values - **Jokers** to bypass some parts of the pipeline.
|
|
59
|
+
- **Expect** some specific output from the model.
|
|
60
|
+
- **Retry** mismatched outputs.
|
|
61
|
+
- **Combine** multiple models together.
|
|
62
|
+
- Interactive **User interaction** with the model and the user.
|
|
63
|
+
- Leverage **external** sources (like ChatGPT plugins or OpenAI's GPTs).
|
|
64
|
+
- Simplify your code to be **DRY** and not repeat all the boilerplate code for each prompt.
|
|
65
|
+
- **Versioning** of promptbooks
|
|
66
|
+
- **Reuse** parts of promptbooks in/between projects.
|
|
67
|
+
- Run the LLM **optimally** in parallel, with the best _cost/quality_ ratio or _speed/quality_ ratio.
|
|
68
|
+
- **Execution report** to see what happened during the execution.
|
|
69
|
+
- **Logging** the results of the promptbooks.
|
|
70
|
+
- _(Not ready yet)_ **Caching** calls to LLMs to save money and time.
|
|
71
|
+
- _(Not ready yet)_ Extend one prompt book from another one.
|
|
72
|
+
- _(Not ready yet)_ Leverage the **streaming** to make super cool UI/UX.
|
|
73
|
+
- _(Not ready yet)_ **A/B testing** to determine which prompt works best for the job.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Sample:
|
|
78
|
+
|
|
79
|
+
File `write-website-content.ptbk.md`:
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
> # 🌍 Create website content
|
|
84
|
+
>
|
|
85
|
+
> Instructions for creating web page content.
|
|
86
|
+
>
|
|
87
|
+
> - PIPELINE URL https://promptbook.studio/webgpt/write-website-content.ptbk.md
|
|
88
|
+
> - PROMPTBOOK VERSION 0.0.1
|
|
89
|
+
> - INPUT PARAM `{rawTitle}` Automatically suggested a site name or empty text
|
|
90
|
+
> - INPUT PARAM `{rawAssigment}` Automatically generated site entry from image recognition
|
|
91
|
+
> - OUTPUT PARAM `{websiteContent}` Web content
|
|
92
|
+
> - OUTPUT PARAM `{keywords}` Keywords
|
|
93
|
+
>
|
|
94
|
+
> ## 👤 Specifying the assigment
|
|
95
|
+
>
|
|
96
|
+
> What is your web about?
|
|
97
|
+
>
|
|
98
|
+
> - PROMPT DIALOG
|
|
99
|
+
>
|
|
100
|
+
> ```
|
|
101
|
+
> {rawAssigment}
|
|
102
|
+
> ```
|
|
103
|
+
>
|
|
104
|
+
> `-> {assigment}` Website assignment and specification
|
|
105
|
+
>
|
|
106
|
+
> ## ✨ Improving the title
|
|
107
|
+
>
|
|
108
|
+
> - MODEL VARIANT Chat
|
|
109
|
+
> - MODEL NAME `gpt-4`
|
|
110
|
+
> - POSTPROCESSING `unwrapResult`
|
|
111
|
+
>
|
|
112
|
+
> ```
|
|
113
|
+
> As an experienced marketing specialist, you have been entrusted with improving the name of your client's business.
|
|
114
|
+
>
|
|
115
|
+
> A suggested name from a client:
|
|
116
|
+
> "{rawTitle}"
|
|
117
|
+
>
|
|
118
|
+
> Assignment from customer:
|
|
119
|
+
>
|
|
120
|
+
> > {assigment}
|
|
121
|
+
>
|
|
122
|
+
> ## Instructions:
|
|
123
|
+
>
|
|
124
|
+
> - Write only one name suggestion
|
|
125
|
+
> - The name will be used on the website, business cards, visuals, etc.
|
|
126
|
+
> ```
|
|
127
|
+
>
|
|
128
|
+
> `-> {enhancedTitle}` Enhanced title
|
|
129
|
+
>
|
|
130
|
+
> ## 👤 Website title approval
|
|
131
|
+
>
|
|
132
|
+
> Is the title for your website okay?
|
|
133
|
+
>
|
|
134
|
+
> - PROMPT DIALOG
|
|
135
|
+
>
|
|
136
|
+
> ```
|
|
137
|
+
> {enhancedTitle}
|
|
138
|
+
> ```
|
|
139
|
+
>
|
|
140
|
+
> `-> {title}` Title for the website
|
|
141
|
+
>
|
|
142
|
+
> ## 🐰 Cunning subtitle
|
|
143
|
+
>
|
|
144
|
+
> - MODEL VARIANT Chat
|
|
145
|
+
> - MODEL NAME `gpt-4`
|
|
146
|
+
> - POSTPROCESSING `unwrapResult`
|
|
147
|
+
>
|
|
148
|
+
> ```
|
|
149
|
+
> As an experienced copywriter, you have been entrusted with creating a claim for the "{title}" web page.
|
|
150
|
+
>
|
|
151
|
+
> A website assignment from a customer:
|
|
152
|
+
>
|
|
153
|
+
> > {assigment}
|
|
154
|
+
>
|
|
155
|
+
> ## Instructions:
|
|
156
|
+
>
|
|
157
|
+
> - Write only one name suggestion
|
|
158
|
+
> - Claim will be used on website, business cards, visuals, etc.
|
|
159
|
+
> - Claim should be punchy, funny, original
|
|
160
|
+
> ```
|
|
161
|
+
>
|
|
162
|
+
> `-> {claim}` Claim for the web
|
|
163
|
+
>
|
|
164
|
+
> ## 🚦 Keyword analysis
|
|
165
|
+
>
|
|
166
|
+
> - MODEL VARIANT Chat
|
|
167
|
+
> - MODEL NAME `gpt-4`
|
|
168
|
+
>
|
|
169
|
+
> ```
|
|
170
|
+
> As an experienced SEO specialist, you have been entrusted with creating keywords for the website "{title}".
|
|
171
|
+
>
|
|
172
|
+
> Website assignment from the customer:
|
|
173
|
+
>
|
|
174
|
+
> > {assigment}
|
|
175
|
+
>
|
|
176
|
+
> ## Instructions:
|
|
177
|
+
>
|
|
178
|
+
> - Write a list of keywords
|
|
179
|
+
> - Keywords are in basic form
|
|
180
|
+
>
|
|
181
|
+
> ## Example:
|
|
182
|
+
>
|
|
183
|
+
> - Ice cream
|
|
184
|
+
> - Olomouc
|
|
185
|
+
> - Quality
|
|
186
|
+
> - Family
|
|
187
|
+
> - Tradition
|
|
188
|
+
> - Italy
|
|
189
|
+
> - Craft
|
|
190
|
+
>
|
|
191
|
+
> ```
|
|
192
|
+
>
|
|
193
|
+
> `-> {keywords}` Keywords
|
|
194
|
+
>
|
|
195
|
+
> ## 🔗 Combine the beginning
|
|
196
|
+
>
|
|
197
|
+
> - SIMPLE TEMPLATE
|
|
198
|
+
>
|
|
199
|
+
> ```
|
|
200
|
+
>
|
|
201
|
+
> # {title}
|
|
202
|
+
>
|
|
203
|
+
> > {claim}
|
|
204
|
+
>
|
|
205
|
+
> ```
|
|
206
|
+
>
|
|
207
|
+
> `-> {contentBeginning}` Beginning of web content
|
|
208
|
+
>
|
|
209
|
+
> ## 🖋 Write the content
|
|
210
|
+
>
|
|
211
|
+
> - MODEL VARIANT Completion
|
|
212
|
+
> - MODEL NAME `gpt-3.5-turbo-instruct`
|
|
213
|
+
>
|
|
214
|
+
> ```
|
|
215
|
+
> As an experienced copywriter and web designer, you have been entrusted with creating text for a new website {title}.
|
|
216
|
+
>
|
|
217
|
+
> A website assignment from a customer:
|
|
218
|
+
>
|
|
219
|
+
> > {assigment}
|
|
220
|
+
>
|
|
221
|
+
> ## Instructions:
|
|
222
|
+
>
|
|
223
|
+
> - Text formatting is in Markdown
|
|
224
|
+
> - Be concise and to the point
|
|
225
|
+
> - Use keywords, but they should be naturally in the text
|
|
226
|
+
> - This is the complete content of the page, so don't forget all the important information and elements the page should contain
|
|
227
|
+
> - Use headings, bullets, text formatting
|
|
228
|
+
>
|
|
229
|
+
> ## Keywords:
|
|
230
|
+
>
|
|
231
|
+
> {keywords}
|
|
232
|
+
>
|
|
233
|
+
> ## Web Content:
|
|
234
|
+
>
|
|
235
|
+
> {contentBeginning}
|
|
236
|
+
> ```
|
|
237
|
+
>
|
|
238
|
+
> `-> {contentBody}` Middle of the web content
|
|
239
|
+
>
|
|
240
|
+
> ## 🔗 Combine the content
|
|
241
|
+
>
|
|
242
|
+
> - SIMPLE TEMPLATE
|
|
243
|
+
>
|
|
244
|
+
> ```markdown
|
|
245
|
+
> {contentBeginning}
|
|
246
|
+
>
|
|
247
|
+
> {contentBody}
|
|
248
|
+
> ```
|
|
249
|
+
>
|
|
250
|
+
> `-> {websiteContent}`
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
Following is the scheme how the promptbook above is executed:
|
|
255
|
+
|
|
256
|
+
```mermaid
|
|
257
|
+
%% 🔮 Tip: Open this on GitHub or in the VSCode website to see the Mermaid graph visually
|
|
258
|
+
|
|
259
|
+
flowchart LR
|
|
260
|
+
subgraph "🌍 Create website content"
|
|
261
|
+
|
|
262
|
+
direction TB
|
|
263
|
+
|
|
264
|
+
input((Input)):::input
|
|
265
|
+
templateSpecifyingTheAssigment(👤 Specifying the assigment)
|
|
266
|
+
input--"{rawAssigment}"-->templateSpecifyingTheAssigment
|
|
267
|
+
templateImprovingTheTitle(✨ Improving the title)
|
|
268
|
+
input--"{rawTitle}"-->templateImprovingTheTitle
|
|
269
|
+
templateSpecifyingTheAssigment--"{assigment}"-->templateImprovingTheTitle
|
|
270
|
+
templateWebsiteTitleApproval(👤 Website title approval)
|
|
271
|
+
templateImprovingTheTitle--"{enhancedTitle}"-->templateWebsiteTitleApproval
|
|
272
|
+
templateCunningSubtitle(🐰 Cunning subtitle)
|
|
273
|
+
templateWebsiteTitleApproval--"{title}"-->templateCunningSubtitle
|
|
274
|
+
templateSpecifyingTheAssigment--"{assigment}"-->templateCunningSubtitle
|
|
275
|
+
templateKeywordAnalysis(🚦 Keyword analysis)
|
|
276
|
+
templateWebsiteTitleApproval--"{title}"-->templateKeywordAnalysis
|
|
277
|
+
templateSpecifyingTheAssigment--"{assigment}"-->templateKeywordAnalysis
|
|
278
|
+
templateCombineTheBeginning(🔗 Combine the beginning)
|
|
279
|
+
templateWebsiteTitleApproval--"{title}"-->templateCombineTheBeginning
|
|
280
|
+
templateCunningSubtitle--"{claim}"-->templateCombineTheBeginning
|
|
281
|
+
templateWriteTheContent(🖋 Write the content)
|
|
282
|
+
templateWebsiteTitleApproval--"{title}"-->templateWriteTheContent
|
|
283
|
+
templateSpecifyingTheAssigment--"{assigment}"-->templateWriteTheContent
|
|
284
|
+
templateKeywordAnalysis--"{keywords}"-->templateWriteTheContent
|
|
285
|
+
templateCombineTheBeginning--"{contentBeginning}"-->templateWriteTheContent
|
|
286
|
+
templateCombineTheContent(🔗 Combine the content)
|
|
287
|
+
templateCombineTheBeginning--"{contentBeginning}"-->templateCombineTheContent
|
|
288
|
+
templateWriteTheContent--"{contentBody}"-->templateCombineTheContent
|
|
289
|
+
|
|
290
|
+
templateCombineTheContent--"{websiteContent}"-->output
|
|
291
|
+
output((Output)):::output
|
|
292
|
+
|
|
293
|
+
classDef input color: grey;
|
|
294
|
+
classDef output color: grey;
|
|
295
|
+
|
|
296
|
+
end;
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
[More template samples](./samples/templates/)
|
|
300
|
+
|
|
301
|
+
_Note: We are using [postprocessing functions](#postprocessing-functions) like `unwrapResult` that can be used to postprocess the result._
|
|
302
|
+
|
|
303
|
+
## 📦 Packages
|
|
304
|
+
|
|
305
|
+
This library is divided into several packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
306
|
+
You can install all of them at once:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
npm i ptbk
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Or you can install them separately:
|
|
313
|
+
|
|
314
|
+
> ⭐ Marked packages are worth to try first
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
- ⭐ **[ptbk](https://www.npmjs.com/package/ptbk)** - Bundle of all packages, when you want to install everything and you don't care about the size
|
|
319
|
+
- **[promptbook](https://www.npmjs.com/package/promptbook)** - Same as `ptbk`
|
|
320
|
+
- **[@promptbook/core](https://www.npmjs.com/package/@promptbook/core)** - Core of the library, it contains the main logic for promptbooks
|
|
321
|
+
- **[@promptbook/node](https://www.npmjs.com/package/@promptbook/node)** - Core of the library for Node.js
|
|
322
|
+
- ⭐ **[@promptbook/utils](https://www.npmjs.com/package/@promptbook/utils)** - Utility functions used in the library but also useful for individual use in preprocessing and postprocessing LLM inputs and outputs
|
|
323
|
+
- **[@promptbook/markdown-utils](https://www.npmjs.com/package/@promptbook/markdown-utils)** - Utility functions used for processing markdown
|
|
324
|
+
- _(Not finished)_ **[@promptbook/wizzard](https://www.npmjs.com/package/@promptbook/wizzard)** - Wizard for creating+running promptbooks in single line
|
|
325
|
+
- **[@promptbook/execute-javascript](https://www.npmjs.com/package/@promptbook/execute-javascript)** - Execution tools for javascript inside promptbooks
|
|
326
|
+
- **[@promptbook/openai](https://www.npmjs.com/package/@promptbook/openai)** - Execution tools for OpenAI API, wrapper around OpenAI SDK
|
|
327
|
+
- **[@promptbook/anthropic-claude](https://www.npmjs.com/package/@promptbook/anthropic-claude)** - Execution tools for Anthropic Claude API, wrapper around Anthropic Claude SDK
|
|
328
|
+
- **[@promptbook/azure-openai](https://www.npmjs.com/package/@promptbook/azure-openai)** - Execution tools for Azure OpenAI API
|
|
329
|
+
- **[@promptbook/langtail](https://www.npmjs.com/package/@promptbook/langtail)** - Execution tools for Langtail API, wrapper around Langtail SDK
|
|
330
|
+
- **[@promptbook/fake-llm](https://www.npmjs.com/package/@promptbook/fake-llm)** - Mocked execution tools for testing the library and saving the tokens
|
|
331
|
+
- **[@promptbook/remote-client](https://www.npmjs.com/package/@promptbook/remote-client)** - Remote client for remote execution of promptbooks
|
|
332
|
+
- **[@promptbook/remote-server](https://www.npmjs.com/package/@promptbook/remote-server)** - Remote server for remote execution of promptbooks
|
|
333
|
+
- **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
|
|
334
|
+
- **[@promptbook/cli](https://www.npmjs.com/package/@promptbook/cli)** - Command line interface utilities for promptbooks
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
## 📚 Dictionary
|
|
339
|
+
|
|
340
|
+
The following glossary is used to clarify certain basic concepts:
|
|
341
|
+
|
|
342
|
+
### Prompt
|
|
343
|
+
|
|
344
|
+
Prompt in a text along with model requirements, but without any execution or templating logic.
|
|
345
|
+
|
|
346
|
+
For example:
|
|
347
|
+
|
|
348
|
+
```json
|
|
349
|
+
{
|
|
350
|
+
"request": "Which sound does a cat make?",
|
|
351
|
+
"modelRequirements": {
|
|
352
|
+
"variant": "CHAT"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
```json
|
|
358
|
+
{
|
|
359
|
+
"request": "I am a cat.\nI like to eat fish.\nI like to sleep.\nI like to play with a ball.\nI l",
|
|
360
|
+
"modelRequirements": {
|
|
361
|
+
"variant": "COMPLETION"
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Prompt Template
|
|
367
|
+
|
|
368
|
+
Similar concept to Prompt, but with templating logic.
|
|
369
|
+
|
|
370
|
+
For example:
|
|
371
|
+
|
|
372
|
+
```json
|
|
373
|
+
{
|
|
374
|
+
"request": "Which sound does a {animalName} make?",
|
|
375
|
+
"modelRequirements": {
|
|
376
|
+
"variant": "CHAT"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Model Requirements
|
|
382
|
+
|
|
383
|
+
Abstract way to specify the LLM.
|
|
384
|
+
It does not specify the LLM with concrete version itself, only the requirements for the LLM.
|
|
385
|
+
_NOT chatgpt-3.5-turbo BUT CHAT variant of GPT-3.5._
|
|
386
|
+
|
|
387
|
+
For example:
|
|
388
|
+
|
|
389
|
+
```json
|
|
390
|
+
{
|
|
391
|
+
"variant": "CHAT",
|
|
392
|
+
"version": "GPT-3.5",
|
|
393
|
+
"temperature": 0.7
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Block type
|
|
398
|
+
|
|
399
|
+
Each block of promptbook can have a different execution type.
|
|
400
|
+
It is specified in list of requirements for the block.
|
|
401
|
+
By default, it is `Prompt template`
|
|
402
|
+
|
|
403
|
+
- _(default)_ `Prompt template` The block is a prompt template and is executed by LLM (OpenAI, Azure,...)
|
|
404
|
+
- `SIMPLE TEMPLATE` The block is a simple text template which is just filled with parameters
|
|
405
|
+
- `Script` The block is a script that is executed by some script runtime, the runtime is determined by block type, currently only `javascript` is supported but we plan to add `python` and `typescript` in the future.
|
|
406
|
+
- `PROMPT DIALOG` Ask user for input
|
|
407
|
+
|
|
408
|
+
### Parameters
|
|
409
|
+
|
|
410
|
+
Parameters that are placed in the prompt template and replaced to create the prompt.
|
|
411
|
+
It is a simple key-value object.
|
|
412
|
+
|
|
413
|
+
```json
|
|
414
|
+
{
|
|
415
|
+
"animalName": "cat",
|
|
416
|
+
"animalSound": "Meow!"
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
There are three types of template parameters, depending on how they are used in the promptbook:
|
|
421
|
+
|
|
422
|
+
- **INPUT PARAMETER**s are required to execute the promptbook.
|
|
423
|
+
- **Intermediate parameters** are used internally in the promptbook.
|
|
424
|
+
- **OUTPUT PARAMETER**s are explicitelly marked and they are returned as the result of the promptbook execution.
|
|
425
|
+
|
|
426
|
+
_Note: Parameter can be both intermedite and output at the same time._
|
|
427
|
+
|
|
428
|
+
### Promptbook
|
|
429
|
+
|
|
430
|
+
Promptbook is **core concept of this library**.
|
|
431
|
+
It represents a series of prompt templates chained together to form a **pipeline** / one big prompt template with input and result parameters.
|
|
432
|
+
|
|
433
|
+
Internally it can have multiple formats:
|
|
434
|
+
|
|
435
|
+
- **.ptbk.md file** in custom markdown format described above
|
|
436
|
+
- _(concept)_ **.ptbk** format, custom fileextension based on markdown
|
|
437
|
+
- _(internal)_ **JSON** format, parsed from the .ptbk.md file
|
|
438
|
+
|
|
439
|
+
### Promptbook **Library**
|
|
440
|
+
|
|
441
|
+
Library of all promptbooks used in your application.
|
|
442
|
+
Each promptbook is a separate `.ptbk.md` file with unique `PIPELINE URL`. Theese urls are used to reference promptbooks in other promptbooks or in the application code.
|
|
443
|
+
|
|
444
|
+
### Prompt Result
|
|
445
|
+
|
|
446
|
+
Prompt result is the simplest concept of execution.
|
|
447
|
+
It is the result of executing one prompt _(NOT a template)_.
|
|
448
|
+
|
|
449
|
+
For example:
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{
|
|
453
|
+
"response": "Meow!",
|
|
454
|
+
"model": "chatgpt-3.5-turbo"
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Execution Tools
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
`ExecutionTools` is an interface which contains all the tools needed to execute prompts.
|
|
463
|
+
It contais 3 subtools:
|
|
464
|
+
|
|
465
|
+
- `LlmExecutionTools`
|
|
466
|
+
- `ScriptExecutionTools`
|
|
467
|
+
- `UserInterfaceTools`
|
|
468
|
+
|
|
469
|
+
Which are described below:
|
|
470
|
+
|
|
471
|
+
#### LLM Execution Tools
|
|
472
|
+
|
|
473
|
+
`LlmExecutionTools` is a container for all the tools needed to execute prompts to large language models like GPT-4.
|
|
474
|
+
On its interface it exposes common methods for prompt execution.
|
|
475
|
+
Internally it calls OpenAI, Azure, GPU, proxy, cache, logging,...
|
|
476
|
+
|
|
477
|
+
`LlmExecutionTools` an abstract interface that is implemented by concrete execution tools:
|
|
478
|
+
|
|
479
|
+
- `OpenAiExecutionTools`
|
|
480
|
+
- `AnthropicClaudeExecutionTools`
|
|
481
|
+
- `AzureOpenAiExecutionTools`
|
|
482
|
+
- `LangtailExecutionTools`
|
|
483
|
+
- _(Not implemented yet)_ `BardExecutionTools`
|
|
484
|
+
- _(Not implemented yet)_ `LamaExecutionTools`
|
|
485
|
+
- _(Not implemented yet)_ `GpuExecutionTools`
|
|
486
|
+
- Special case are `RemoteLlmExecutionTools` that connect to a remote server and run one of the above execution tools on that server.
|
|
487
|
+
- Another special case is `MockedEchoLlmExecutionTools` that is used for testing and mocking.
|
|
488
|
+
- The another special case is `LogLlmExecutionToolsWrapper` that is technically also an execution tools but it is more proxy wrapper around other execution tools that logs all calls to execution tools.
|
|
489
|
+
|
|
490
|
+
#### Script Execution Tools
|
|
491
|
+
|
|
492
|
+
`ScriptExecutionTools` is an abstract container that represents all the tools needed to EXECUTE SCRIPTs. It is implemented by concrete execution tools:
|
|
493
|
+
|
|
494
|
+
- `JavascriptExecutionTools` is a wrapper around `vm2` module that executes javascript code in a sandbox.
|
|
495
|
+
- `JavascriptEvalExecutionTools` is wrapper around `eval` function that executes javascript. It is used for testing and mocking **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
|
|
496
|
+
- _(Not implemented yet)_ `TypescriptExecutionTools` executes typescript code in a sandbox.
|
|
497
|
+
- _(Not implemented yet)_ `PythonExecutionTools` executes python code in a sandbox.
|
|
498
|
+
|
|
499
|
+
There are [postprocessing functions](#postprocessing-functions) that can be used to postprocess the result.
|
|
500
|
+
|
|
501
|
+
#### User Interface Tools
|
|
502
|
+
|
|
503
|
+
`UserInterfaceTools` is an abstract container that represents all the tools needed to interact with the user. It is implemented by concrete execution tools:
|
|
504
|
+
|
|
505
|
+
- _(Not implemented yet)_ `ConsoleInterfaceTools` is a wrapper around `readline` module that interacts with the user via console.
|
|
506
|
+
- `SimplePromptInterfaceTools` is a wrapper around `window.prompt` synchronous function that interacts with the user via browser prompt. It is used for testing and mocking **NOT intended to use in the production** due to its synchronous nature.
|
|
507
|
+
- `CallbackInterfaceTools` delagates the user interaction to a async callback function. You need to provide your own implementation of this callback function and its bind to UI.
|
|
508
|
+
|
|
509
|
+
### Executor
|
|
510
|
+
|
|
511
|
+
Executor is a simple async function that takes **input parameters** and returns **output parameters**.
|
|
512
|
+
It is constructed by combining execution tools and promptbook to execute together.
|
|
513
|
+
|
|
514
|
+
### 🃏 Jokers (conditions)
|
|
515
|
+
|
|
516
|
+
Joker is a previously defined parameter that is used to bypass some parts of the pipeline.
|
|
517
|
+
If the joker is present in the template, it is checked to see if it meets the requirements (without postprocessing), and if so, it is used instead of executing that prompt template. There can be multiple wildcards in a prompt template, if so they are checked in order and the first one that meets the requirements is used.
|
|
518
|
+
|
|
519
|
+
If none of the jokers meet the requirements, the prompt template is executed as usual.
|
|
520
|
+
|
|
521
|
+
This can be useful, for example, if you want to use some predefined data, or if you want to use some data from the user, but you are not sure if it is suitable form.
|
|
522
|
+
|
|
523
|
+
When using wildcards, you must have at least one minimum expectation. If you do not have a minimum expectation, the joker will always fulfil the expectation because it has none, so it makes no logical sense.
|
|
524
|
+
|
|
525
|
+
Look at [jokers.ptbk.md](samples/templates/41-jokers.ptbk.md) sample.
|
|
526
|
+
|
|
527
|
+
### Postprocessing functions
|
|
528
|
+
|
|
529
|
+
You can define postprocessing functions when creating `JavascriptEvalExecutionTools`:
|
|
530
|
+
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
Additionally there are some usefull string-manipulation build-in functions, which are [listed here](src/scripting/javascript/JavascriptEvalExecutionTools.ts).
|
|
536
|
+
|
|
537
|
+
### Expectations
|
|
538
|
+
|
|
539
|
+
`Expect` command describes the desired output of the prompt template (after post-processing)
|
|
540
|
+
It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs,...
|
|
541
|
+
|
|
542
|
+
_Note: LLMs work with tokens, not characters, but in Promptbooks we want to use some human-recognisable and cross-model interoperable units._
|
|
543
|
+
|
|
544
|
+
```markdown
|
|
545
|
+
# ✨ Sample: Expectations
|
|
546
|
+
|
|
547
|
+
- INPUT PARAMETER {yourName} Name of the hero
|
|
548
|
+
|
|
549
|
+
## 💬 Question
|
|
550
|
+
|
|
551
|
+
- EXPECT MAX 30 CHARACTERS
|
|
552
|
+
- EXPECT MIN 2 CHARACTERS
|
|
553
|
+
- EXPECT MAX 3 WORDS
|
|
554
|
+
- EXPECT EXACTLY 1 SENTENCE
|
|
555
|
+
- EXPECT EXACTLY 1 LINE
|
|
556
|
+
|
|
557
|
+
...
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
There are two types of expectations which are not strictly symmetrical:
|
|
561
|
+
|
|
562
|
+
#### Minimal expectations
|
|
563
|
+
|
|
564
|
+
- `EXPECT MIN 0 ...` is not valid minimal expectation. It makes no sense.
|
|
565
|
+
- `EXPECT JSON` is both minimal and maximal expectation
|
|
566
|
+
- When you are using `JOKER` in same prompt template, you need to have at least one minimal expectation
|
|
567
|
+
|
|
568
|
+
#### Maximal expectations
|
|
569
|
+
|
|
570
|
+
- `EXPECT MAX 0 ...` is valid maximal expectation. For example, you can expect 0 pages and 2 sentences.
|
|
571
|
+
- `EXPECT JSON` is both minimal and maximal expectation
|
|
572
|
+
|
|
573
|
+
Look at [expectations.ptbk.md](samples/templates/45-expectations.ptbk.md) and [expect-json.ptbk.md](samples/templates/45-expect-json.ptbk.md) samples for more.
|
|
574
|
+
|
|
575
|
+
### Execution report
|
|
576
|
+
|
|
577
|
+
Execution report is a simple object or markdown that contains information about the execution of the pipeline.
|
|
578
|
+
|
|
579
|
+
[See the example of such a report](/samples/templates/50-advanced.report.md)
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
### Remote server
|
|
586
|
+
|
|
587
|
+
Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
588
|
+
|
|
589
|
+
You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
590
|
+
This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
591
|
+
|
|
592
|
+
## 👨💻 Usage and integration _(for developers)_
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
### 🔌 Usage in Typescript / Javascript
|
|
597
|
+
|
|
598
|
+
- [Simple usage](./samples/usage/simple-script)
|
|
599
|
+
- [Usage with client and remote server](./samples/usage/remote)
|
|
600
|
+
|
|
601
|
+
## ➕➖ When to use Promptbook?
|
|
602
|
+
|
|
603
|
+
### ➕ When to use
|
|
604
|
+
|
|
605
|
+
- When you are writing app that generates complex things via LLM - like **websites, articles, presentations, code, stories, songs**,...
|
|
606
|
+
- When you want to **separate code from text prompts**
|
|
607
|
+
- When you want to describe **complex prompt pipelines** and don't want to do it in the code
|
|
608
|
+
- When you want to **orchestrate multiple prompts** together
|
|
609
|
+
- When you want to **reuse** parts of prompts in multiple places
|
|
610
|
+
- When you want to **version** your prompts and **test multiple versions**
|
|
611
|
+
- When you want to **log** the execution of prompts and backtrace the issues
|
|
612
|
+
|
|
613
|
+
### ➖ When not to use
|
|
614
|
+
|
|
615
|
+
- When you are writing just a simple chatbot without any extra logic, just system messages
|
|
616
|
+
|
|
617
|
+
## 🐜 Known issues
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
## 🧼 Intentionally not implemented features
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
## ❔ FAQ
|
|
626
|
+
|
|
627
|
+
If you have a question [start a discussion](https://github.com/webgptorg/promptbook/discussions/), [open an issue](https://github.com/webgptorg/promptbook/issues) or [write me an email](https://www.pavolhejny.com/contact).
|
|
628
|
+
|
|
629
|
+
### Why not just use the OpenAI SDK / Anthropic Claude SDK / ...?
|
|
630
|
+
|
|
631
|
+
Different levels of abstraction. OpenAI library is for direct use of OpenAI API. This library is for a higher level of abstraction. It is for creating prompt templates and promptbooks that are independent of the underlying library, LLM model, or even LLM provider.
|
|
632
|
+
|
|
633
|
+
### How is it different from the Langchain library?
|
|
634
|
+
|
|
635
|
+
Langchain is primarily aimed at ML developers working in Python. This library is for developers working in javascript/typescript and creating applications for end users.
|
|
636
|
+
|
|
637
|
+
We are considering creating a bridge/converter between these two libraries.
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
### Promptbooks vs. OpenAI`s GPTs
|
|
642
|
+
|
|
643
|
+
GPTs are chat assistants that can be assigned to specific tasks and materials. But they are still chat assistants. Promptbooks are a way to orchestrate many more predefined tasks to have much tighter control over the process. Promptbooks are not a good technology for creating human-like chatbots, GPTs are not a good technology for creating outputs with specific requirements.
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
### Where should I store my promptbooks?
|
|
660
|
+
|
|
661
|
+
If you use raw SDKs, you just put prompts in the sourcecode, mixed in with typescript, javascript, python or whatever programming language you use.
|
|
662
|
+
|
|
663
|
+
If you use promptbooks, you can store them in several places, each with its own advantages and disadvantages:
|
|
664
|
+
|
|
665
|
+
1. As **source code**, typically git-committed. In this case you can use the versioning system and the promptbooks will be tightly coupled with the version of the application. You still get the power of promptbooks, as you separate the concerns of the prompt-engineer and the programmer.
|
|
666
|
+
|
|
667
|
+
2. As data in a **database** In this case, promptbooks are like posts / articles on the blog. They can be modified independently of the application. You don't need to redeploy the application to change the promptbooks. You can have multiple versions of promptbooks for each user. You can have a web interface for non-programmers to create and modify promptbooks. But you lose the versioning system and you still have to consider the interface between the promptbooks and the application _(= input and output parameters)_.
|
|
668
|
+
|
|
669
|
+
3. In a **configuration** in environment variables. This is a good way to store promptbooks if you have an application with multiple deployments and you want to have different but simple promptbooks for each deployment and you don't need to change them often.
|
|
670
|
+
|
|
671
|
+
### What should I do when I need same promptbook in multiple human languages?
|
|
672
|
+
|
|
673
|
+
A single promptbook can be written for several _(human)_ languages at once. However, we recommend that you have separate promptbooks for each language.
|
|
674
|
+
|
|
675
|
+
In large language models, you will get better results if you have prompts in the same language as the user input.
|
|
676
|
+
|
|
677
|
+
The best way to manage this is to have suffixed promptbooks like `write-website-content.en.ptbk.md` and `write-website-content.cs.ptbk.md` for each supported language.
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
## ⌚ Changelog
|
|
684
|
+
|
|
685
|
+
See [CHANGELOG.md](./CHANGELOG.md)
|
|
686
|
+
|
|
687
|
+
## 📜 License
|
|
688
|
+
|
|
689
|
+
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://github.com/webgptorg/promptbook">Promptbook</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://github.com/hejny/">Pavol Hejný</a> is licensed under <a href="https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY 4.0</a></p>
|
|
690
|
+
|
|
691
|
+
## 🎯 Todos
|
|
692
|
+
|
|
693
|
+
See [TODO.md](./TODO.md)
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
## 🖋️ Contributing
|
|
699
|
+
|
|
700
|
+
I am open to pull requests, feedback, and suggestions. Or if you like this utility, you can [☕ buy me a coffee](https://www.buymeacoffee.com/hejny) or [donate via cryptocurrencies](https://github.com/hejny/hejny/blob/main/documents/crypto.md).
|
|
701
|
+
|
|
702
|
+
You can also ⭐ star the promptbook package, [follow me on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).
|