@promptbook/remote-server 0.70.0-1 → 0.71.0-12
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 +33 -59
- package/esm/index.es.js +134 -25
- package/esm/index.es.js.map +1 -1
- package/esm/typings/promptbook-collection/index.d.ts +0 -3
- package/esm/typings/src/_packages/browser.index.d.ts +3 -1
- package/esm/typings/src/_packages/cli.index.d.ts +20 -0
- package/esm/typings/src/_packages/core.index.d.ts +45 -15
- package/esm/typings/src/_packages/documents.index.d.ts +8 -0
- package/esm/typings/src/_packages/legacy-documents.index.d.ts +8 -0
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +6 -0
- package/esm/typings/src/_packages/node.index.d.ts +14 -6
- package/esm/typings/src/_packages/pdf.index.d.ts +8 -0
- package/esm/typings/src/_packages/types.index.d.ts +53 -25
- package/esm/typings/src/_packages/utils.index.d.ts +4 -4
- package/esm/typings/src/_packages/website-crawler.index.d.ts +8 -0
- package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/make.d.ts +2 -2
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +13 -0
- package/esm/typings/src/cli/main.d.ts +1 -1
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +11 -6
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/ForeachCommand.d.ts +3 -7
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +27 -0
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -3
- package/esm/typings/src/commands/FORMAT/formatCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.d.ts +11 -0
- package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.test.d.ts +4 -0
- package/esm/typings/src/commands/MODEL/modelCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/PERSONA/personaCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/TEMPLATE/templateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/URL/urlCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -4
- package/esm/typings/src/config.d.ts +32 -3
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +4 -15
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +1 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTemplate.d.ts +2 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +1 -1
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +10 -5
- package/esm/typings/src/{knowledge/dialogs → dialogs}/callback/CallbackInterfaceTools.d.ts +2 -2
- package/esm/typings/src/{knowledge/dialogs → dialogs}/callback/CallbackInterfaceToolsOptions.d.ts +3 -3
- package/esm/typings/src/{knowledge/dialogs → dialogs}/simple-prompt/SimplePromptInterfaceTools.d.ts +5 -5
- package/esm/typings/src/errors/AbstractFormatError.d.ts +11 -0
- package/esm/typings/src/errors/KnowledgeScrapeError.d.ts +9 -0
- package/esm/typings/src/errors/MissingToolsError.d.ts +9 -0
- package/esm/typings/src/execution/{CommonExecutionToolsOptions.d.ts → CommonToolsOptions.d.ts} +1 -1
- package/esm/typings/src/execution/ExecutionTools.d.ts +20 -8
- package/esm/typings/src/execution/PipelineExecutor.d.ts +1 -0
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +9 -8
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTemplateResult.d.ts +45 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +23 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +29 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +58 -0
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +60 -0
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +69 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +34 -0
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTemplate.d.ts +10 -0
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTemplate.d.ts +27 -0
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTemplate.d.ts +30 -0
- package/esm/typings/src/execution/createPipelineExecutor/getSamplesForTemplate.d.ts +10 -0
- package/esm/typings/src/execution/embeddingVectorToString.d.ts +1 -1
- package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -0
- package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +13 -0
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +2 -0
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -0
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +3 -4
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +14 -15
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +31 -0
- package/esm/typings/src/formats/csv/{ListFormatDefinition.d.ts → CsvFormatDefinition.d.ts} +6 -3
- package/esm/typings/src/formats/csv/CsvFormatError.d.ts +10 -0
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +13 -0
- package/esm/typings/src/formats/index.d.ts +1 -1
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +4 -3
- package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +19 -0
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +4 -3
- package/esm/typings/src/llm-providers/_common/{$llmToolsMetadataRegister.d.ts → register/$llmToolsMetadataRegister.d.ts} +4 -1
- package/esm/typings/src/llm-providers/_common/{$llmToolsRegister.d.ts → register/$llmToolsRegister.d.ts} +5 -2
- package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfigurationFromEnv.d.ts → register/$provideLlmToolsConfigurationFromEnv.d.ts} +3 -3
- package/esm/typings/src/llm-providers/_common/{getLlmToolsForCli.d.ts → register/$provideLlmToolsForCli.d.ts} +4 -3
- package/esm/typings/src/llm-providers/_common/{getLlmToolsForTestingAndScriptsAndPlayground.d.ts → register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts} +4 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +27 -0
- package/esm/typings/src/llm-providers/_common/{$registeredLlmToolsMessage.d.ts → register/$registeredLlmToolsMessage.d.ts} +5 -2
- package/esm/typings/src/llm-providers/_common/{LlmToolsConfiguration.d.ts → register/LlmToolsConfiguration.d.ts} +5 -4
- package/esm/typings/src/llm-providers/_common/{LlmToolsMetadata.d.ts → register/LlmToolsMetadata.d.ts} +5 -4
- package/esm/typings/src/llm-providers/_common/{LlmToolsOptions.d.ts → register/LlmToolsOptions.d.ts} +4 -1
- package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfiguration.d.ts → register/createLlmToolsFromConfiguration.d.ts} +5 -4
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -2
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +4 -3
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +4 -3
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +8 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +1 -0
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +4 -3
- package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +4 -3
- package/esm/typings/src/llm-providers/langtail/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/multiple/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -1
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +2 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +4 -3
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +4 -3
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +3 -3
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
- package/esm/typings/src/llm-providers/remote/playground/playground.d.ts +3 -0
- package/esm/typings/src/personas/preparePersona.d.ts +4 -3
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +68 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
- package/esm/typings/src/prepare/preparePipeline.d.ts +3 -2
- package/esm/typings/src/prepare/prepareTemplates.d.ts +4 -3
- package/esm/typings/src/scrapers/_common/Converter.d.ts +22 -0
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +66 -0
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +11 -0
- package/esm/typings/src/{knowledge/prepare-knowledge → scrapers}/_common/prepareKnowledgePieces.d.ts +5 -4
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +15 -0
- package/esm/typings/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +41 -0
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +33 -0
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +4 -0
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +13 -0
- package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +43 -0
- package/esm/typings/src/scrapers/document/DocumentScraper.test.d.ts +4 -0
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/document/playground/document-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/document/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +43 -0
- package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +4 -0
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +29 -0
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +40 -0
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +47 -0
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/website/playground/website-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +13 -0
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +24 -0
- package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +12 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +2 -2
- package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +2 -2
- package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +2 -2
- package/esm/typings/src/storage/{files-storage/FilesStorage.d.ts → file-cache-storage/FileCacheStorage.d.ts} +4 -4
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +10 -0
- package/esm/typings/src/storage/{files-storage → file-cache-storage}/utils/nameToSubfolderPath.d.ts +1 -1
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +1 -1
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +1 -1
- package/esm/typings/src/storage/{utils → memory/utils}/PrefixStorage.d.ts +1 -1
- package/esm/typings/src/storage/{utils → memory/utils}/makePromptbookStorageFromWebStorage.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +9 -2
- package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +1 -0
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +3 -3
- package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +5 -0
- package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -1
- package/esm/typings/src/types/typeAliases.d.ts +16 -12
- package/esm/typings/src/utils/$Register.d.ts +19 -6
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +14 -0
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +17 -0
- package/esm/typings/src/utils/execCommand/IExecCommandOptions.d.ts +23 -0
- package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +10 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +3 -0
- package/esm/typings/src/utils/files/$isDirectoryExisting.d.ts +3 -3
- package/esm/typings/src/utils/files/$isFileExisting.d.ts +3 -3
- package/esm/typings/src/utils/files/$listAllFiles.d.ts +5 -4
- package/esm/typings/src/utils/files/extensionToMimeType.d.ts +8 -0
- package/esm/typings/src/utils/files/getFileExtension.d.ts +8 -0
- package/esm/typings/src/utils/files/getFileExtension.test.d.ts +1 -0
- package/esm/typings/src/utils/organization/{f.d.ts → empty_object.d.ts} +5 -1
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +12 -0
- package/esm/typings/src/utils/{extractParameterNames.d.ts → parameters/extractParameterNames.d.ts} +2 -2
- package/esm/typings/src/utils/parameters/extractParameterNames.test.d.ts +1 -0
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +27 -0
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/{replaceParameters.d.ts → parameters/replaceParameters.d.ts} +2 -2
- package/esm/typings/src/utils/parameters/replaceParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
- package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +1 -1
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +2 -2
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +10 -0
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.test.d.ts +1 -0
- package/package.json +17 -13
- package/umd/index.umd.js +134 -25
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +0 -72
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +0 -16
- package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +0 -37
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +0 -2
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +0 -14
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +0 -15
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +0 -25
- package/esm/typings/src/prepare/PrepareOptions.d.ts +0 -22
- package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -10
- /package/esm/typings/src/{knowledge/dialogs → dialogs}/user-interface-execution-tools.test.d.ts +0 -0
- /package/esm/typings/src/{knowledge/prepare-knowledge → scrapers}/_common/prepareKnowledgePieces.test.d.ts +0 -0
- /package/esm/typings/src/{knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts → scrapers/markdown/MarkdownScraper.test.d.ts} +0 -0
- /package/esm/typings/src/{execution/utils/usageToHuman.test.d.ts → scrapers/website/WebsiteScraper.test.d.ts} +0 -0
- /package/esm/typings/src/{knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts → scrapers/website/utils/markdownConverter.test.d.ts} +0 -0
- /package/esm/typings/src/storage/{files-storage → file-cache-storage}/utils/nameToSubfolderPath.test.d.ts +0 -0
- /package/esm/typings/src/{personas/preparePersona.test.d.ts → utils/execCommand/execCommand.test.d.ts} +0 -0
- /package/esm/typings/src/utils/{extractParameterNames.test.d.ts → execCommand/execCommandNormalizeOptions.test.d.ts} +0 -0
- /package/esm/typings/src/utils/{replaceParameters.test.d.ts → files/extensionToMimeType.test.d.ts} +0 -0
|
@@ -6,3 +6,6 @@ import type { ExpectationUnit } from '../../types/PipelineJson/Expectations';
|
|
|
6
6
|
* @public exported from `@promptbook/utils`
|
|
7
7
|
*/
|
|
8
8
|
export declare const CountUtils: Record<ExpectationUnit, (text: string) => ExpectationAmount>;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: [🧠][🤠] This should be probbably as part of `TextFormatDefinition`
|
|
11
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { string_dirname } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the directory exists
|
|
4
4
|
*
|
|
@@ -6,9 +6,9 @@ import type { string_folder_path } from '../../types/typeAliases';
|
|
|
6
6
|
*
|
|
7
7
|
* @private within the repository
|
|
8
8
|
*/
|
|
9
|
-
export declare function $isDirectoryExisting(directoryPath:
|
|
9
|
+
export declare function $isDirectoryExisting(directoryPath: string_dirname): Promise<boolean>;
|
|
10
10
|
/**
|
|
11
|
-
* Note: [🟢]
|
|
11
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
12
12
|
* TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
13
13
|
* TODO: [🧠][📂] "directory" vs "folder"
|
|
14
14
|
* TODO: [🖇] What about symlinks?
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { string_filename } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the file exists
|
|
4
4
|
*
|
|
@@ -6,9 +6,9 @@ import type { string_file_path } from '../../types/typeAliases';
|
|
|
6
6
|
*
|
|
7
7
|
* @private within the repository
|
|
8
8
|
*/
|
|
9
|
-
export declare function $isFileExisting(
|
|
9
|
+
export declare function $isFileExisting(filename: string_filename): Promise<boolean>;
|
|
10
10
|
/**
|
|
11
|
-
* Note: [🟢]
|
|
11
|
+
* Note: [🟢 !!!!!! After fix makeKnowledgeSourceHandler] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
|
|
12
12
|
* TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
13
13
|
* TODO: [🖇] What about symlinks?
|
|
14
14
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { string_dirname } from '../../types/typeAliases';
|
|
2
|
+
import type { string_filename } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Reads all files in the directory
|
|
5
5
|
*
|
|
@@ -10,8 +10,9 @@ import type { string_folder_path } from '../../types/typeAliases';
|
|
|
10
10
|
* @returns List of all files in the directory
|
|
11
11
|
* @private internal function of `createCollectionFromDirectory`
|
|
12
12
|
*/
|
|
13
|
-
export declare function $listAllFiles(path:
|
|
13
|
+
export declare function $listAllFiles(path: string_dirname, isRecursive: boolean): Promise<Array<string_filename>>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* TODO: [😶] Unite floder listing
|
|
16
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
16
17
|
* TODO: [🖇] What about symlinks?
|
|
17
18
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_file_extension } from '../../types/typeAliases';
|
|
2
|
+
import type { string_mime_type } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Convert file extension to mime type
|
|
5
|
+
*
|
|
6
|
+
* @private within the repository
|
|
7
|
+
*/
|
|
8
|
+
export declare function extensionToMimeType(value: string_file_extension): string_mime_type;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_filename } from '../../types/typeAliases';
|
|
2
|
+
import type { string_mime_type } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Get the file extension from a file name
|
|
5
|
+
*
|
|
6
|
+
* @private within the repository
|
|
7
|
+
*/
|
|
8
|
+
export declare function getFileExtension(value: string_filename): string_mime_type | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Organizational helper to better mark the place where to really use empty object `{}`
|
|
3
3
|
*
|
|
4
|
+
* Note: There are 2 similar types>
|
|
5
|
+
* - `empty_object` @@@
|
|
6
|
+
* - `just_empty_object` @@@
|
|
7
|
+
*
|
|
4
8
|
* @private within the repository
|
|
5
9
|
*/
|
|
6
|
-
export type
|
|
10
|
+
export type empty_object = {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organizational helper to better @@@@
|
|
3
|
+
*
|
|
4
|
+
* Note: There are 2 similar types>
|
|
5
|
+
* - `empty_object` @@@
|
|
6
|
+
* - `just_empty_object` @@@
|
|
7
|
+
*
|
|
8
|
+
* Note: In most cases, you should use `empty_object`
|
|
9
|
+
*
|
|
10
|
+
* @private within the repository
|
|
11
|
+
*/
|
|
12
|
+
export type just_empty_object = Record<string, never>;
|
package/esm/typings/src/utils/{extractParameterNames.d.ts → parameters/extractParameterNames.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { string_parameter_name } from '
|
|
2
|
-
import type { string_template } from '
|
|
1
|
+
import type { string_parameter_name } from '../../types/typeAliases';
|
|
2
|
+
import type { string_template } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Parses the template and returns the list of all parameter names
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { string_parameter_name } from '../../types/typeAliases';
|
|
2
|
+
import type { string_parameter_value } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* @@@
|
|
5
|
+
*/
|
|
6
|
+
type MakeapAvailableToExpectedParametersOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* @@@
|
|
9
|
+
*/
|
|
10
|
+
readonly expectedParameters: Readonly<Record<string_parameter_name, null>>;
|
|
11
|
+
/**
|
|
12
|
+
* @@@
|
|
13
|
+
*/
|
|
14
|
+
readonly availableParameters: Readonly<Record<string_parameter_name, string_parameter_value>>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Maps available parameters to expected parameters
|
|
18
|
+
*
|
|
19
|
+
* The strategy is:
|
|
20
|
+
* 1) @@@
|
|
21
|
+
* 2) @@@
|
|
22
|
+
*
|
|
23
|
+
* @throws {PipelineExecutionError} @@@
|
|
24
|
+
* @private within the repository used in `createPipelineExecutor`
|
|
25
|
+
*/
|
|
26
|
+
export declare function mapAvailableToExpectedParameters(options: MakeapAvailableToExpectedParametersOptions): Readonly<Record<string_parameter_name, string_parameter_value>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Parameters } from '
|
|
2
|
-
import type { string_template } from '
|
|
1
|
+
import type { Parameters } from '../../types/typeAliases';
|
|
2
|
+
import type { string_template } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Replaces parameters in template with values from parameters object
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,6 +22,6 @@ import type { string_name } from '../../types/typeAliases';
|
|
|
22
22
|
export declare function checkSerializableAsJson(name: string_name, value: unknown): void;
|
|
23
23
|
/**
|
|
24
24
|
* TODO: [🧠][🛣] More elegant way to tracking than passing `name`
|
|
25
|
-
* TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
|
|
25
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
26
26
|
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
27
27
|
*/
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function isSerializableAsJson(value: unknown): boolean;
|
|
21
21
|
/**
|
|
22
|
-
* TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
|
|
22
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
23
23
|
* TODO: [🧠][💺] Can be done this on type-level?
|
|
24
24
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { string_filename } from '../../../types/typeAliases';
|
|
2
2
|
import type { really_unknown } from '../../organization/really_unknown';
|
|
3
3
|
/**
|
|
4
4
|
* Tests if given string is valid URL.
|
|
@@ -6,4 +6,4 @@ import type { really_unknown } from '../../organization/really_unknown';
|
|
|
6
6
|
* Note: This does not check if the file exists only if the path is valid
|
|
7
7
|
* @public exported from `@promptbook/utils`
|
|
8
8
|
*/
|
|
9
|
-
export declare function isValidFilePath(
|
|
9
|
+
export declare function isValidFilePath(filename: really_unknown): filename is string_filename;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { string_parameter_name } from '../../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Function `validateParameterName` will @@@
|
|
4
|
+
*
|
|
5
|
+
* @param parameterName @@@
|
|
6
|
+
* @returns @@@
|
|
7
|
+
* @throws {ParseError} @@@
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function validateParameterName(parameterName: string): string_parameter_name;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0-12",
|
|
4
4
|
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -12,21 +12,25 @@
|
|
|
12
12
|
"Pavol Hejný <me@pavolhejny.com> (https://www.pavolhejny.com/)"
|
|
13
13
|
],
|
|
14
14
|
"keywords": [
|
|
15
|
-
"autogpt",
|
|
16
|
-
"openai",
|
|
17
|
-
"gpt-3",
|
|
18
|
-
"gpt-4",
|
|
19
|
-
"chatgpt",
|
|
20
15
|
"ai",
|
|
16
|
+
"llm",
|
|
17
|
+
"prompt",
|
|
18
|
+
"template",
|
|
19
|
+
"language-model",
|
|
20
|
+
"chatgpt",
|
|
21
|
+
"autogpt",
|
|
21
22
|
"machine-learning",
|
|
22
23
|
"natural-language-processing",
|
|
23
24
|
"nlp",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
25
|
+
"openai",
|
|
26
|
+
"gpt-3",
|
|
27
|
+
"gpt-4",
|
|
28
|
+
"gpt-4o",
|
|
29
|
+
"gpt-4o-mini",
|
|
30
|
+
"o1",
|
|
31
|
+
"o1-mini",
|
|
32
|
+
"o1-preview",
|
|
33
|
+
"anthropic"
|
|
30
34
|
],
|
|
31
35
|
"license": "CC-BY-4.0",
|
|
32
36
|
"bugs": {
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"module": "./esm/index.es.js",
|
|
48
52
|
"typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
|
|
49
53
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.
|
|
54
|
+
"@promptbook/core": "0.71.0-12"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
57
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
/**
|
|
15
15
|
* The version of the Promptbook library
|
|
16
16
|
*/
|
|
17
|
-
var PROMPTBOOK_VERSION = '0.
|
|
18
|
-
// TODO: !!!! List here all the versions and annotate + put into script
|
|
17
|
+
var PROMPTBOOK_VERSION = '0.71.0-11';
|
|
18
|
+
// TODO: [main] !!!! List here all the versions and annotate + put into script
|
|
19
19
|
|
|
20
20
|
/*! *****************************************************************************
|
|
21
21
|
Copyright (c) Microsoft Corporation.
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
327
|
* TODO: [🧠][🛣] More elegant way to tracking than passing `name`
|
|
328
|
-
* TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
|
|
328
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
329
329
|
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
330
330
|
*/
|
|
331
331
|
|
|
@@ -361,10 +361,22 @@
|
|
|
361
361
|
'samples',
|
|
362
362
|
'modelName',
|
|
363
363
|
'currentDate',
|
|
364
|
+
// <- TODO: !!!!! list here all command names
|
|
364
365
|
// <- TODO: Add more like 'date', 'modelName',...
|
|
365
366
|
// <- TODO: Add [emoji] + instructions ACRY when adding new reserved parameter
|
|
366
367
|
]);
|
|
367
368
|
// <- TODO: [🧜♂️]
|
|
369
|
+
/**
|
|
370
|
+
* @@@
|
|
371
|
+
*
|
|
372
|
+
* @public exported from `@promptbook/core`
|
|
373
|
+
*/
|
|
374
|
+
Object.freeze({
|
|
375
|
+
delimiter: ',',
|
|
376
|
+
quoteChar: '"',
|
|
377
|
+
newline: '\n',
|
|
378
|
+
skipEmptyLines: true,
|
|
379
|
+
});
|
|
368
380
|
/**
|
|
369
381
|
* @@@
|
|
370
382
|
*
|
|
@@ -583,6 +595,7 @@
|
|
|
583
595
|
*
|
|
584
596
|
* Note: Internal utility of `joinLlmExecutionTools` but exposed type
|
|
585
597
|
* @public exported from `@promptbook/types`
|
|
598
|
+
* TODO: !!!!!! Export as runtime class not just type
|
|
586
599
|
*/
|
|
587
600
|
var MultipleLlmExecutionTools = /** @class */ (function () {
|
|
588
601
|
/**
|
|
@@ -604,9 +617,10 @@
|
|
|
604
617
|
});
|
|
605
618
|
Object.defineProperty(MultipleLlmExecutionTools.prototype, "description", {
|
|
606
619
|
get: function () {
|
|
607
|
-
return this.llmExecutionTools
|
|
608
|
-
|
|
609
|
-
.
|
|
620
|
+
return this.llmExecutionTools.map(function (_a, index) {
|
|
621
|
+
var title = _a.title;
|
|
622
|
+
return "".concat(index + 1, ") `").concat(title, "`");
|
|
623
|
+
}).join('\n');
|
|
610
624
|
},
|
|
611
625
|
enumerable: false,
|
|
612
626
|
configurable: true
|
|
@@ -804,9 +818,7 @@
|
|
|
804
818
|
throw new PipelineExecutionError("You have not provided any `LlmExecutionTools`");
|
|
805
819
|
}
|
|
806
820
|
else {
|
|
807
|
-
throw new PipelineExecutionError(spaceTrim__default["default"](function (block) { return "\n You have not provided any `LlmExecutionTools` that support model variant \"".concat(prompt.modelRequirements.modelVariant, "\n\n Available `LlmExecutionTools`:\n ").concat(block(_this.
|
|
808
|
-
.map(function (tools) { return "- ".concat(tools.title, " ").concat(tools.description || ''); })
|
|
809
|
-
.join('\n')), "\n\n "); }));
|
|
821
|
+
throw new PipelineExecutionError(spaceTrim__default["default"](function (block) { return "\n You have not provided any `LlmExecutionTools` that support model variant \"".concat(prompt.modelRequirements.modelVariant, "\"\n\n Available `LlmExecutionTools`:\n ").concat(block(_this.description), "\n\n "); }));
|
|
810
822
|
}
|
|
811
823
|
}
|
|
812
824
|
});
|
|
@@ -882,6 +894,85 @@
|
|
|
882
894
|
return Function('return this')();
|
|
883
895
|
}
|
|
884
896
|
|
|
897
|
+
/**
|
|
898
|
+
* @@@
|
|
899
|
+
*
|
|
900
|
+
* @param text @@@
|
|
901
|
+
* @returns @@@
|
|
902
|
+
* @example 'HELLO_WORLD'
|
|
903
|
+
* @example 'I_LOVE_PROMPTBOOK'
|
|
904
|
+
* @public exported from `@promptbook/utils`
|
|
905
|
+
*/
|
|
906
|
+
function normalizeTo_SCREAMING_CASE(text) {
|
|
907
|
+
var e_1, _a;
|
|
908
|
+
var charType;
|
|
909
|
+
var lastCharType = 'OTHER';
|
|
910
|
+
var normalizedName = '';
|
|
911
|
+
try {
|
|
912
|
+
for (var text_1 = __values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {
|
|
913
|
+
var char = text_1_1.value;
|
|
914
|
+
var normalizedChar = void 0;
|
|
915
|
+
if (/^[a-z]$/.test(char)) {
|
|
916
|
+
charType = 'LOWERCASE';
|
|
917
|
+
normalizedChar = char.toUpperCase();
|
|
918
|
+
}
|
|
919
|
+
else if (/^[A-Z]$/.test(char)) {
|
|
920
|
+
charType = 'UPPERCASE';
|
|
921
|
+
normalizedChar = char;
|
|
922
|
+
}
|
|
923
|
+
else if (/^[0-9]$/.test(char)) {
|
|
924
|
+
charType = 'NUMBER';
|
|
925
|
+
normalizedChar = char;
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
charType = 'OTHER';
|
|
929
|
+
normalizedChar = '_';
|
|
930
|
+
}
|
|
931
|
+
if (charType !== lastCharType &&
|
|
932
|
+
!(lastCharType === 'UPPERCASE' && charType === 'LOWERCASE') &&
|
|
933
|
+
!(lastCharType === 'NUMBER') &&
|
|
934
|
+
!(charType === 'NUMBER')) {
|
|
935
|
+
normalizedName += '_';
|
|
936
|
+
}
|
|
937
|
+
normalizedName += normalizedChar;
|
|
938
|
+
lastCharType = charType;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
942
|
+
finally {
|
|
943
|
+
try {
|
|
944
|
+
if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);
|
|
945
|
+
}
|
|
946
|
+
finally { if (e_1) throw e_1.error; }
|
|
947
|
+
}
|
|
948
|
+
normalizedName = normalizedName.replace(/_+/g, '_');
|
|
949
|
+
normalizedName = normalizedName.replace(/_?\/_?/g, '/');
|
|
950
|
+
normalizedName = normalizedName.replace(/^_/, '');
|
|
951
|
+
normalizedName = normalizedName.replace(/_$/, '');
|
|
952
|
+
return normalizedName;
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* TODO: Tests
|
|
956
|
+
* > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: 'Moje tabule' })).toEqual('/VtG7sR9rRJqwNEdM2/Moje tabule');
|
|
957
|
+
* > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: 'ěščřžžýáíúů' })).toEqual('/VtG7sR9rRJqwNEdM2/escrzyaieuu');
|
|
958
|
+
* > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: ' ahoj ' })).toEqual('/VtG7sR9rRJqwNEdM2/ahoj');
|
|
959
|
+
* > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: ' ahoj_ahojAhoj ahoj ' })).toEqual('/VtG7sR9rRJqwNEdM2/ahoj-ahoj-ahoj-ahoj');
|
|
960
|
+
* TODO: [🌺] Use some intermediate util splitWords
|
|
961
|
+
*/
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* @@@
|
|
965
|
+
*
|
|
966
|
+
* @param text @@@
|
|
967
|
+
* @returns @@@
|
|
968
|
+
* @example 'hello_world'
|
|
969
|
+
* @example 'i_love_promptbook'
|
|
970
|
+
* @public exported from `@promptbook/utils`
|
|
971
|
+
*/
|
|
972
|
+
function normalizeTo_snake_case(text) {
|
|
973
|
+
return normalizeTo_SCREAMING_CASE(text).toLowerCase();
|
|
974
|
+
}
|
|
975
|
+
|
|
885
976
|
/**
|
|
886
977
|
* Register is @@@
|
|
887
978
|
*
|
|
@@ -890,9 +981,9 @@
|
|
|
890
981
|
* @private internal utility, exported are only signleton instances of this class
|
|
891
982
|
*/
|
|
892
983
|
var $Register = /** @class */ (function () {
|
|
893
|
-
function $Register(
|
|
894
|
-
this.
|
|
895
|
-
storageName = "_promptbook_".concat(
|
|
984
|
+
function $Register(registerName) {
|
|
985
|
+
this.registerName = registerName;
|
|
986
|
+
var storageName = "_promptbook_".concat(normalizeTo_snake_case(registerName));
|
|
896
987
|
var globalScope = $getGlobalScope();
|
|
897
988
|
if (globalScope[storageName] === undefined) {
|
|
898
989
|
globalScope[storageName] = [];
|
|
@@ -907,7 +998,6 @@
|
|
|
907
998
|
return this.storage;
|
|
908
999
|
};
|
|
909
1000
|
$Register.prototype.register = function (registered) {
|
|
910
|
-
// <- TODO: What to return here
|
|
911
1001
|
var packageName = registered.packageName, className = registered.className;
|
|
912
1002
|
var existingRegistrationIndex = this.storage.findIndex(function (item) { return item.packageName === packageName && item.className === className; });
|
|
913
1003
|
var existingRegistration = this.storage[existingRegistrationIndex];
|
|
@@ -917,6 +1007,17 @@
|
|
|
917
1007
|
else {
|
|
918
1008
|
this.storage[existingRegistrationIndex] = registered;
|
|
919
1009
|
}
|
|
1010
|
+
return {
|
|
1011
|
+
registerName: this.registerName,
|
|
1012
|
+
packageName: packageName,
|
|
1013
|
+
className: className,
|
|
1014
|
+
get isDestroyed() {
|
|
1015
|
+
return false;
|
|
1016
|
+
},
|
|
1017
|
+
destroy: function () {
|
|
1018
|
+
throw new NotYetImplementedError("Registration to ".concat(this.registerName, " is permanent in this version of Promptbook"));
|
|
1019
|
+
},
|
|
1020
|
+
};
|
|
920
1021
|
};
|
|
921
1022
|
return $Register;
|
|
922
1023
|
}());
|
|
@@ -929,6 +1030,9 @@
|
|
|
929
1030
|
* @public exported from `@promptbook/core`
|
|
930
1031
|
*/
|
|
931
1032
|
var $llmToolsRegister = new $Register('llm_execution_tools_constructors');
|
|
1033
|
+
/**
|
|
1034
|
+
* TODO: [®] DRY Register logic
|
|
1035
|
+
*/
|
|
932
1036
|
|
|
933
1037
|
/**
|
|
934
1038
|
* @@@
|
|
@@ -938,13 +1042,16 @@
|
|
|
938
1042
|
* @public exported from `@promptbook/core`
|
|
939
1043
|
*/
|
|
940
1044
|
var $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
|
|
1045
|
+
/**
|
|
1046
|
+
* TODO: [®] DRY Register logic
|
|
1047
|
+
*/
|
|
941
1048
|
|
|
942
1049
|
/**
|
|
943
1050
|
* Creates a message with all registered LLM tools
|
|
944
1051
|
*
|
|
945
1052
|
* Note: This function is used to create a (error) message when there is no constructor for some LLM provider
|
|
946
1053
|
*
|
|
947
|
-
* @private internal function of `createLlmToolsFromConfiguration` and `
|
|
1054
|
+
* @private internal function of `createLlmToolsFromConfiguration` and `$provideLlmToolsFromEnv`
|
|
948
1055
|
*/
|
|
949
1056
|
function $registeredLlmToolsMessage() {
|
|
950
1057
|
var e_1, _a, e_2, _b;
|
|
@@ -1036,6 +1143,9 @@
|
|
|
1036
1143
|
})
|
|
1037
1144
|
.join('\n')), "\n "); });
|
|
1038
1145
|
}
|
|
1146
|
+
/**
|
|
1147
|
+
* TODO: [®] DRY Register logic
|
|
1148
|
+
*/
|
|
1039
1149
|
|
|
1040
1150
|
/**
|
|
1041
1151
|
* @@@
|
|
@@ -1063,12 +1173,13 @@
|
|
|
1063
1173
|
return joinLlmExecutionTools.apply(void 0, __spreadArray([], __read(llmTools), false));
|
|
1064
1174
|
}
|
|
1065
1175
|
/**
|
|
1066
|
-
* TODO: [🎌]
|
|
1176
|
+
* TODO: [🎌] Together with `createLlmToolsFromConfiguration` + 'EXECUTION_TOOLS_CLASSES' gets to `@promptbook/core` ALL model providers, make this more efficient
|
|
1067
1177
|
* TODO: [🧠][🎌] Dynamically install required providers
|
|
1068
1178
|
* TODO: @@@ write discussion about this - wizzard
|
|
1069
1179
|
* TODO: [🧠][🍛] Which name is better `createLlmToolsFromConfig` or `createLlmToolsFromConfiguration`?
|
|
1070
1180
|
* TODO: [🧠] Is there some meaningfull way how to test this util
|
|
1071
1181
|
* TODO: This should be maybe not under `_common` but under `utils`
|
|
1182
|
+
* TODO: [®] DRY Register logic
|
|
1072
1183
|
*/
|
|
1073
1184
|
|
|
1074
1185
|
/**
|
|
@@ -1127,9 +1238,7 @@
|
|
|
1127
1238
|
}
|
|
1128
1239
|
});
|
|
1129
1240
|
}); });
|
|
1130
|
-
var server = new socket_io.Server(
|
|
1131
|
-
// <- TODO: [🧱] Implement in a functional (not new Class) way
|
|
1132
|
-
httpServer, {
|
|
1241
|
+
var server = new socket_io.Server(httpServer, {
|
|
1133
1242
|
path: path,
|
|
1134
1243
|
transports: [/*'websocket', <- TODO: [🌬] Make websocket transport work */ 'polling'],
|
|
1135
1244
|
cors: {
|
|
@@ -1155,10 +1264,10 @@
|
|
|
1155
1264
|
case 1:
|
|
1156
1265
|
_c.trys.push([1, 14, 15, 16]);
|
|
1157
1266
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1158
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: !!! Test
|
|
1267
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1159
1268
|
}
|
|
1160
1269
|
if (isAnonymous === false && !isCollectionModeAllowed) {
|
|
1161
|
-
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: !!! Test
|
|
1270
|
+
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1162
1271
|
}
|
|
1163
1272
|
llmExecutionTools = void 0;
|
|
1164
1273
|
if (!(isAnonymous === true && llmToolsConfiguration !== null)) return [3 /*break*/, 2];
|
|
@@ -1218,14 +1327,14 @@
|
|
|
1218
1327
|
if (isVerbose) {
|
|
1219
1328
|
console.info(colors__default["default"].bgGreen("PromptResult:"), colors__default["default"].green(JSON.stringify(promptResult, null, 4)));
|
|
1220
1329
|
}
|
|
1221
|
-
socket.emit('prompt-response', { promptResult: promptResult });
|
|
1330
|
+
socket.emit('prompt-response', { promptResult: promptResult } /* <- TODO: [🤛] */);
|
|
1222
1331
|
return [3 /*break*/, 16];
|
|
1223
1332
|
case 14:
|
|
1224
1333
|
error_1 = _c.sent();
|
|
1225
1334
|
if (!(error_1 instanceof Error)) {
|
|
1226
1335
|
throw error_1;
|
|
1227
1336
|
}
|
|
1228
|
-
socket.emit('error', serializeError(error_1));
|
|
1337
|
+
socket.emit('error', serializeError(error_1) /* <- TODO: [🤛] */);
|
|
1229
1338
|
return [3 /*break*/, 16];
|
|
1230
1339
|
case 15:
|
|
1231
1340
|
socket.disconnect();
|
|
@@ -1249,10 +1358,10 @@
|
|
|
1249
1358
|
case 1:
|
|
1250
1359
|
_b.trys.push([1, 3, 4, 5]);
|
|
1251
1360
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1252
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: !!! Test
|
|
1361
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1253
1362
|
}
|
|
1254
1363
|
if (isAnonymous === false && !isCollectionModeAllowed) {
|
|
1255
|
-
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: !!! Test
|
|
1364
|
+
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1256
1365
|
}
|
|
1257
1366
|
llmExecutionTools = void 0;
|
|
1258
1367
|
if (isAnonymous === true) {
|
|
@@ -1268,7 +1377,7 @@
|
|
|
1268
1377
|
return [4 /*yield*/, llmExecutionTools.listModels()];
|
|
1269
1378
|
case 2:
|
|
1270
1379
|
models = _b.sent();
|
|
1271
|
-
socket.emit('listModels-response', { models: models });
|
|
1380
|
+
socket.emit('listModels-response', { models: models } /* <- TODO: [🤛] */);
|
|
1272
1381
|
return [3 /*break*/, 5];
|
|
1273
1382
|
case 3:
|
|
1274
1383
|
error_2 = _b.sent();
|