@promptbook/markdown-utils 0.80.0-0 → 0.80.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 +0 -4
- package/esm/index.es.js +2 -1
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +4 -4
- package/esm/typings/src/_packages/types.index.d.ts +0 -4
- package/esm/typings/src/commands/_common/getParserForCommand.d.ts +1 -1
- package/esm/typings/src/commands/_common/parseCommand.d.ts +1 -1
- package/esm/typings/src/commands/_common/stringifyCommand.d.ts +1 -1
- package/esm/typings/src/conversion/{pipelineStringToJson.d.ts → compilePipeline.d.ts} +3 -3
- package/esm/typings/src/conversion/{pipelineStringToJsonSync.d.ts → precompilePipeline.d.ts} +3 -3
- package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
- package/esm/typings/src/high-level-abstractions/index.d.ts +1 -1
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +1 -0
- package/package.json +1 -1
- package/umd/index.umd.js +2 -1
- package/umd/index.umd.js.map +1 -1
- /package/esm/typings/src/conversion/{pipelineStringToJson.test.d.ts → compilePipeline.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/{pipelineStringToJsonSync.test.d.ts → precompilePipeline.test.d.ts} +0 -0
|
@@ -29,9 +29,9 @@ import { SET_IS_VERBOSE } from '../config';
|
|
|
29
29
|
import { DEFAULT_IS_AUTO_INSTALLED } from '../config';
|
|
30
30
|
import { ORDER_OF_PIPELINE_JSON } from '../constants';
|
|
31
31
|
import { RESERVED_PARAMETER_NAMES } from '../constants';
|
|
32
|
+
import { compilePipeline } from '../conversion/compilePipeline';
|
|
32
33
|
import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
|
|
33
|
-
import {
|
|
34
|
-
import { pipelineStringToJsonSync } from '../conversion/pipelineStringToJsonSync';
|
|
34
|
+
import { precompilePipeline } from '../conversion/precompilePipeline';
|
|
35
35
|
import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
|
|
36
36
|
import { extractParameterNamesFromTask } from '../conversion/utils/extractParameterNamesFromTask';
|
|
37
37
|
import { removePipelineCommand } from '../conversion/utils/removePipelineCommand';
|
|
@@ -150,9 +150,9 @@ export { SET_IS_VERBOSE };
|
|
|
150
150
|
export { DEFAULT_IS_AUTO_INSTALLED };
|
|
151
151
|
export { ORDER_OF_PIPELINE_JSON };
|
|
152
152
|
export { RESERVED_PARAMETER_NAMES };
|
|
153
|
+
export { compilePipeline };
|
|
153
154
|
export { pipelineJsonToString };
|
|
154
|
-
export {
|
|
155
|
-
export { pipelineStringToJsonSync };
|
|
155
|
+
export { precompilePipeline };
|
|
156
156
|
export { prettifyPipelineString };
|
|
157
157
|
export { extractParameterNamesFromTask };
|
|
158
158
|
export { removePipelineCommand };
|
|
@@ -46,8 +46,6 @@ import type { CsvSettings } from '../formats/csv/CsvSettings';
|
|
|
46
46
|
import type { AbstractFormfactorDefinition } from '../formfactors/_common/AbstractFormfactorDefinition';
|
|
47
47
|
import type { FormfactorDefinition } from '../formfactors/_common/FormfactorDefinition';
|
|
48
48
|
import type { string_formfactor_name } from '../formfactors/_common/string_formfactor_name';
|
|
49
|
-
import type { AsyncHighLevelAbstraction } from '../high-level-abstractions/_common/HighLevelAbstraction';
|
|
50
|
-
import type { CommonHighLevelAbstraction } from '../high-level-abstractions/_common/HighLevelAbstraction';
|
|
51
49
|
import type { LlmToolsConfiguration } from '../llm-providers/_common/register/LlmToolsConfiguration';
|
|
52
50
|
import type { LlmToolsMetadata } from '../llm-providers/_common/register/LlmToolsMetadata';
|
|
53
51
|
import type { LlmToolsOptions } from '../llm-providers/_common/register/LlmToolsOptions';
|
|
@@ -310,8 +308,6 @@ export type { CsvSettings };
|
|
|
310
308
|
export type { AbstractFormfactorDefinition };
|
|
311
309
|
export type { FormfactorDefinition };
|
|
312
310
|
export type { string_formfactor_name };
|
|
313
|
-
export type { AsyncHighLevelAbstraction };
|
|
314
|
-
export type { CommonHighLevelAbstraction };
|
|
315
311
|
export type { LlmToolsConfiguration };
|
|
316
312
|
export type { LlmToolsMetadata };
|
|
317
313
|
export type { LlmToolsOptions };
|
|
@@ -6,6 +6,6 @@ import type { CommandParser } from './types/CommandParser';
|
|
|
6
6
|
* @returns the parser for the command
|
|
7
7
|
* @throws {UnexpectedError} if the parser is not found
|
|
8
8
|
*
|
|
9
|
-
* @private within the
|
|
9
|
+
* @private within the compilePipeline
|
|
10
10
|
*/
|
|
11
11
|
export declare function getParserForCommand<TCommand extends Command>(command: TCommand): CommandParser<TCommand>;
|
|
@@ -7,6 +7,6 @@ import type { CommandUsagePlace } from './types/CommandUsagePlaces';
|
|
|
7
7
|
* @returns parsed command object
|
|
8
8
|
* @throws {ParseError} if the command is invalid
|
|
9
9
|
*
|
|
10
|
-
* @private within the
|
|
10
|
+
* @private within the compilePipeline
|
|
11
11
|
*/
|
|
12
12
|
export declare function parseCommand(raw: string_markdown_text, usagePlace: CommandUsagePlace): Command;
|
|
@@ -6,6 +6,6 @@ import type { Command } from './types/Command';
|
|
|
6
6
|
* @returns stringified command
|
|
7
7
|
* @throws {UnexpectedError} if the command is invalid
|
|
8
8
|
*
|
|
9
|
-
* @private within the
|
|
9
|
+
* @private within the compilePipeline
|
|
10
10
|
*/
|
|
11
11
|
export declare function stringifyCommand(command: Command): string_markdown_text;
|
|
@@ -6,8 +6,8 @@ import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions
|
|
|
6
6
|
* Compile pipeline from string (markdown) format to JSON format
|
|
7
7
|
*
|
|
8
8
|
* Note: There are 3 similar functions:
|
|
9
|
-
* - `
|
|
10
|
-
* - `
|
|
9
|
+
* - `compilePipeline` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
10
|
+
* - `precompilePipeline` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
11
11
|
* - `preparePipeline` - just one step in the compilation process
|
|
12
12
|
*
|
|
13
13
|
* Note: This function does not validate logic of the pipeline only the parsing
|
|
@@ -20,7 +20,7 @@ import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions
|
|
|
20
20
|
* @throws {ParseError} if the promptbook string is not valid
|
|
21
21
|
* @public exported from `@promptbook/core`
|
|
22
22
|
*/
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function compilePipeline(pipelineString: PipelineString, tools?: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options?: PrepareAndScrapeOptions): Promise<PipelineJson>;
|
|
24
24
|
/**
|
|
25
25
|
* TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
26
26
|
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
package/esm/typings/src/conversion/{pipelineStringToJsonSync.d.ts → precompilePipeline.d.ts}
RENAMED
|
@@ -4,8 +4,8 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
4
4
|
* Compile pipeline from string (markdown) format to JSON format synchronously
|
|
5
5
|
*
|
|
6
6
|
* Note: There are 3 similar functions:
|
|
7
|
-
* - `
|
|
8
|
-
* - `
|
|
7
|
+
* - `compilePipeline` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
|
|
8
|
+
* - `precompilePipeline` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
|
|
9
9
|
* - `preparePipeline` - just one step in the compilation process
|
|
10
10
|
*
|
|
11
11
|
* Note: This function does not validate logic of the pipeline only the parsing
|
|
@@ -16,7 +16,7 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
16
16
|
* @throws {ParseError} if the promptbook string is not valid
|
|
17
17
|
* @public exported from `@promptbook/core`
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function precompilePipeline(pipelineString: PipelineString): PipelineJson;
|
|
20
20
|
/**
|
|
21
21
|
* TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
|
|
22
22
|
* TODO: [main] !!!! Warn if used only sync version
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* All high-level abstractions
|
|
3
3
|
*
|
|
4
|
-
* @private internal index of `
|
|
4
|
+
* @private internal index of `precompilePipeline` (= used for sync) and `preparePipeline` (= used for async)
|
|
5
5
|
*/
|
|
6
6
|
export declare const HIGH_LEVEL_ABSTRACTIONS: readonly [{
|
|
7
7
|
type: "SYNC";
|
|
@@ -2,6 +2,7 @@ import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
|
2
2
|
/**
|
|
3
3
|
* Unprepare just strips the preparation data of the pipeline
|
|
4
4
|
*
|
|
5
|
+
* @deprecated In future version this function will be removed or deprecated
|
|
5
6
|
* @public exported from `@promptbook/core`
|
|
6
7
|
*/
|
|
7
8
|
export declare function unpreparePipeline(pipeline: PipelineJson): PipelineJson;
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
25
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.80.0-1';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1574,6 +1574,7 @@
|
|
|
1574
1574
|
/**
|
|
1575
1575
|
* Unprepare just strips the preparation data of the pipeline
|
|
1576
1576
|
*
|
|
1577
|
+
* @deprecated In future version this function will be removed or deprecated
|
|
1577
1578
|
* @public exported from `@promptbook/core`
|
|
1578
1579
|
*/
|
|
1579
1580
|
function unpreparePipeline(pipeline) {
|