@promptbook/markdown-utils 0.74.0-7 → 0.74.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 +3 -15
- package/esm/index.es.js +53 -30
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +5 -1
- package/esm/typings/src/_packages/utils.index.d.ts +4 -0
- package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
- package/esm/typings/src/cli/main.d.ts +4 -1
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
- package/esm/typings/src/cli/test/ptbk.d.ts +1 -1
- package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
- package/esm/typings/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -2
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +3 -3
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -2
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +2 -2
- package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +7 -7
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +1 -1
- package/esm/typings/src/storage/blackhole/BlackholeStorage.d.ts +33 -0
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +1 -1
- package/esm/typings/src/storage/{memory/utils → utils}/PrefixStorage.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +6 -4
- package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -1
- package/esm/typings/src/types/Prompt.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +2 -2
- package/esm/typings/src/utils/expectation-counters/config.d.ts +12 -0
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +2 -0
- package/package.json +1 -1
- package/umd/index.umd.js +53 -30
- package/umd/index.umd.js.map +1 -1
- /package/esm/typings/src/storage/{memory → local-storage}/utils/makePromptbookStorageFromWebStorage.d.ts +0 -0
|
@@ -7,6 +7,7 @@ import { createSubcollection } from '../collection/constructors/createSubcollect
|
|
|
7
7
|
import type { TemplateType } from '../commands/TEMPLATE/TemplateTypes';
|
|
8
8
|
import { TemplateTypes } from '../commands/TEMPLATE/TemplateTypes';
|
|
9
9
|
import { CLAIM } from '../config';
|
|
10
|
+
import { DEFAULT_TITLE } from '../config';
|
|
10
11
|
import { MAX_FILENAME_LENGTH } from '../config';
|
|
11
12
|
import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
|
|
12
13
|
import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
|
|
@@ -84,8 +85,9 @@ import { _DocumentScraperMetadataRegistration } from '../scrapers/document/regis
|
|
|
84
85
|
import { _MarkdownScraperMetadataRegistration } from '../scrapers/markdown/register-metadata';
|
|
85
86
|
import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
|
|
86
87
|
import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
|
|
88
|
+
import { BlackholeStorage } from '../storage/blackhole/BlackholeStorage';
|
|
87
89
|
import { MemoryStorage } from '../storage/memory/MemoryStorage';
|
|
88
|
-
import { PrefixStorage } from '../storage/
|
|
90
|
+
import { PrefixStorage } from '../storage/utils/PrefixStorage';
|
|
89
91
|
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
90
92
|
import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
|
|
91
93
|
import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
@@ -100,6 +102,7 @@ export { createSubcollection };
|
|
|
100
102
|
export type { TemplateType };
|
|
101
103
|
export { TemplateTypes };
|
|
102
104
|
export { CLAIM };
|
|
105
|
+
export { DEFAULT_TITLE };
|
|
103
106
|
export { MAX_FILENAME_LENGTH };
|
|
104
107
|
export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
|
|
105
108
|
export { DEFAULT_MAX_PARALLEL_COUNT };
|
|
@@ -177,6 +180,7 @@ export { _DocumentScraperMetadataRegistration };
|
|
|
177
180
|
export { _MarkdownScraperMetadataRegistration };
|
|
178
181
|
export { _PdfScraperMetadataRegistration };
|
|
179
182
|
export { _WebsiteScraperMetadataRegistration };
|
|
183
|
+
export { BlackholeStorage };
|
|
180
184
|
export { MemoryStorage };
|
|
181
185
|
export { PrefixStorage };
|
|
182
186
|
export { executionReportJsonToString };
|
|
@@ -12,6 +12,8 @@ import { $currentDate } from '../utils/$currentDate';
|
|
|
12
12
|
import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
|
|
13
13
|
import { $isRunningInNode } from '../utils/environment/$isRunningInNode';
|
|
14
14
|
import { $isRunningInWebWorker } from '../utils/environment/$isRunningInWebWorker';
|
|
15
|
+
import { CHARACTERS_PER_STANDARD_LINE } from '../utils/expectation-counters/config';
|
|
16
|
+
import { LINES_PER_STANDARD_PAGE } from '../utils/expectation-counters/config';
|
|
15
17
|
import { countCharacters } from '../utils/expectation-counters/countCharacters';
|
|
16
18
|
import { countLines } from '../utils/expectation-counters/countLines';
|
|
17
19
|
import { countPages } from '../utils/expectation-counters/countPages';
|
|
@@ -83,6 +85,8 @@ export { $currentDate };
|
|
|
83
85
|
export { $isRunningInBrowser };
|
|
84
86
|
export { $isRunningInNode };
|
|
85
87
|
export { $isRunningInWebWorker };
|
|
88
|
+
export { CHARACTERS_PER_STANDARD_LINE };
|
|
89
|
+
export { LINES_PER_STANDARD_PAGE };
|
|
86
90
|
export { countCharacters };
|
|
87
91
|
export { countLines };
|
|
88
92
|
export { countPages };
|
|
@@ -6,7 +6,7 @@ import type { Command as Program } from 'commander';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function initializeRunCommand(program: Program): void;
|
|
8
8
|
/**
|
|
9
|
-
* TODO:
|
|
9
|
+
* TODO: !!!!! Catch and wrap all errors from CLI
|
|
10
10
|
* TODO: [🧠] Pass `maxExecutionAttempts`, `csvSettings`
|
|
11
11
|
* TODO: [🥃][main] !!! Allow `ptbk run` without configuring any llm tools
|
|
12
12
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { promptbookCli } from './promptbookCli';
|
|
2
|
+
/**
|
|
3
|
+
* Note: [🔺] Purpose of this file is to export CLI for production environment
|
|
4
|
+
*/
|
|
2
5
|
/**
|
|
3
6
|
* Hidden utilities which should not be used by external consumers.
|
|
4
7
|
*
|
|
5
8
|
* @public exported from `@promptbook/cli`
|
|
6
9
|
*/
|
|
7
10
|
export declare const _CLI: {
|
|
8
|
-
|
|
11
|
+
_initialize_promptbookCli: typeof promptbookCli;
|
|
9
12
|
};
|
|
10
13
|
/**
|
|
11
14
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function promptbookCli(): Promise<void>;
|
|
7
7
|
/**
|
|
8
|
-
* TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.
|
|
8
|
+
* TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book.md` -> `ptbk ./foo.book.md`
|
|
9
9
|
* TODO: [🥠] Do not export, its just for CLI script
|
|
10
10
|
* TODO: [🕌] When more functionalities, rename
|
|
11
11
|
* Note: 11:11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export {};
|
|
2
2
|
/**
|
|
3
|
-
* Note: [🐠] For example here URL https://example.com/pipeline.
|
|
3
|
+
* Note: [🐠] For example here URL https://example.com/pipeline.book.md is not valid
|
|
4
4
|
* because it is on private network BUT its very hard to debug because
|
|
5
5
|
* there is no error message and false return (the error) happen deep in:
|
|
6
6
|
* `isValidPipelineUrl` -> `isValidPipelineUrl` -> `isUrlOnPrivateNetwork`
|
|
@@ -5,7 +5,7 @@ import type { PipelineCollection } from '../PipelineCollection';
|
|
|
5
5
|
/**
|
|
6
6
|
* Options for `createCollectionFromDirectory` function
|
|
7
7
|
*
|
|
8
|
-
* Note: `rootDirname` is not needed because it is the folder in which `.
|
|
8
|
+
* Note: `rootDirname` is not needed because it is the folder in which `.book.md` file is located
|
|
9
9
|
* This is not same as `path` which is the first argument of `createCollectionFromDirectory` - it can be a subfolder
|
|
10
10
|
*/
|
|
11
11
|
type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions, 'rootDirname'> & {
|
|
@@ -3,12 +3,12 @@ import type { ForeachCommand } from './ForeachCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the foreach command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.
|
|
6
|
+
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book.md` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @private within the commands folder
|
|
10
10
|
*/
|
|
11
11
|
export declare const foreachCommandParser: PipelineTemplateCommandParser<ForeachCommand>;
|
|
12
12
|
/**
|
|
13
|
-
* TODO: [🍭] Make .
|
|
13
|
+
* TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
|
|
14
14
|
*/
|
|
@@ -3,7 +3,7 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the boilerplate command
|
|
5
5
|
*
|
|
6
|
-
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.
|
|
6
|
+
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book.md` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @private within the commands folder
|
|
@@ -14,6 +14,12 @@ export declare const GENERATOR_WARNING = "\u26A0\uFE0F WARNING: This code has be
|
|
|
14
14
|
* @public exported from `@promptbook/core`
|
|
15
15
|
*/
|
|
16
16
|
export declare const CLAIM = "Build responsible, controlled and transparent applications on top of LLM models!";
|
|
17
|
+
/**
|
|
18
|
+
* When the title is not provided, the default title is used
|
|
19
|
+
*
|
|
20
|
+
* @public exported from `@promptbook/core`
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEFAULT_TITLE = "Untitled";
|
|
17
23
|
/**
|
|
18
24
|
* Warning message for the generated sections and files files
|
|
19
25
|
*
|
|
@@ -3,8 +3,8 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
3
3
|
/**
|
|
4
4
|
* Converts promptbook in JSON format to string format
|
|
5
5
|
*
|
|
6
|
-
* @param pipelineJson Promptbook in JSON format (.
|
|
7
|
-
* @returns Promptbook in string format (.
|
|
6
|
+
* @param pipelineJson Promptbook in JSON format (.book.json)
|
|
7
|
+
* @returns Promptbook in string format (.book.md)
|
|
8
8
|
* @public exported from `@promptbook/core`
|
|
9
9
|
*/
|
|
10
10
|
export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
|
|
@@ -13,5 +13,5 @@ export declare function pipelineJsonToString(pipelineJson: PipelineJson): Pipeli
|
|
|
13
13
|
* TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
|
|
14
14
|
* TODO: [🏛] Maybe make some markdown builder
|
|
15
15
|
* TODO: [🏛] Escape all
|
|
16
|
-
* TODO: [🧠] Should be in generated .
|
|
16
|
+
* TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
|
|
17
17
|
*/
|
|
@@ -13,10 +13,10 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
13
13
|
* Note: This function does not validate logic of the pipeline only the parsing
|
|
14
14
|
* Note: This function acts as compilation process
|
|
15
15
|
*
|
|
16
|
-
* @param pipelineString {Promptbook} in string markdown format (.
|
|
16
|
+
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
17
17
|
* @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
|
|
18
18
|
* @param options - Options and tools for the compilation
|
|
19
|
-
* @returns {Promptbook} compiled in JSON format (.
|
|
19
|
+
* @returns {Promptbook} compiled in JSON format (.book.json)
|
|
20
20
|
* @throws {ParseError} if the promptbook string is not valid
|
|
21
21
|
* @public exported from `@promptbook/core`
|
|
22
22
|
*/
|
|
@@ -11,8 +11,8 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
11
11
|
* Note: This function does not validate logic of the pipeline only the parsing
|
|
12
12
|
* Note: This function acts as compilation process
|
|
13
13
|
*
|
|
14
|
-
* @param pipelineString {Promptbook} in string markdown format (.
|
|
15
|
-
* @returns {Promptbook} compiled in JSON format (.
|
|
14
|
+
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
15
|
+
* @returns {Promptbook} compiled in JSON format (.book.json)
|
|
16
16
|
* @throws {ParseError} if the promptbook string is not valid
|
|
17
17
|
* @public exported from `@promptbook/core`
|
|
18
18
|
*/
|
|
@@ -9,7 +9,7 @@ import type { string_json } from '../../types/typeAliases';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
|
|
11
11
|
/**
|
|
12
|
-
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.
|
|
12
|
+
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book.md
|
|
13
13
|
* TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
|
|
14
14
|
* TODO: [🧠] Maybe more elegant solution than replacing via regex
|
|
15
15
|
* TODO: [🍙] Make some standard order of json properties
|
|
@@ -2,7 +2,7 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
|
2
2
|
import type { PipelineString } from '../../types/PipelineString';
|
|
3
3
|
import type { string_json } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
|
-
* Import the pipeline.
|
|
5
|
+
* Import the pipeline.book.md or pipeline.book.json file
|
|
6
6
|
*
|
|
7
7
|
* Note: Using here custom import to work in jest tests
|
|
8
8
|
* Note: Using sync version is 💩 in the production code, but it's ok here in tests
|
|
@@ -10,20 +10,20 @@ import type { string_json } from '../../types/typeAliases';
|
|
|
10
10
|
* @param path - The path to the file relative to examples/pipelines directory
|
|
11
11
|
* @private internal function of tests
|
|
12
12
|
*/
|
|
13
|
-
export declare function importPipelineWithoutPreparation(path: `${string}.
|
|
14
|
-
export declare function importPipelineWithoutPreparation(path: `${string}.
|
|
13
|
+
export declare function importPipelineWithoutPreparation(path: `${string}.book.md`): PipelineString;
|
|
14
|
+
export declare function importPipelineWithoutPreparation(path: `${string}.book.json`): PipelineJson;
|
|
15
15
|
/**
|
|
16
|
-
* Import the pipeline.
|
|
16
|
+
* Import the pipeline.book.json file as parsed JSON
|
|
17
17
|
*
|
|
18
18
|
* @private internal function of tests
|
|
19
19
|
*/
|
|
20
|
-
export declare function importPipelineJson(path: `${string}.
|
|
20
|
+
export declare function importPipelineJson(path: `${string}.book.json`): PipelineJson;
|
|
21
21
|
/**
|
|
22
|
-
* Import the pipeline.
|
|
22
|
+
* Import the pipeline.book.json file as string
|
|
23
23
|
*
|
|
24
24
|
* @private internal function of tests
|
|
25
25
|
*/
|
|
26
|
-
export declare function importPipelineJsonAsString(path: `${string}.
|
|
26
|
+
export declare function importPipelineJsonAsString(path: `${string}.book.json`): string_json<PipelineJson>;
|
|
27
27
|
/**
|
|
28
28
|
* Note: [⚫] Code in this file should never be published in any package
|
|
29
29
|
*/
|
|
@@ -13,7 +13,7 @@ import type { FormatSubvalueDefinition } from './FormatSubvalueDefinition';
|
|
|
13
13
|
*/
|
|
14
14
|
export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends string, TSettings extends empty_object, TSchema extends empty_object> = {
|
|
15
15
|
/**
|
|
16
|
-
* The name of the format used in .
|
|
16
|
+
* The name of the format used in .book.md files
|
|
17
17
|
*
|
|
18
18
|
* @example "JSON"
|
|
19
19
|
*/
|
|
@@ -9,7 +9,7 @@ import type { empty_object } from '../../utils/organization/empty_object';
|
|
|
9
9
|
*/
|
|
10
10
|
export type FormatSubvalueDefinition<TValue extends string, TSettings extends empty_object> = {
|
|
11
11
|
/**
|
|
12
|
-
* The name of the format used in .
|
|
12
|
+
* The name of the format used in .book.md files
|
|
13
13
|
*
|
|
14
14
|
* @example "CELL"
|
|
15
15
|
*/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
2
|
+
/**
|
|
3
|
+
* Behaves like a storage but forgets everything you put in it
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
6
|
+
*/
|
|
7
|
+
export declare class BlackholeStorage<TItem> implements PromptbookStorage<TItem> {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the number of key/value pairs currently present in the list associated with the object.
|
|
10
|
+
*/
|
|
11
|
+
get length(): number;
|
|
12
|
+
/**
|
|
13
|
+
* Empties the list associated with the object of all key/value pairs, if there are any.
|
|
14
|
+
*/
|
|
15
|
+
clear(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
|
|
18
|
+
* @param key
|
|
19
|
+
*/
|
|
20
|
+
getItem(key: string): null;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
|
|
23
|
+
*/
|
|
24
|
+
key(index: number): null;
|
|
25
|
+
/**
|
|
26
|
+
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
|
27
|
+
*/
|
|
28
|
+
setItem(key: string, value: TItem): void;
|
|
29
|
+
/**
|
|
30
|
+
* Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
|
|
31
|
+
*/
|
|
32
|
+
removeItem(key: string): void;
|
|
33
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
|
-
import type { PromptbookStorage } from '
|
|
2
|
+
import type { PromptbookStorage } from '../_common/PromptbookStorage';
|
|
3
3
|
/**
|
|
4
4
|
* This class behaves like LocalStorage but separates keys by prefix
|
|
5
5
|
*
|
|
@@ -26,12 +26,12 @@ export type PipelineJson = {
|
|
|
26
26
|
* Note: It must be unique across all pipeline collections
|
|
27
27
|
* Note: It must use HTTPs URL
|
|
28
28
|
* Tip: You can do versioning in the URL
|
|
29
|
-
* For example: https://promptbook.studio/webgpt/write-website-content-cs.
|
|
29
|
+
* For example: https://promptbook.studio/webgpt/write-website-content-cs.book.md@1.0.0
|
|
30
30
|
* Warning: Do not hash part of the URL, hash part is used for identification of the template in the pipeline
|
|
31
31
|
*/
|
|
32
32
|
readonly pipelineUrl?: string_pipeline_url;
|
|
33
33
|
/**
|
|
34
|
-
* Internal helper for tracking the source `.
|
|
34
|
+
* Internal helper for tracking the source `.book.md` file of the pipeline
|
|
35
35
|
*/
|
|
36
36
|
readonly sourceFile?: string_filename;
|
|
37
37
|
/**
|
|
@@ -40,9 +40,11 @@ export type PipelineJson = {
|
|
|
40
40
|
*/
|
|
41
41
|
readonly title: string_markdown_text;
|
|
42
42
|
/**
|
|
43
|
-
* Version of the
|
|
43
|
+
* Version of the Book language
|
|
44
|
+
*
|
|
45
|
+
* @see https://github.com/webgptorg/book
|
|
44
46
|
*/
|
|
45
|
-
readonly
|
|
47
|
+
readonly bookVersion?: string_semantic_version;
|
|
46
48
|
/**
|
|
47
49
|
* Description of the promptbook
|
|
48
50
|
* It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
|
|
@@ -18,5 +18,5 @@ export type PreparationJson = {
|
|
|
18
18
|
/**
|
|
19
19
|
* TODO: [🍙] Make some standard order of json properties
|
|
20
20
|
* TODO: Maybe put here used `modelName`
|
|
21
|
-
* TODO: [🍥] When using `date` it changes all examples .
|
|
21
|
+
* TODO: [🍥] When using `date` it changes all examples .book.json files each time so until some more elegant solution omit the time from prepared pipeline
|
|
22
22
|
*/
|
|
@@ -95,7 +95,7 @@ export type CommonPrompt = {
|
|
|
95
95
|
/**
|
|
96
96
|
* Unique identifier of the pipeline with specific template name as hash
|
|
97
97
|
*
|
|
98
|
-
* @example https://promptbook.studio/webgpt/write-website-content-cs.
|
|
98
|
+
* @example https://promptbook.studio/webgpt/write-website-content-cs.book.md#keywords
|
|
99
99
|
*/
|
|
100
100
|
readonly pipelineUrl?: string_pipeline_url_with_hashtemplate;
|
|
101
101
|
/**
|
|
@@ -298,13 +298,13 @@ export type string_base_url = string;
|
|
|
298
298
|
/**
|
|
299
299
|
* Semantic helper
|
|
300
300
|
*
|
|
301
|
-
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.
|
|
301
|
+
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book.md"`
|
|
302
302
|
*/
|
|
303
303
|
export type string_pipeline_url = string;
|
|
304
304
|
/**
|
|
305
305
|
* Semantic helper
|
|
306
306
|
*
|
|
307
|
-
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.
|
|
307
|
+
* For example `"https://promptbook.studio/webgpt/write-website-content-cs.book.md#keywords"`
|
|
308
308
|
*/
|
|
309
309
|
export type string_pipeline_url_with_hashtemplate = string;
|
|
310
310
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number of characters per standard line with 11pt Arial font size.
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/utils`
|
|
5
|
+
*/
|
|
6
|
+
export declare const CHARACTERS_PER_STANDARD_LINE = 63;
|
|
7
|
+
/**
|
|
8
|
+
* Number of lines per standard A4 page with 11pt Arial font size and standard margins and spacing.
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/utils`
|
|
11
|
+
*/
|
|
12
|
+
export declare const LINES_PER_STANDARD_PAGE = 44;
|
|
@@ -2,6 +2,8 @@ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
|
|
|
2
2
|
/**
|
|
3
3
|
* Counts number of lines in the text
|
|
4
4
|
*
|
|
5
|
+
* Note: This does not check only for the presence of newlines, but also for the length of the standard line.
|
|
6
|
+
*
|
|
5
7
|
* @public exported from `@promptbook/utils`
|
|
6
8
|
*/
|
|
7
9
|
export declare function countLines(text: string): ExpectationAmount;
|
|
@@ -2,6 +2,8 @@ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
|
|
|
2
2
|
/**
|
|
3
3
|
* Counts number of pages in the text
|
|
4
4
|
*
|
|
5
|
+
* Note: This does not check only for the count of newlines, but also for the length of the standard line and length of the standard page.
|
|
6
|
+
*
|
|
5
7
|
* @public exported from `@promptbook/utils`
|
|
6
8
|
*/
|
|
7
9
|
export declare function countPages(text: string): ExpectationAmount;
|