@promptbook/node 0.61.0-24 → 0.61.0-26

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.
Files changed (24) hide show
  1. package/README.md +3 -3
  2. package/esm/index.es.js +179 -135
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/utils.index.d.ts +4 -4
  5. package/esm/typings/src/config.d.ts +5 -1
  6. package/esm/typings/src/conversion/utils/{extractParametersFromPromptTemplate.d.ts → extractParameterNamesFromPromptTemplate.d.ts} +1 -1
  7. package/esm/typings/src/execution/createPipelineExecutor.d.ts +2 -0
  8. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  9. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -1
  10. package/esm/typings/src/utils/{extractParameters.d.ts → extractParameterNames.d.ts} +4 -1
  11. package/package.json +2 -2
  12. package/umd/index.umd.js +179 -135
  13. package/umd/index.umd.js.map +1 -1
  14. package/umd/typings/src/_packages/utils.index.d.ts +4 -4
  15. package/umd/typings/src/config.d.ts +5 -1
  16. package/umd/typings/src/conversion/utils/{extractParametersFromPromptTemplate.d.ts → extractParameterNamesFromPromptTemplate.d.ts} +1 -1
  17. package/umd/typings/src/execution/createPipelineExecutor.d.ts +2 -0
  18. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  19. package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -1
  20. package/umd/typings/src/utils/{extractParameters.d.ts → extractParameterNames.d.ts} +4 -1
  21. /package/esm/typings/src/conversion/utils/{extractParametersFromPromptTemplate.test.d.ts → extractParameterNamesFromPromptTemplate.test.d.ts} +0 -0
  22. /package/esm/typings/src/utils/{extractParameters.test.d.ts → extractParameterNames.test.d.ts} +0 -0
  23. /package/umd/typings/src/conversion/utils/{extractParametersFromPromptTemplate.test.d.ts → extractParameterNamesFromPromptTemplate.test.d.ts} +0 -0
  24. /package/umd/typings/src/utils/{extractParameters.test.d.ts → extractParameterNames.test.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { spaceTrim } from 'spacetrim';
2
2
  import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
3
- import { extractParametersFromPromptTemplate } from '../conversion/utils/extractParametersFromPromptTemplate';
3
+ import { extractParameterNamesFromPromptTemplate } from '../conversion/utils/extractParameterNamesFromPromptTemplate';
4
4
  import { extractVariables } from '../conversion/utils/extractVariables';
5
5
  import { renameParameter } from '../conversion/utils/renameParameter';
6
6
  import { titleToName } from '../conversion/utils/titleToName';
@@ -15,7 +15,7 @@ import { countParagraphs } from '../utils/expectation-counters/countParagraphs';
15
15
  import { countSentences, splitIntoSentences } from '../utils/expectation-counters/countSentences';
16
16
  import { countWords } from '../utils/expectation-counters/countWords';
17
17
  import { CountUtils } from '../utils/expectation-counters/index';
18
- import { extractParameters } from '../utils/extractParameters';
18
+ import { extractParameterNames } from '../utils/extractParameterNames';
19
19
  import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
20
20
  import type { IKeywords, string_keyword } from '../utils/normalization/IKeywords';
21
21
  import { capitalize } from '../utils/normalization/capitalize';
@@ -55,7 +55,7 @@ import { isValidUrl } from '../utils/validators/url/isValidUrl';
55
55
  import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
56
56
  import { PROMPTBOOK_VERSION } from '../version';
57
57
  export { forEachAsync, PROMPTBOOK_VERSION };
58
- export { extractParameters, extractVariables, replaceParameters, spaceTrim };
58
+ export { extractParameterNames, extractVariables, replaceParameters, spaceTrim };
59
59
  export { $currentDate, $randomSeed, extractBlock, // <- [🌻] + maybe export through `@promptbook/markdown-utils`
60
60
  isHostnameOnPrivateNetwork, isUrlOnPrivateNetwork, isValidFilePath, isValidJavascriptName, isValidJsonString, isValidPipelineUrl, isValidPromptbookVersion, isValidSemanticVersion, isValidUrl, isValidUuid, parseNumber, // <- [🌻]
61
61
  removeEmojis, removeQuotes, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
@@ -70,7 +70,7 @@ export declare const normalizeTo: {
70
70
  };
71
71
  export { capitalize, decapitalize, DIACRITIC_VARIANTS_LETTERS, IKeywords, isValidKeyword, nameToUriPart, nameToUriParts, normalizeTo_camelCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_snake_case, normalizeToKebabCase, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, titleToName, };
72
72
  export type { string_camelCase, string_kebab_case, string_PascalCase, string_SCREAMING_CASE, string_snake_case };
73
- export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
73
+ export { extractParameterNamesFromPromptTemplate, renameParameter, renderPromptbookMermaid };
74
74
  export { difference, intersection, union };
75
75
  /**
76
76
  * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
@@ -43,11 +43,15 @@ export declare const REPLACING_NONCE = "u$k42k%!V2zo34w7Fu#@QUHYPW";
43
43
  /**
44
44
  * The names of the parameters that are reserved for special purposes
45
45
  */
46
- export declare const RESERVED_PARAMETER_NAMES: readonly ["context", "knowledge", "samples", "modelName", "currentDate"];
46
+ export declare const RESERVED_PARAMETER_NAMES: readonly ["content", "context", "knowledge", "samples", "modelName", "currentDate"];
47
47
  /**
48
48
  * @@@
49
49
  */
50
50
  export declare const RESERVED_PARAMETER_MISSING_VALUE: string;
51
+ /**
52
+ * @@@
53
+ */
54
+ export declare const RESERVED_PARAMETER_RESTRICTED: string;
51
55
  /**
52
56
  * @@@
53
57
  */
@@ -7,7 +7,7 @@ import type { string_parameter_name } from '../../types/typeAliases';
7
7
  * @returns the set of parameter names
8
8
  * @throws {ParsingError} if the script is invalid
9
9
  */
10
- export declare function extractParametersFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | 'blockType' | 'content' | 'jokerParameterNames'>): Set<string_parameter_name>;
10
+ export declare function extractParameterNamesFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | 'blockType' | 'content' | 'preparedContent' | 'jokerParameterNames'>): Set<string_parameter_name>;
11
11
  /**
12
12
  * TODO: [🔣] If script require contentLanguage
13
13
  */
