@promptbook/openai 0.61.0-1 → 0.61.0-10

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 (159) hide show
  1. package/esm/index.es.js +1 -1
  2. package/esm/typings/promptbook-collection/index.d.ts +118 -26
  3. package/esm/typings/src/_packages/core.index.d.ts +5 -1
  4. package/esm/typings/src/_packages/types.index.d.ts +5 -3
  5. package/esm/typings/src/_packages/utils.index.d.ts +1 -2
  6. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
  7. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
  8. package/esm/typings/src/collection/constructors/justTestFsImport.d.ts +1 -1
  9. package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +1 -1
  10. package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
  11. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +12 -12
  12. package/esm/typings/src/config.d.ts +4 -0
  13. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +8 -5
  14. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +3 -3
  15. package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
  16. package/esm/typings/src/conversion/utils/renameParameter.d.ts +3 -3
  17. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
  18. package/esm/typings/src/errors/VersionMismatch.d.ts +8 -0
  19. package/esm/typings/src/execution/PipelineExecutor.d.ts +5 -5
  20. package/esm/typings/src/execution/PromptResult.d.ts +5 -5
  21. package/esm/typings/src/execution/ScriptExecutionTools.d.ts +3 -3
  22. package/esm/typings/src/execution/UserInterfaceTools.d.ts +5 -5
  23. package/esm/typings/src/execution/createPipelineExecutor.d.ts +2 -1
  24. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
  25. package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  26. package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -1
  27. package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -1
  28. package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +1 -1
  29. package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
  30. package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
  31. package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
  32. package/esm/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTests.d.ts +7 -0
  33. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +8 -23
  34. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +7 -14
  35. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
  36. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +2 -2
  37. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
  38. package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
  39. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +2 -2
  40. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
  41. package/esm/typings/src/personas/preparePersona.d.ts +13 -0
  42. package/esm/typings/src/personas/preparePersona.test.d.ts +1 -0
  43. package/esm/typings/src/prepare/PrepareOptions.d.ts +22 -0
  44. package/esm/typings/src/prepare/preparePipeline.d.ts +15 -0
  45. package/esm/typings/src/prepare/unpreparePipeline.d.ts +8 -0
  46. package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
  47. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  48. package/esm/typings/src/types/ModelRequirements.d.ts +2 -1
  49. package/esm/typings/src/types/Parameters.d.ts +1 -0
  50. package/esm/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
  51. package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
  52. package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
  53. package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +8 -1
  54. package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +40 -0
  55. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +27 -2
  56. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +25 -0
  57. package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +2 -0
  58. package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
  59. package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +7 -1
  60. package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
  61. package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
  62. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
  63. package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
  64. package/esm/typings/src/types/typeAliases.d.ts +27 -13
  65. package/esm/typings/src/utils/FromtoItems.d.ts +3 -3
  66. package/esm/typings/src/utils/currentDate.d.ts +7 -0
  67. package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
  68. package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +6 -9
  69. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
  70. package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
  71. package/esm/typings/src/utils/organization/TODO.d.ts +4 -0
  72. package/esm/typings/src/utils/organization/TODO_USE.d.ts +11 -0
  73. package/esm/typings/src/utils/organization/___.d.ts +4 -0
  74. package/esm/typings/src/utils/organization/really_any.d.ts +4 -0
  75. package/package.json +2 -2
  76. package/umd/index.umd.js +1 -1
  77. package/umd/typings/promptbook-collection/index.d.ts +118 -26
  78. package/umd/typings/src/_packages/core.index.d.ts +5 -1
  79. package/umd/typings/src/_packages/types.index.d.ts +5 -3
  80. package/umd/typings/src/_packages/utils.index.d.ts +1 -2
  81. package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
  82. package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
  83. package/umd/typings/src/collection/constructors/justTestFsImport.d.ts +1 -1
  84. package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +1 -1
  85. package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
  86. package/umd/typings/src/commands/_common/types/CommandParser.d.ts +12 -12
  87. package/umd/typings/src/config.d.ts +4 -0
  88. package/umd/typings/src/conversion/pipelineStringToJson.d.ts +8 -5
  89. package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +3 -3
  90. package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
  91. package/umd/typings/src/conversion/utils/renameParameter.d.ts +3 -3
  92. package/umd/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
  93. package/umd/typings/src/errors/VersionMismatch.d.ts +8 -0
  94. package/umd/typings/src/execution/PipelineExecutor.d.ts +5 -5
  95. package/umd/typings/src/execution/PromptResult.d.ts +5 -5
  96. package/umd/typings/src/execution/ScriptExecutionTools.d.ts +3 -3
  97. package/umd/typings/src/execution/UserInterfaceTools.d.ts +5 -5
  98. package/umd/typings/src/execution/createPipelineExecutor.d.ts +2 -1
  99. package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
  100. package/umd/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  101. package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -1
  102. package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -1
  103. package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +1 -1
  104. package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
  105. package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
  106. package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
  107. package/umd/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTests.d.ts +7 -0
  108. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +8 -23
  109. package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +7 -14
  110. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
  111. package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +2 -2
  112. package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
  113. package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
  114. package/umd/typings/src/llm-providers/openai/openai-models.d.ts +2 -2
  115. package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
  116. package/umd/typings/src/personas/preparePersona.d.ts +13 -0
  117. package/umd/typings/src/personas/preparePersona.test.d.ts +1 -0
  118. package/umd/typings/src/prepare/PrepareOptions.d.ts +22 -0
  119. package/umd/typings/src/prepare/preparePipeline.d.ts +15 -0
  120. package/umd/typings/src/prepare/unpreparePipeline.d.ts +8 -0
  121. package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
  122. package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  123. package/umd/typings/src/types/ModelRequirements.d.ts +2 -1
  124. package/umd/typings/src/types/Parameters.d.ts +1 -0
  125. package/umd/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
  126. package/umd/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
  127. package/umd/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
  128. package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +8 -1
  129. package/umd/typings/src/types/PipelineJson/PersonaJson.d.ts +40 -0
  130. package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +27 -2
  131. package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +25 -0
  132. package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +2 -0
  133. package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
  134. package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +7 -1
  135. package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
  136. package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
  137. package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
  138. package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
  139. package/umd/typings/src/types/typeAliases.d.ts +27 -13
  140. package/umd/typings/src/utils/FromtoItems.d.ts +3 -3
  141. package/umd/typings/src/utils/currentDate.d.ts +7 -0
  142. package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
  143. package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +6 -9
  144. package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
  145. package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
  146. package/umd/typings/src/utils/organization/TODO.d.ts +4 -0
  147. package/umd/typings/src/utils/organization/TODO_USE.d.ts +11 -0
  148. package/umd/typings/src/utils/organization/___.d.ts +4 -0
  149. package/umd/typings/src/utils/organization/really_any.d.ts +4 -0
  150. package/esm/typings/src/personas/personaToModelRequirements.d.ts +0 -6
  151. package/esm/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
  152. package/esm/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
  153. package/umd/typings/src/personas/personaToModelRequirements.d.ts +0 -6
  154. package/umd/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
  155. package/umd/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
  156. /package/esm/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
  157. /package/esm/typings/src/utils/{just.d.ts → organization/just.d.ts} +0 -0
  158. /package/umd/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
  159. /package/umd/typings/src/utils/{just.d.ts → organization/just.d.ts} +0 -0
