@promptbook/remote-client 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 (22) hide show
  1. package/README.md +3 -3
  2. package/esm/index.es.js +1 -1
  3. package/esm/typings/src/_packages/utils.index.d.ts +4 -4
  4. package/esm/typings/src/config.d.ts +5 -1
  5. package/esm/typings/src/conversion/utils/{extractParametersFromPromptTemplate.d.ts → extractParameterNamesFromPromptTemplate.d.ts} +1 -1
  6. package/esm/typings/src/execution/createPipelineExecutor.d.ts +2 -0
  7. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  8. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -1
  9. package/esm/typings/src/utils/{extractParameters.d.ts → extractParameterNames.d.ts} +4 -1
  10. package/package.json +2 -2
  11. package/umd/index.umd.js +1 -1
  12. package/umd/typings/src/_packages/utils.index.d.ts +4 -4
  13. package/umd/typings/src/config.d.ts +5 -1
  14. package/umd/typings/src/conversion/utils/{extractParametersFromPromptTemplate.d.ts → extractParameterNamesFromPromptTemplate.d.ts} +1 -1
  15. package/umd/typings/src/execution/createPipelineExecutor.d.ts +2 -0
  16. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  17. package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -1
  18. package/umd/typings/src/utils/{extractParameters.d.ts → extractParameterNames.d.ts} +4 -1
  19. /package/esm/typings/src/conversion/utils/{extractParametersFromPromptTemplate.test.d.ts → extractParameterNamesFromPromptTemplate.test.d.ts} +0 -0
  20. /package/esm/typings/src/utils/{extractParameters.test.d.ts → extractParameterNames.test.d.ts} +0 -0
  21. /package/umd/typings/src/conversion/utils/{extractParametersFromPromptTemplate.test.d.ts → extractParameterNamesFromPromptTemplate.test.d.ts} +0 -0
  22. /package/umd/typings/src/utils/{extractParameters.test.d.ts → extractParameterNames.test.d.ts} +0 -0
package/README.md CHANGED
@@ -83,7 +83,7 @@ File `write-website-content.ptbk.md`:
83
83
  > - PROMPTBOOK VERSION 0.0.1
84
84
  > - INPUT  PARAM `{rawTitle}` Automatically suggested a site name or empty text
85
85
  > - INPUT  PARAM `{rawAssigment}` Automatically generated site entry from image recognition
86
- > - OUTPUT PARAM `{content}` Web content
86
+ > - OUTPUT PARAM `{websiteContent}` Web content
87
87
  > - OUTPUT PARAM `{keywords}` Keywords
88
88
  >
89
89
  > ## 👤 Specifying the assigment
@@ -242,7 +242,7 @@ File `write-website-content.ptbk.md`:
242
242
  > {contentBody}
243
243
  > ```
244
244
  >
245
- > `-> {content}`
245
+ > `-> {websiteContent}`
246
246
 
247
247
 
248
248
 
@@ -282,7 +282,7 @@ flowchart LR
282
282
  templateCombineTheBeginning--"{contentBeginning}"-->templateCombineTheContent
283
283
  templateWriteTheContent--"{contentBody}"-->templateCombineTheContent
284
284
 
285
- templateCombineTheContent--"{content}"-->output
285
+ templateCombineTheContent--"{websiteContent}"-->output
286
286
  output((Output)):::output
287
287
 
288
288
  classDef input color: grey;
package/esm/index.es.js CHANGED
@@ -214,7 +214,7 @@ var RemoteLlmExecutionTools = /** @class */ (function () {
214
214
  /**
215
215
  * The version of the Promptbook library
216
216
  */
217
- var PROMPTBOOK_VERSION = '0.61.0-23';
217
+ var PROMPTBOOK_VERSION = '0.61.0-25';
218
218
  // TODO: !!!! List here all the versions and annotate + put into script
219
219
 
220
220
  export { PROMPTBOOK_VERSION, RemoteLlmExecutionTools };
@@ -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/remote-client",
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,
@@ -47,7 +47,7 @@
47
47
  }
48
48
  ],
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.61.0-24"
50
+ "@promptbook/core": "0.61.0-26"
51
51
  },
52
52
  "main": "./umd/index.umd.js",
53
53
  "module": "./esm/index.es.js",
package/umd/index.umd.js CHANGED
@@ -218,7 +218,7 @@
218
218
  /**
219
219
  * The version of the Promptbook library
220
220
  */
221
- var PROMPTBOOK_VERSION = '0.61.0-23';
221
+ var PROMPTBOOK_VERSION = '0.61.0-25';
222
222
  // TODO: !!!! List here all the versions and annotate + put into script
223
223
 
224
224
  exports.PROMPTBOOK_VERSION = PROMPTBOOK_VERSION;
@@ -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
+ */