@@ -47,6 +47,8 @@ interface CreatePipelineExecutorOptions {
47
47
  export declare function createPipelineExecutor(options: CreatePipelineExecutorOptions): PipelineExecutor;
48
48
  export {};
49
49
  /**
50
+ * TODO: !!!! return `preparedPipeline` from execution
51
+ * TODO: !!!! `isNotPreparedWarningSupressed`
50
52
  * TODO: Use isVerbose here (not only pass to `preparePipeline`)
51
53
  * TODO: [🪂] Use maxParallelCount here (not only pass to `preparePipeline`)
52
54
  * TODO: [♈] Probbably move expectations from templates to parameters
@@ -4,7 +4,7 @@ import type { string_markdown } from '../../../types/typeAliases';
4
4
  /**
5
5
  * @@@
6
6
  */
7
- export declare function prepareKnowledgeFromMarkdown(content: string_markdown, options: PrepareOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>>>;
7
+ export declare function prepareKnowledgeFromMarkdown(knowledgeContent: string_markdown, options: PrepareOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>>>;
8
8
  /**
9
9
  * TODO: [🐝][🔼] !!! Export via `@promptbook/markdown`
10
10
  * TODO: [🪂] Do it in parallel 11:11
@@ -81,7 +81,7 @@ export type PipelineJson = {
81
81
  /**
82
82
  * TODO: [🍙] Make some standart order of json properties
83
83
  * TODO: [🧠] Maybe wrap all {parameterNames} in brackets for example { "resultingParameterName": "{foo}" }
84
- * Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a
84
+ * Note: [💼] There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a
85
85
  * But then immediately reverted back to the single type
86
86
  * With knowledge as part of the promptbook and collection just as a collection of promptbooks
87
87
  */
@@ -6,4 +6,7 @@ import type { string_template } from '../types/typeAliases';
6
6
  * @param template the template with parameters in {curly} braces
7
7
  * @returns the list of parameter names
8
8
  */
9
- export declare function extractParameters(template: string_template): Set<string_parameter_name>;
9
+ export declare function extractParameterNames(template: string_template): Set<string_parameter_name>;
10
+ /**
11
+ * TODO: !!!!! Rename to extractParameterNames
12
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/node",
3
- "version": "0.61.0-24",
3
+ "version": "0.61.0-26",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -51,7 +51,7 @@
51
51
  }
52
52
  ],
53
53
  "peerDependencies": {
54
- "@promptbook/core": "0.61.0-24"
54
+ "@promptbook/core": "0.61.0-26"
55
55
  },
56
56
  "main": "./umd/index.umd.js",
57
57
  "module": "./esm/index.es.js",