@@ -41,18 +41,18 @@ export type ExecutionReportJson = {
41
41
  /**
42
42
  * The prompt wich was executed
43
43
  */
44
- prompt: Omit<Prompt, 'pipelineUrl' | 'parameters'>;
44
+ readonly prompt: Omit<Prompt, 'pipelineUrl' | 'parameters'>;
45
45
  /**
46
46
  * Result of the prompt execution (if not failed during LLM execution)
47
47
  */
48
- result?: PromptResult;
48
+ readonly result?: PromptResult;
49
49
  /**
50
50
  * The error which occured during LLM execution or during postprocessing or expectation checking
51
51
  *
52
52
  * Note: It makes sense to have both error and result defined, for example when the result not pass expectations
53
53
  */
54
- error?: {
55
- message: string;
54
+ readonly error?: {
55
+ readonly message: string;
56
56
  };
57
57
  }>;
58
58
  };
@@ -1,16 +1,16 @@
1
1
  import type { number_percent } from '../typeAliases';
2
2
  /**
3
- * Options for generating an execution report string
3
+ * Options for `executionReportJsonToString`
4
4
  */
5
5
  export type ExecutionReportStringOptions = {
6
6
  /**
7
7
  * The tax rate to be applied, expressed as a percentage from 0 to 1 (=100%) or even more
8
8
  */
9
- taxRate: number_percent;
9
+ readonly taxRate: number_percent;
10
10
  /**
11
11
  * The width of the charts in the report
12
12
  */
13
- chartsWidth: number;
13
+ readonly chartsWidth: number;
14
14
  };
