@promptbook/node 0.92.0-3 → 0.92.0-30
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/esm/index.es.js +796 -426
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +22 -6
- package/esm/typings/src/_packages/deepseek.index.d.ts +2 -0
- package/esm/typings/src/_packages/google.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -2
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/cli/common/$provideLlmToolsForCli.d.ts +1 -1
- package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.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 +36 -28
- package/esm/typings/src/config.d.ts +41 -11
- package/esm/typings/src/constants.d.ts +43 -2
- package/esm/typings/src/conversion/archive/loadArchive.d.ts +2 -2
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
- package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
- package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
- package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
- package/esm/typings/src/execution/CommonToolsOptions.d.ts +5 -1
- package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +4 -2
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +11 -8
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -3
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +20 -14
- package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
- package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +21 -5
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +19 -5
- package/esm/typings/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +9 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +3 -2
- package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +8 -6
- package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +66 -0
- package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
- package/esm/typings/src/formats/csv/utils/csvParse.d.ts +12 -0
- package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
- package/esm/typings/src/formats/index.d.ts +2 -2
- package/esm/typings/src/formats/json/{JsonFormatDefinition.d.ts → JsonFormatParser.d.ts} +6 -6
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
- package/esm/typings/src/formats/json/utils/jsonParse.d.ts +8 -0
- package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
- package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
- package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +16 -7
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -1
- package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +29 -0
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/index.d.ts +33 -8
- package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +4 -2
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/high-level-abstractions/index.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +4 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +17 -4
- package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +11 -4
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +27 -5
- package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +9 -2
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +12 -3
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +10 -5
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +5 -3
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +23 -0
- package/esm/typings/src/llm-providers/google/google-models.d.ts +23 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
- package/esm/typings/src/migrations/migratePipeline.d.ts +9 -0
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
- package/esm/typings/src/personas/preparePersona.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +9 -6
- package/esm/typings/src/pipeline/PipelineJson/PersonaJson.d.ts +4 -2
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +3 -2
- package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
- package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +1 -1
- package/esm/typings/src/prepare/prepareTasks.d.ts +7 -4
- package/esm/typings/src/remote-server/openapi-types.d.ts +348 -6
- package/esm/typings/src/remote-server/openapi.d.ts +398 -4
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +2 -1
- package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
- package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
- package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +10 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +7 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
- package/esm/typings/src/types/ModelVariant.d.ts +5 -5
- package/esm/typings/src/types/typeAliases.d.ts +17 -13
- package/esm/typings/src/utils/$Register.d.ts +8 -7
- package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
- package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
- package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
- package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
- package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
- package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
- package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
- package/esm/typings/src/version.d.ts +2 -1
- package/package.json +2 -2
- package/umd/index.umd.js +799 -429
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +0 -31
- package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { FilesystemTools } from '../../execution/FilesystemTools';
|
|
1
2
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
3
|
import type { string_filename } from '../../types/typeAliases';
|
|
3
|
-
import type { FilesystemTools } from '../../execution/FilesystemTools';
|
|
4
4
|
/**
|
|
5
5
|
* Loads the books from the archive file with `.bookc` extension
|
|
6
6
|
*
|
|
@@ -10,7 +10,7 @@ import type { FilesystemTools } from '../../execution/FilesystemTools';
|
|
|
10
10
|
*
|
|
11
11
|
* @private utility of Prompbook
|
|
12
12
|
*/
|
|
13
|
-
export declare function loadArchive(filePath: string_filename, fs: FilesystemTools): Promise<
|
|
13
|
+
export declare function loadArchive(filePath: string_filename, fs: FilesystemTools): Promise<ReadonlyArray<PipelineJson>>;
|
|
14
14
|
/**
|
|
15
15
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
16
16
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This error indicates
|
|
2
|
+
* This error indicates @@
|
|
3
3
|
*
|
|
4
4
|
* @public exported from `@promptbook/core`
|
|
5
5
|
*/
|
|
@@ -8,5 +8,5 @@ export declare class BoilerplateError extends Error {
|
|
|
8
8
|
constructor(message: string);
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* TODO:
|
|
11
|
+
* TODO: @@ Do not forget to add the error into `0-index.ts` ERRORS
|
|
12
12
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Executables } from '../execution/Executables';
|
|
2
2
|
import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
|
|
5
5
|
*
|
|
6
6
|
* @public exported from `@promptbook/node`
|
|
7
7
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Locates the LibreOffice executable on the current system by searching platform-specific paths.
|
|
4
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
4
5
|
*
|
|
5
6
|
* @private within the repository
|
|
6
7
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Locates the Pandoc executable on the current system by searching platform-specific paths.
|
|
4
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
4
5
|
*
|
|
5
6
|
* @private within the repository
|
|
6
7
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
2
|
import type { LocateAppOptions } from '../locateApp';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Attempts to locate the specified application on a Linux system using the 'which' command.
|
|
5
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
5
6
|
*
|
|
6
7
|
* @private within the repository
|
|
7
8
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
2
|
import type { LocateAppOptions } from '../locateApp';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
|
|
5
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
5
6
|
*
|
|
6
7
|
* @private within the repository
|
|
7
8
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { string_executable_path } from '../../types/typeAliases';
|
|
2
2
|
import type { LocateAppOptions } from '../locateApp';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Attempts to locate the specified application on a Windows system by searching common installation directories.
|
|
5
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
5
6
|
*
|
|
6
7
|
* @private within the repository
|
|
7
8
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { string_user_id } from '../types/typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Common options shared across various execution tools.
|
|
4
4
|
*
|
|
5
5
|
* Note: Keep it public to allow people to make their own execution tools
|
|
6
6
|
*/
|
|
@@ -16,6 +16,10 @@ export type CommonToolsOptions = {
|
|
|
16
16
|
* If true, the internal executions will be logged
|
|
17
17
|
*/
|
|
18
18
|
readonly isVerbose?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Maximum number of requests per minute
|
|
21
|
+
*/
|
|
22
|
+
readonly maxRequestsPerMinute?: number;
|
|
19
23
|
};
|
|
20
24
|
/**
|
|
21
25
|
* TODO: [🧠][🤺] Maybe allow overriding of `userId` for each prompt
|
|
@@ -2,7 +2,8 @@ import type { Registered } from '../utils/$Register';
|
|
|
2
2
|
import type { TODO_any } from '../utils/organization/TODO_any';
|
|
3
3
|
import type { LlmExecutionTools } from './LlmExecutionTools';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Type representing a constructor for LLM execution tools, which are used to interact with language models.
|
|
6
|
+
* Combines registration metadata with a factory function for creating LLM tool instances.
|
|
6
7
|
*/
|
|
7
8
|
export type LlmExecutionToolsConstructor = Registered & ((options: TODO_any) => LlmExecutionTools);
|
|
8
9
|
/**
|
|
@@ -5,7 +5,7 @@ import type { AbstractTaskResult } from './AbstractTaskResult';
|
|
|
5
5
|
import type { ExecutionReportJson } from './execution-report/ExecutionReportJson';
|
|
6
6
|
import type { Usage } from './Usage';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* The result of executing a pipeline
|
|
9
9
|
*
|
|
10
10
|
* Note: [🚉] This is fully serializable as JSON
|
|
11
11
|
*/
|
|
@@ -22,8 +22,10 @@ export type PipelineExecutorResult = AbstractTaskResult & {
|
|
|
22
22
|
readonly usage: ReadonlyDeep<Usage>;
|
|
23
23
|
/**
|
|
24
24
|
* The report of the execution with all details
|
|
25
|
+
*
|
|
26
|
+
* Note: If the execution fails unexpectedly, this will be `null`
|
|
25
27
|
*/
|
|
26
|
-
readonly executionReport: ReadonlyDeep<ExecutionReportJson
|
|
28
|
+
readonly executionReport: ReadonlyDeep<ExecutionReportJson> | null;
|
|
27
29
|
/**
|
|
28
30
|
* The prepared pipeline that was used for the execution
|
|
29
31
|
*
|
|
@@ -5,41 +5,44 @@ import type { CompletionPromptResult } from '../PromptResult';
|
|
|
5
5
|
import type { EmbeddingPromptResult } from '../PromptResult';
|
|
6
6
|
import type { PromptResult } from '../PromptResult';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Represents the ongoing result of a pipeline task execution
|
|
9
|
+
*
|
|
10
|
+
* Used internally by the pipeline executor to track state during execution attempts
|
|
9
11
|
*
|
|
10
12
|
* @private internal utility of `createPipelineExecutor`
|
|
11
13
|
*/
|
|
12
14
|
export type $OngoingTaskResult = {
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* The prompt object used for the current execution attempt, if applicable.
|
|
15
17
|
*/
|
|
16
18
|
$prompt?: Prompt;
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* The result of a chat model execution, if applicable.
|
|
19
21
|
*/
|
|
20
22
|
$chatResult?: ChatPromptResult;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* The result of a completion model execution, if applicable.
|
|
23
25
|
*/
|
|
24
26
|
$completionResult?: CompletionPromptResult;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
28
|
+
* The result of an embedding model execution, if applicable.
|
|
29
|
+
* Note: [🤖] Embedding results are less common in standard pipelines.
|
|
27
30
|
*/
|
|
28
31
|
$embeddingResult?: EmbeddingPromptResult;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
33
|
+
* The final result object for the task, or null if not yet available.
|
|
31
34
|
*/
|
|
32
35
|
$result: PromptResult | null;
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* The result string produced by the task, or null if not yet available.
|
|
35
38
|
*/
|
|
36
39
|
$resultString: string | null;
|
|
37
40
|
/**
|
|
38
|
-
*
|
|
41
|
+
* The last expectation error encountered, or null if none.
|
|
39
42
|
*/
|
|
40
43
|
$expectError: ExpectError | null;
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
45
|
+
* List of errors encountered during script postprocessing or execution.
|
|
43
46
|
*/
|
|
44
47
|
$scriptPipelineExecutionErrors: Array<Error>;
|
|
45
48
|
};
|
|
@@ -4,40 +4,43 @@ import type { InputParameters } from '../../types/typeAliases';
|
|
|
4
4
|
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
|
|
5
5
|
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Options for executing an entire pipeline, including input parameters, pipeline context, and progress callbacks.
|
|
8
8
|
*
|
|
9
9
|
* @private internal type of `executePipeline`
|
|
10
10
|
*/
|
|
11
11
|
type ExecutePipelineOptions = Required<CreatePipelineExecutorOptions> & {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* The input parameters provided by the user for pipeline execution.
|
|
14
14
|
*/
|
|
15
15
|
readonly inputParameters: Readonly<InputParameters>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Optional callback invoked with partial results as the pipeline execution progresses.
|
|
18
18
|
*/
|
|
19
19
|
onProgress?(newOngoingResult: PartialDeep<PipelineExecutorResult>): Promisable<void>;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* The pipeline definition to execute.
|
|
22
22
|
*/
|
|
23
23
|
readonly pipeline: PipelineJson;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* The prepared and validated pipeline, ready for execution.
|
|
26
26
|
*/
|
|
27
27
|
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Callback to update the prepared pipeline reference after preparation.
|
|
30
30
|
*/
|
|
31
31
|
readonly setPreparedPipeline: (preparedPipeline: ReadonlyDeep<PipelineJson>) => void;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* String identifier for the pipeline, used in error messages and reporting.
|
|
34
34
|
*/
|
|
35
35
|
readonly pipelineIdentification: string;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Executes an entire pipeline, resolving tasks in dependency order, handling errors, and reporting progress.
|
|
39
39
|
*
|
|
40
|
-
* Note: This is not a `PipelineExecutor` (which is
|
|
40
|
+
* Note: This is not a `PipelineExecutor` (which is bound to a single pipeline), but a utility function used by `createPipelineExecutor` to create a `PipelineExecutor`.
|
|
41
|
+
*
|
|
42
|
+
* @param options - Options for execution, including input parameters, pipeline, and callbacks.
|
|
43
|
+
* @returns The result of the pipeline execution, including output parameters, errors, and usage statistics.
|
|
41
44
|
*
|
|
42
45
|
* @private internal utility of `createPipelineExecutor`
|
|
43
46
|
*/
|
|
@@ -6,38 +6,41 @@ import type { ExecutionReportJson } from '../execution-report/ExecutionReportJso
|
|
|
6
6
|
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
|
|
7
7
|
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Options for executing a single pipeline task, including task details, pipeline context, parameters, and callbacks.
|
|
10
10
|
*
|
|
11
11
|
* @private internal type of `executeTask`
|
|
12
12
|
*/
|
|
13
13
|
type executeSingleTaskOptions = Required<CreatePipelineExecutorOptions> & {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* The task to be executed.
|
|
16
16
|
*/
|
|
17
17
|
readonly currentTask: ReadonlyDeep<TaskJson>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The pipeline in which the task resides, fully prepared and validated.
|
|
20
20
|
*/
|
|
21
21
|
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* The parameters to pass to the task execution.
|
|
24
24
|
*/
|
|
25
25
|
readonly parametersToPass: Readonly<Parameters>;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Callback invoked with partial results as the execution progresses.
|
|
28
28
|
*/
|
|
29
29
|
readonly onProgress: (newOngoingResult: PartialDeep<PipelineExecutorResult>) => Promisable<void>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Mutable execution report object for tracking execution details.
|
|
32
32
|
*/
|
|
33
33
|
readonly $executionReport: WritableDeep<ExecutionReportJson>;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* String identifier for the pipeline, used in error messages and reporting.
|
|
36
36
|
*/
|
|
37
37
|
readonly pipelineIdentification: string;
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Executes a single task within a pipeline, handling parameter validation, error checking, and progress reporting.
|
|
41
|
+
*
|
|
42
|
+
* @param options - Options for execution, including the task, pipeline, parameters, and callbacks.
|
|
43
|
+
* @returns The output parameters produced by the task.
|
|
41
44
|
*
|
|
42
45
|
* @private internal utility of `createPipelineExecutor`
|
|
43
46
|
*/
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
+
import type { PartialDeep, Promisable } from 'type-fest';
|
|
1
2
|
import type { TODO_any } from '../../utils/organization/TODO_any';
|
|
3
|
+
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
|
|
2
4
|
import type { ExecuteAttemptsOptions } from './40-executeAttempts';
|
|
3
5
|
/**
|
|
4
|
-
*
|
|
6
|
+
* Options for executing a pipeline task that involves formatting subvalues (e.g., iterating over CSV rows).
|
|
7
|
+
* Extends ExecuteAttemptsOptions with a progress callback.
|
|
5
8
|
*
|
|
6
9
|
* @private internal type of `executeFormatSubvalues`
|
|
7
10
|
*/
|
|
8
|
-
type ExecuteFormatCellsOptions = ExecuteAttemptsOptions
|
|
11
|
+
type ExecuteFormatCellsOptions = ExecuteAttemptsOptions & {
|
|
12
|
+
/**
|
|
13
|
+
* Callback invoked with partial results as the execution progresses.
|
|
14
|
+
*/
|
|
15
|
+
readonly onProgress: (newOngoingResult: PartialDeep<PipelineExecutorResult>) => Promisable<void>;
|
|
16
|
+
};
|
|
9
17
|
/**
|
|
10
|
-
*
|
|
18
|
+
* Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
|
|
19
|
+
* Handles format and subformat resolution, error handling, and progress reporting.
|
|
20
|
+
*
|
|
21
|
+
* @param options - Options for execution, including task details and progress callback.
|
|
22
|
+
* @returns The result of the subvalue mapping or execution attempts.
|
|
11
23
|
*
|
|
12
24
|
* @private internal utility of `createPipelineExecutor`
|
|
13
25
|
*/
|
|
@@ -7,55 +7,61 @@ import type { TODO_string } from '../../utils/organization/TODO_string';
|
|
|
7
7
|
import type { ExecutionReportJson } from '../execution-report/ExecutionReportJson';
|
|
8
8
|
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Options for executing attempts of a pipeline task, including configuration for jokers, priority,
|
|
11
|
+
* maximum attempts, prepared content, parameters, the task itself, the prepared pipeline, execution report,
|
|
12
|
+
* and pipeline identification. Used internally by the pipeline executor.
|
|
11
13
|
*
|
|
12
14
|
* @private internal type of `executeAttempts`
|
|
13
15
|
*/
|
|
14
16
|
export type ExecuteAttemptsOptions = Required<Omit<CreatePipelineExecutorOptions, 'pipeline'>> & {
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
18
|
+
* Names of parameters that act as jokers, which can be used to bypass normal execution if their value meets requirements.
|
|
17
19
|
*/
|
|
18
20
|
readonly jokerParameterNames: Readonly<ReadonlyArray<string_parameter_name>>;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* Priority of the current execution attempt, used to influence UI or execution order.
|
|
21
23
|
*/
|
|
22
24
|
readonly priority: number;
|
|
23
25
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
+
* Maximum number of attempts allowed for this task, including retries and joker attempts.
|
|
26
27
|
* Note: [💂] There are two distinct variabiles
|
|
27
|
-
* 1) `maxExecutionAttempts` -
|
|
28
|
-
* 2) `maxAttempts` -
|
|
28
|
+
* 1) `maxExecutionAttempts` - attempts for LLM model
|
|
29
|
+
* 2) `maxAttempts` - attempts for any task (LLM, SCRIPT, DIALOG, etc.)
|
|
29
30
|
*/
|
|
30
31
|
readonly maxAttempts: number;
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
+
* The content prepared for execution, with parameters already substituted.
|
|
33
34
|
*/
|
|
34
35
|
readonly preparedContent: TODO_string;
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
+
* The parameters provided for this execution attempt.
|
|
37
38
|
*/
|
|
38
39
|
readonly parameters: Readonly<Parameters>;
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
+
* The task being executed, as a deeply immutable TaskJson object.
|
|
42
|
+
* Note: Naming should be unified between `task` and `currentTask`.
|
|
41
43
|
*/
|
|
42
44
|
readonly task: ReadonlyDeep<TaskJson>;
|
|
43
45
|
/**
|
|
44
|
-
*
|
|
46
|
+
* The pipeline structure prepared for execution, as a deeply immutable PipelineJson object.
|
|
45
47
|
*/
|
|
46
48
|
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
47
49
|
/**
|
|
48
|
-
*
|
|
50
|
+
* The execution report object, which is updated during execution.
|
|
49
51
|
*/
|
|
50
52
|
readonly $executionReport: WritableDeep<ExecutionReportJson>;
|
|
51
53
|
/**
|
|
52
|
-
*
|
|
54
|
+
* String identifier for the pipeline, used for logging and error reporting.
|
|
53
55
|
*/
|
|
54
56
|
readonly pipelineIdentification: string;
|
|
55
57
|
};
|
|
56
58
|
/**
|
|
57
|
-
*
|
|
59
|
+
* Executes a pipeline task with multiple attempts, including joker and retry logic. Handles different task types
|
|
60
|
+
* (prompt, script, dialog, etc.), applies postprocessing, checks expectations, and updates the execution report.
|
|
61
|
+
* Throws errors if execution fails after all attempts.
|
|
58
62
|
*
|
|
63
|
+
* @param options - The options for execution, including task, parameters, pipeline, and configuration.
|
|
64
|
+
* @returns The result string of the executed task.
|
|
59
65
|
* @private internal utility of `createPipelineExecutor`
|
|
60
66
|
*/
|
|
61
67
|
export declare function executeAttempts(options: ExecuteAttemptsOptions): Promise<TODO_string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EmbeddingVector } from '../EmbeddingVector';
|
|
2
|
+
/**
|
|
3
|
+
* Computes the cosine similarity between two embedding vectors
|
|
4
|
+
*
|
|
5
|
+
* Note: This is helping function for RAG (retrieval-augmented generation)
|
|
6
|
+
*
|
|
7
|
+
* @param embeddingVector1
|
|
8
|
+
* @param embeddingVector2
|
|
9
|
+
* @returns Cosine similarity between the two vectors
|
|
10
|
+
*
|
|
11
|
+
* @public exported from `@promptbook/core`
|
|
12
|
+
*/
|
|
13
|
+
export declare function computeCosineSimilarity(embeddingVector1: EmbeddingVector, embeddingVector2: EmbeddingVector): number;
|
|
@@ -3,30 +3,31 @@ import { PipelineExecutionError } from '../../errors/PipelineExecutionError';
|
|
|
3
3
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
4
4
|
import type { Parameters } from '../../types/typeAliases';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Options for filtering and extracting only output parameters from a pipeline execution.
|
|
7
7
|
*
|
|
8
8
|
* @private internal type of `createPipelineExecutor`
|
|
9
9
|
*/
|
|
10
10
|
type FilterJustOutputParametersOptions = {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* The fully prepared pipeline containing parameter definitions.
|
|
13
13
|
*/
|
|
14
14
|
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* The parameters passed to the pipeline, including both input and output values.
|
|
17
17
|
*/
|
|
18
18
|
readonly parametersToPass: Readonly<Parameters>;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Array to collect warnings encountered during parameter extraction.
|
|
21
21
|
*/
|
|
22
22
|
readonly $warnings: PipelineExecutionError[];
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* String identifier for the pipeline, used in warning messages.
|
|
25
25
|
*/
|
|
26
26
|
readonly pipelineIdentification: string;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Filters and returns only the output parameters from the provided pipeline execution options.
|
|
30
|
+
* Adds warnings for any expected output parameters that are missing.
|
|
30
31
|
*
|
|
31
32
|
* @private internal utility of `createPipelineExecutor`
|
|
32
33
|
*/
|
|
@@ -3,8 +3,12 @@ import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
|
3
3
|
import type { string_markdown } from '../../types/typeAliases';
|
|
4
4
|
import type { string_parameter_value } from '../../types/typeAliases';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Returns the context for a given task, typically used to provide additional information or variables
|
|
7
|
+
* required for the execution of the task within a pipeline. The context is returned as a string value
|
|
8
|
+
* that may include markdown formatting.
|
|
7
9
|
*
|
|
10
|
+
* @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
|
|
11
|
+
* @returns The context as a string, formatted as markdown and parameter value.
|
|
8
12
|
* @private internal utility of `createPipelineExecutor`
|
|
9
13
|
*/
|
|
10
14
|
export declare function getContextForTask(task: ReadonlyDeep<TaskJson>): Promise<string_parameter_value & string_markdown>;
|
|
@@ -3,7 +3,7 @@ import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
|
3
3
|
import type { string_markdown } from '../../types/typeAliases';
|
|
4
4
|
import type { string_parameter_value } from '../../types/typeAliases';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Retrieves example values or templates for a given task, used to guide or validate pipeline execution.
|
|
7
7
|
*
|
|
8
8
|
* @private internal utility of `createPipelineExecutor`
|
|
9
9
|
*/
|
|
@@ -1,27 +1,43 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
3
|
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
4
|
+
import type { Parameters } from '../../types/typeAliases';
|
|
4
5
|
import type { string_markdown } from '../../types/typeAliases';
|
|
5
6
|
import type { string_parameter_value } from '../../types/typeAliases';
|
|
7
|
+
import type { ExecutionTools } from '../ExecutionTools';
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
9
|
+
* Options for retrieving relevant knowledge for a specific task during pipeline execution.
|
|
8
10
|
*
|
|
9
|
-
* @private internal type of `
|
|
11
|
+
* @private internal type of `getKnowledgeForTask`
|
|
10
12
|
*/
|
|
11
13
|
type GetKnowledgeForTaskOptions = {
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* The execution tools to be used during the execution of the pipeline.
|
|
16
|
+
*/
|
|
17
|
+
readonly tools: ExecutionTools;
|
|
18
|
+
/**
|
|
19
|
+
* The fully prepared pipeline containing all tasks and knowledge pieces.
|
|
14
20
|
*/
|
|
15
21
|
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
16
22
|
/**
|
|
17
|
-
*
|
|
23
|
+
* The current task for which knowledge is being retrieved.
|
|
18
24
|
*/
|
|
19
25
|
readonly task: ReadonlyDeep<TaskJson>;
|
|
26
|
+
/**
|
|
27
|
+
* Parameters used to complete the content of the task for embedding and knowledge retrieval.
|
|
28
|
+
*/
|
|
29
|
+
readonly parameters: Readonly<Parameters>;
|
|
20
30
|
};
|
|
21
31
|
/**
|
|
22
|
-
*
|
|
32
|
+
* Retrieves the most relevant knowledge pieces for a given task using embedding-based similarity search.
|
|
33
|
+
* This is where retrieval-augmented generation (RAG) is performed to enhance the task with external knowledge.
|
|
23
34
|
*
|
|
24
35
|
* @private internal utility of `createPipelineExecutor`
|
|
25
36
|
*/
|
|
26
37
|
export declare function getKnowledgeForTask(options: GetKnowledgeForTaskOptions): Promise<string_parameter_value & string_markdown>;
|
|
27
38
|
export {};
|
|
39
|
+
/**
|
|
40
|
+
* TODO: !!!! Verify if this is working
|
|
41
|
+
* TODO: [♨] Implement Better - use keyword search
|
|
42
|
+
* TODO: [♨] Examples of values
|
|
43
|
+
*/
|
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
3
|
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
4
|
+
import type { Parameters } from '../../types/typeAliases';
|
|
4
5
|
import type { ReservedParameters } from '../../types/typeAliases';
|
|
6
|
+
import type { ExecutionTools } from '../ExecutionTools';
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
8
|
+
* Options for retrieving reserved parameters for a pipeline task, including context, pipeline, and identification.
|
|
7
9
|
*
|
|
8
10
|
* @private internal type of `getReservedParametersForTask`
|
|
9
11
|
*/
|
|
10
12
|
type GetReservedParametersForTaskOptions = {
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
14
|
+
* The execution tools to be used during the execution of the pipeline
|
|
15
|
+
*/
|
|
16
|
+
readonly tools: ExecutionTools;
|
|
17
|
+
/**
|
|
18
|
+
* The prepared and validated pipeline in which the task resides.
|
|
13
19
|
*/
|
|
14
20
|
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
15
21
|
/**
|
|
16
|
-
*
|
|
22
|
+
* The task for which reserved parameters are being retrieved.
|
|
17
23
|
*/
|
|
18
24
|
readonly task: ReadonlyDeep<TaskJson>;
|
|
19
25
|
/**
|
|
20
|
-
*
|
|
26
|
+
* Parameters to complete the content of the task for embedding and context.
|
|
27
|
+
*/
|
|
28
|
+
readonly parameters: Readonly<Parameters>;
|
|
29
|
+
/**
|
|
30
|
+
* String identifier for the pipeline, used in error messages and reporting.
|
|
21
31
|
*/
|
|
22
32
|
readonly pipelineIdentification: string;
|
|
23
33
|
};
|
|
24
34
|
/**
|
|
25
|
-
*
|
|
35
|
+
* Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
|
|
36
|
+
* Ensures all reserved parameters are defined and throws if any are missing.
|
|
37
|
+
*
|
|
38
|
+
* @param options - Options including tools, pipeline, task, and context.
|
|
39
|
+
* @returns An object containing all reserved parameters for the task.
|
|
26
40
|
*
|
|
27
41
|
* @private internal utility of `createPipelineExecutor`
|
|
28
42
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { KnowledgePiecePreparedJson } from '../../pipeline/PipelineJson/KnowledgePieceJson';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param knowledgePieces
|
|
5
|
+
* @returns
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `createPipelineExecutor`
|
|
8
|
+
*/
|
|
9
|
+
export declare function knowledgePiecesToString(knowledgePieces: ReadonlyArray<Pick<KnowledgePiecePreparedJson, 'content'>>): string;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { AutomaticTranslator } from './AutomaticTranslator';
|
|
2
2
|
import type { TranslatorOptions } from './TranslatorOptions';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Options for configuring the Lindat automatic translator, including API URL and language settings.
|
|
5
5
|
*/
|
|
6
6
|
type LindatAutomaticTranslatorOptions = TranslatorOptions & {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Optional URL of the Lindat translation API endpoint.
|
|
9
9
|
*/
|
|
10
10
|
readonly apiUrl?: URL;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Automatic translator implementation using the Lindat translation API.
|
|
14
14
|
*
|
|
15
|
-
* @private still in development [
|
|
15
|
+
* @private still in development [🏳️]
|
|
16
16
|
*/
|
|
17
17
|
export declare class LindatAutomaticTranslator implements AutomaticTranslator {
|
|
18
18
|
protected readonly options: LindatAutomaticTranslatorOptions;
|
|
@@ -24,6 +24,6 @@ export declare function checkExpectations(expectations: Expectations, value: str
|
|
|
24
24
|
export declare function isPassingExpectations(expectations: Expectations, value: string): boolean;
|
|
25
25
|
/**
|
|
26
26
|
* TODO: [💝] Unite object for expecting amount and format
|
|
27
|
-
* TODO: [🧠][🤠] This should be part of `
|
|
27
|
+
* TODO: [🧠][🤠] This should be part of `TextFormatParser`
|
|
28
28
|
* Note: [💝] and [🤠] are interconnected together
|
|
29
29
|
*/
|