15
15
  /**
16
16
  * Default options for generating an execution report string
@@ -80,6 +80,23 @@ export type string_name = string;
80
80
  * For example `"Ai*nautes"`
81
81
  */
82
82
  export type string_title = string;
83
+ /**
84
+ * Description of persona
85
+ *
86
+ * For example `"Skilled copywriter"`
87
+ */
88
+ export type string_persona_description = string;
89
+ /**
90
+ * Source of one knowledge
91
+ *
92
+ * It can be a link, a relative path to file or direct text
93
+ *
94
+ * For example `"https://pavolhejny.com/"`
95
+ * For example `"./pavol-hejny-cv.pdf"`
96
+ * For example `"Pavol Hejný has web https://pavolhejny.com/"`
97
+ * For example `"Pavol Hejný is web developer and creator of Promptbook and Collboard"`
98
+ */
99
+ export type string_knowledge_source = string_url | string_file_path | string;
83
100
  /**
84
101
  * Semantic helper
85
102
  *
@@ -428,6 +445,14 @@ export type string_date_iso8601 = `${number}-${number}-${number}${string}${numbe
428
445
  * Semantic helper for US Dollars
429
446
  */
430
447
  export type number_usd = number;
448
+ /**
449
+ * Semantic helper for incremental IDs
450
+ */
451
+ export type number_id = number_integer & (number_positive | 0);
452
+ /**
453
+ * Semantic helper for number of rows and columns
454
+ */
455
+ export type number_linecol_number = number_integer & number_positive;
431
456
  /**
432
457
  * Semantic helper for number of tokens
433
458
  */
@@ -462,19 +487,8 @@ export type number_kilobytes = number_positive;
462
487
  export type number_megabytes = number_positive;
463
488
  export type number_gigabytes = number_positive;
464
489
  export type number_terabytes = number_positive;
465
- /**
466
- * Formatting helper to put void to keep longer version of prettier
467
- */
468
- export type ___ = never;
469
- /**
470
- * Organizational helper to better mark the place where the type is missing
471
- */
472
- export type TODO = any;
473
- /**
474
- * Organizational helper to mark a place where to really use any
475
- */
476
- export type really_any = any;
477
- /**
490
+ /**.
491
+ * TODO: !!! Change "For example" to @example
478
492
  * TODO: !! Cleanup
479
493
  * TODO: !! Change to branded types
480
494
  */
@@ -5,15 +5,15 @@ export type FromtoItems = Array<{
5
5
  /**
6
6
  * The title of the item
7
7
  */
8
- title: string;
8
+ readonly title: string;
9
9
  /**
10
10
  * The start of the item
11
11
  *
12
12
  * This can mean anything, like seconds, milliseconds, dollars, etc.
13
13
  */
14
- from: number;
14
+ readonly from: number;
15
15
  /**
16
16
  * The end of the item
17
17
  */
18
- to: number;
18
+ readonly to: number;
19
19
  }>;
@@ -0,0 +1,7 @@
1
+ import type { string_date_iso8601 } from '../types/typeAliases';
2
+ /**
3
+ * Simple wrapper `new Date().toISOString()`
4
+ *
5
+ * @returns string_date branded type
6
+ */
7
+ export declare function $currentDate(): string_date_iso8601;
@@ -6,6 +6,6 @@ import type { string_name } from '../../types/typeAliases';
6
6
  * @private within the package
7
7
  */
8
8
  export declare function addAutoGeneratedSection(content: string_markdown, options: {
9
- sectionName: string_name;
10
- sectionContent: string_markdown;
9
+ readonly sectionName: string_name;
10
+ readonly sectionContent: string_markdown;
11
11
  }): string_markdown;
@@ -1,32 +1,29 @@
1
1
  import type { string_markdown } from '../../types/typeAliases';
2
2
  import type { FromtoItems } from '../FromtoItems';
3
3
  /**
4
- * Options for creating a markdown chart
5
- */
6
- /**
7
- * Options for creating a markdown chart.
4
+ * Options for `CreateMarkdownChartOptions`
8
5
  */
9
6
  type CreateMarkdownChartOptions = {
10
7
  /**
11
8
  * The header for the first column - the name of the item
12
9
  */
13
- nameHeader: string;
10
+ readonly nameHeader: string;
14
11
  /**
15
12
  * The header for the second column - the value of the item
16
13
  */
17
- valueHeader: string;
14
+ readonly valueHeader: string;
18
15
  /**
19
16
  * The items to be charted
20
17
  */
21
- items: FromtoItems;
18
+ readonly items: FromtoItems;
22
19
  /**
23
20
  * The width of the chart in squares
24
21
  */
25
- width: number;
22
+ readonly width: number;
26
23
  /**
27
24
  * The name of the unit shown in the chart
28
25
  */
29
- unitName: string;
26
+ readonly unitName: string;
30
27
  };
31
28
  /**
32
29
  * Function createMarkdownChart will draw a chart in markdown from ⬛+🟦 tiles
@@ -6,11 +6,11 @@ export type CodeBlock = {
6
6
  /**
7
7
  * Language of the code block OR null if the language is not specified in opening ```
8
8
  */
9
- language: string | null;
9
+ readonly language: string | null;
10
10
  /**
11
11
  * Content of the code block (unescaped)
12
12
  */
13
- content: string;
13
+ readonly content: string;
14
14
  };
15
15
  /**
16
16
  * Extracts all code blocks from markdown.
@@ -8,15 +8,15 @@ export type MarkdownSection = {
8
8
  /**
9
9
  * Title of the section
10
10
  */
11
- title: string_markdown_text;
11
+ readonly title: string_markdown_text;
12
12
  /**
13
13
  * Level of the section like h1, h2, h3, h4, h5, h6
14
14
  */
15
- level: 1 | 2 | 3 | 4 | 5 | 6;
15
+ readonly level: 1 | 2 | 3 | 4 | 5 | 6;
16
16
  /**
17
17
  * Content of the section with markdown formatting, blocks, lists, etc.
18
18
  */
19
- content: string_markdown_section_content;
19
+ readonly content: string_markdown_section_content;
20
20
  };
21
21
  /**
22
22
  * Parses markdown section to title its level and content
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Organizational helper to better mark the place where the type is missing
3
+ */
4
+ export type TODO = any;
@@ -0,0 +1,11 @@
1
+ import type { really_any } from './really_any';
2
+ /**
3
+ * Just marks a place of place where should be something implemented
4
+ * No side effects.
5
+ *
6
+ * Note: It can be usefull suppressing eslint errors of unused variables
7
+ *
8
+ * @param value any values
9
+ * @returns void
10
+ */
11
+ export declare function TODO_USE(...value: Array<really_any>): void;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Formatting helper to put void to keep longer version of prettier
3
+ */
4
+ export type ___ = never;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Organizational helper to mark a place where to really use any
3
+ */
4
+ export type really_any = any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/openai",
3
- "version": "0.61.0-1",
3
+ "version": "0.61.0-10",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -49,7 +49,7 @@
49
49
  }
50
50
  ],
51
51
  "peerDependencies": {
52
- "@promptbook/core": "0.61.0-1"
52
+ "@promptbook/core": "0.61.0-10"
53
53
  },
54
54
  "main": "./umd/index.umd.js",
55
55
  "module": "./esm/index.es.js",
package/umd/index.umd.js CHANGED
@@ -1167,7 +1167,7 @@
1167
1167
  /**
1168
1168
  * The version of the Promptbook library
1169
1169
  */
1170
- var PROMPTBOOK_VERSION = '0.61.0-0';
1170
+ var PROMPTBOOK_VERSION = '0.61.0-9';
1171
1171
  // TODO: !!!! List here all the versions and annotate + put into script
1172
1172
 
1173
1173
  exports.OPENAI_MODELS = OPENAI_MODELS;
@@ -13,6 +13,7 @@ declare const _default: ({
13
13
  title: string;
14
14
  dependentParameterNames: string[];
15
15
  blockType: string;
16
+ personaName: null;
16
17
  modelRequirements: {
17
18
  modelVariant: string;
18
19
  modelName: string;
@@ -20,19 +21,64 @@ declare const _default: ({
20
21
  content: string;
21
22
  resultingParameterName: string;
22
23
  }[];
23
- knowledge: {
24
- name: string;
25
- title: string;
26
- content: string;
27
- keywords: string[];
28
- index: {
29
- modelName: string;
30
- position: number[];
31
- }[];
32
- sources: {
33
- title: string;
34
- href: string;
35
- }[];
24
+ knowledgeSources: never[];
25
+ knowledgePieces: never[];
26
+ personas: never[];
27
+ preparations: {
28
+ id: number;
29
+ date: string;
30
+ promptbookVersion: string;
31
+ modelUsage: {
32
+ price: {
33
+ value: number;
34
+ };
35
+ input: {
36
+ tokensCount: {
37
+ value: number;
38
+ };
39
+ charactersCount: {
40
+ value: number;
41
+ };
42
+ wordsCount: {
43
+ value: number;
44
+ };
45
+ sentencesCount: {
46
+ value: number;
47
+ };
48
+ linesCount: {
49
+ value: number;
50
+ };
51
+ paragraphsCount: {
52
+ value: number;
53
+ };
54
+ pagesCount: {
55
+ value: number;
56
+ };
57
+ };
58
+ output: {
59
+ tokensCount: {
60
+ value: number;
61
+ };
62
+ charactersCount: {
63
+ value: number;
64
+ };
65
+ wordsCount: {
66
+ value: number;
67
+ };
68
+ sentencesCount: {
69
+ value: number;
70
+ };
71
+ linesCount: {
72
+ value: number;
73
+ };
74
+ paragraphsCount: {
75
+ value: number;
76
+ };
77
+ pagesCount: {
78
+ value: number;
79
+ };
80
+ };
81
+ };
36
82
  }[];
37
83
  sourceFile: string;
38
84
  } | {
@@ -56,6 +102,7 @@ declare const _default: ({
56
102
  max: number;
57
103
  };
58
104
  };
105
+ personaName: null;
59
106
  modelRequirements: {
60
107
  modelVariant: string;
61
108
  modelName: string;
@@ -63,19 +110,64 @@ declare const _default: ({
63
110
  content: string;
64
111
  resultingParameterName: string;
65
112
  }[];
66
- knowledge: {
67
- name: string;
68
- title: string;
69
- content: string;
70
- keywords: string[];
71
- index: {
72
- modelName: string;
73
- position: number[];
74
- }[];
75
- sources: {
76
- title: string;
77
- href: string;
78
- }[];
113
+ knowledgeSources: never[];
114
+ knowledgePieces: never[];
115
+ personas: never[];
116
+ preparations: {
117
+ id: number;
118
+ date: string;
119
+ promptbookVersion: string;
120
+ modelUsage: {
121
+ price: {
122
+ value: number;
123
+ };
124
+ input: {
125
+ tokensCount: {
126
+ value: number;
127
+ };
128
+ charactersCount: {
129
+ value: number;
130
+ };
131
+ wordsCount: {
132
+ value: number;
133
+ };
134
+ sentencesCount: {
135
+ value: number;
136
+ };
137
+ linesCount: {
138
+ value: number;
139
+ };
140
+ paragraphsCount: {
141
+ value: number;
142
+ };
143
+ pagesCount: {
144
+ value: number;
145
+ };
146
+ };
147
+ output: {
148
+ tokensCount: {
149
+ value: number;
150
+ };
151
+ charactersCount: {
152
+ value: number;
153
+ };
154
+ wordsCount: {
155
+ value: number;
156
+ };
157
+ sentencesCount: {
158
+ value: number;
159
+ };
160
+ linesCount: {
161
+ value: number;
162
+ };
163
+ paragraphsCount: {
164
+ value: number;
165
+ };
166
+ pagesCount: {
167
+ value: number;
168
+ };
169
+ };
170
+ };
79
171
  }[];
80
172
  sourceFile: string;
81
173
  })[];
@@ -17,6 +17,7 @@ import { PipelineExecutionError } from '../errors/PipelineExecutionError';
17
17
  import { PipelineLogicError } from '../errors/PipelineLogicError';
18
18
  import { ReferenceError } from '../errors/ReferenceError';
19
19
  import { UnexpectedError } from '../errors/UnexpectedError';
20
+ import { VersionMismatch } from '../errors/VersionMismatch';
20
21
  import { ExpectError } from '../errors/_ExpectError';
21
22
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
22
23
  import { createPipelineExecutor } from '../execution/createPipelineExecutor';
@@ -29,6 +30,8 @@ import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callbac
29
30
  import { SimplePromptInterfaceTools } from '../knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools';
30
31
  import { prepareKnowledgeFromMarkdown } from '../knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown';
31
32
  import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
33
+ import { preparePipeline } from '../prepare/preparePipeline';
34
+ import { unpreparePipeline } from '../prepare/unpreparePipeline';
32
35
  import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
33
36
  import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
34
37
  import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
@@ -39,6 +42,7 @@ export { addUsage, assertsExecutionSuccessful, checkExpectations, embeddingVecto
39
42
  export { collectionToJson, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createSubcollection, };
40
43
  export { SimplePromptInterfaceTools };
41
44
  export { pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, validatePipeline };
45
+ export { preparePipeline, unpreparePipeline };
42
46
  export { createPipelineExecutor, joinLlmExecutionTools };
43
47
  export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
44
- export { CollectionError, ExpectError, NotFoundError, ParsingError, PipelineExecutionError, PipelineLogicError, ReferenceError, UnexpectedError, };
48
+ export { CollectionError, ExpectError, NotFoundError, ParsingError, PipelineExecutionError, PipelineLogicError, ReferenceError, UnexpectedError, VersionMismatch, };
@@ -12,10 +12,12 @@ import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements
12
12
  import type { Parameters } from '../types/Parameters';
13
13
  import type { ExpectationAmount, ExpectationUnit, Expectations } from '../types/PipelineJson/Expectations';
14
14
  import { EXPECTATION_UNITS } from '../types/PipelineJson/Expectations';
15
- import { KnowledgeJson } from '../types/PipelineJson/KnowledgeJson';
15
+ import { KnowledgePiecePreparedJson } from '../types/PipelineJson/KnowledgePieceJson';
16
+ import { KnowledgeSourceJson, KnowledgeSourcePreparedJson } from '../types/PipelineJson/KnowledgeSourceJson';
16
17
  import type { LlmTemplateJson } from '../types/PipelineJson/LlmTemplateJson';
17
- import { MaterialKnowledgePieceJson } from '../types/PipelineJson/MaterialKnowledgePieceJson';
18
+ import { PersonaJson, PersonaPreparedJson } from '../types/PipelineJson/PersonaJson';
18
19
  import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
20
+ import { PreparationJson } from '../types/PipelineJson/PreparationJson';
19
21
  import type { PromptDialogJson } from '../types/PipelineJson/PromptDialogJson';
20
22
  import type { PromptTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
21
23
  import type { PromptTemplateParameterJson } from '../types/PipelineJson/PromptTemplateParameterJson';
@@ -32,7 +34,7 @@ import type { FromtoItems } from '../utils/FromtoItems';
32
34
  import { PROMPTBOOK_VERSION, string_promptbook_version } from '../version';
33
35
  export { PROMPTBOOK_VERSION };
34
36
  export { EXPECTATION_UNITS };
35
- export type { AvailableModel, BlockType, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems, KnowledgeJson, LlmExecutionTools, LlmTemplateJson, MaterialKnowledgePieceJson, ModelRequirements, ModelVariant, Parameters, PipelineCollection, PipelineExecutor, PipelineJson, PipelineString, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_version, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid, string_semantic_version as string_version, };
37
+ export type { AvailableModel, BlockType, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems, KnowledgePiecePreparedJson, KnowledgeSourceJson, KnowledgeSourcePreparedJson, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, PersonaJson, PersonaPreparedJson, PipelineCollection, PipelineExecutor, PipelineJson, PipelineString, PreparationJson, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_version, string_script, string_semantic_version, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid, };
36
38
  /**
37
39
  * TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
38
40
  */
@@ -54,7 +54,7 @@ import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
54
54
  import { PROMPTBOOK_VERSION } from '../version';
55
55
  export { forEachAsync, PROMPTBOOK_VERSION };
56
56
  export { extractBlock, // <- [🌻] + maybe export through `@promptbook/markdown-utils`
57
- extractParameters, extractVariables, isHostnameOnPrivateNetwork, isUrlOnPrivateNetwork, isValidFilePath, isValidJavascriptName, isValidJsonString, isValidPipelineUrl as isValidPipelineUrl, isValidPromptbookVersion, isValidSemanticVersion, isValidUrl, isValidUuid, parseNumber, // <- [🌻]
57
+ extractParameters, extractVariables, isHostnameOnPrivateNetwork, isUrlOnPrivateNetwork, isValidFilePath, isValidJavascriptName, isValidJsonString, isValidPipelineUrl, isValidPromptbookVersion, isValidSemanticVersion, isValidUrl, isValidUuid, parseNumber, // <- [🌻]
58
58
  removeEmojis, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
59
59
  export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
60
60
  export { splitIntoSentences };
@@ -70,6 +70,5 @@ export type { string_camelCase, string_kebab_case, string_PascalCase, string_SCR
70
70
  export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
71
71
  export { difference, intersection, union };
72
72
  /**
73
- * TODO: [🧠] Maybe create some indipendent package like `@promptbook/markdown-utils`
74
73
  * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
75
74
  */
@@ -29,7 +29,7 @@ type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions
29
29
  *
30
30
  * @default true
31
31
  */
32
- isCrashOnError?: boolean;
32
+ isCrashedOnError?: boolean;
33
33
  };
34
34
  /**
35
35
  * Constructs Promptbook from given directory
@@ -9,13 +9,13 @@ type CreatePipelineCollectionFromUrlyOptions = {
9
9
  *
10
10
  * @default false
11
11
  */
12
- isVerbose?: boolean;
12
+ readonly isVerbose?: boolean;
13
13
  /**
14
14
  * If true, directory will be scanned only when needed not during the construction
15
15
  *
16
16
  * @default false
17
17
  */
18
- isLazyLoaded?: boolean;
18
+ readonly isLazyLoaded?: boolean;
19
19
  };
20
20
  /**
21
21
  * Constructs Promptbook from remote Promptbase URL
@@ -4,4 +4,4 @@
4
4
  export declare function justTestFsImport(): Promise<void>;
5
5
  /**
6
6
  * TODO: !!! Remove this file
7
- */
7
+ */
@@ -1,5 +1,5 @@
1
1
  import type { ModelRequirements } from '../../types/ModelRequirements';
2
- import type { TODO } from '../../types/typeAliases';
2
+ import type { TODO } from '../../utils/organization/TODO';
3
3
  /**
4
4
  * Parsed MODEL command
5
5
  *
@@ -1,3 +1,5 @@
1
+ import type { string_name } from '../../types/typeAliases';
2
+ import type { string_persona_description } from '../../types/typeAliases';
1
3
  /**
2
4
  * Parsed PERSONA command
3
5
  *
@@ -6,6 +8,6 @@
6
8
  */
7
9
  export type PersonaCommand = {
8
10
  readonly type: 'PERSONA';
9
- personaName: string;
10
- personaDescription: string | null;
11
+ readonly personaName: string_name;
12
+ readonly personaDescription: string_persona_description | null;
11
13
  };
@@ -5,24 +5,24 @@ import type { CommandUsagePlace } from './CommandUsagePlaces';
5
5
  export type CommandParser<TCommand extends {
6
6
  type: string_name & string_SCREAMING_CASE;
7
7
  }> = {
8
- name: string_name & string_SCREAMING_CASE;
9
- aliasNames?: Array<string_name & string_SCREAMING_CASE>;
10
- deprecatedNames?: Array<string_name & string_SCREAMING_CASE>;
11
- usagePlaces: Array<CommandUsagePlace>;
12
- description: string_markdown_text;
13
- discussionUrl: `https://github.com/webgptorg/promptbook/discussions/${number | '@@'}`;
14
- examples: Array<string_markdown_text>;
8
+ readonly name: string_name & string_SCREAMING_CASE;
9
+ readonly aliasNames?: Array<string_name & string_SCREAMING_CASE>;
10
+ readonly deprecatedNames?: Array<string_name & string_SCREAMING_CASE>;
11
+ readonly usagePlaces: Array<CommandUsagePlace>;
12
+ readonly description: string_markdown_text;
13
+ readonly discussionUrl: `https://github.com/webgptorg/promptbook/discussions/${number | '@@'}`;
14
+ readonly examples: Array<string_markdown_text>;
15
15
  /**
16
16
  * @throws {ParsingError} if the parsing fails
17
17
  */
18
18
  parse(input: CommandParserInput): TCommand;
19
19
  };
20
20
  export type CommandParserInput = {
21
- usagePlace: CommandUsagePlace;
22
- raw: string_markdown_text;
23
- rawArgs: string_markdown_text;
24
- normalized: string_name & string_SCREAMING_CASE;
25
- args: Array<string_name & string_SCREAMING_CASE>;
21
+ readonly usagePlace: CommandUsagePlace;
22
+ readonly raw: string_markdown_text;
23
+ readonly rawArgs: string_markdown_text;
24
+ readonly normalized: string_name & string_SCREAMING_CASE;
25
+ readonly args: Array<string_name & string_SCREAMING_CASE>;
26
26
  };
27
27
  /**
28
28
  * TODO: !!!! Annotate
@@ -6,6 +6,10 @@ export declare const LOOP_LIMIT = 1000;
6
6
  * The maximum number of iterations for a loops which adds characters one by one
7
7
  */
8
8
  export declare const CHARACTER_LOOP_LIMIT = 100000;
9
+ /**
10
+ * The maximum number of (LLM) tasks running in parallel
11
+ */
12
+ export declare const MAX_PARALLEL_COUNT = 5;
9
13
  /**
10
14
  * The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
11
15
  */