@promptbook/types 0.61.0-1 → 0.61.0-11

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 (225) hide show
  1. package/esm/index.es.js +2 -1
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/promptbook-collection/index.d.ts +196 -23
  4. package/esm/typings/src/_packages/core.index.d.ts +5 -1
  5. package/esm/typings/src/_packages/types.index.d.ts +6 -4
  6. package/esm/typings/src/_packages/utils.index.d.ts +4 -3
  7. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
  8. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
  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 +15 -12
  12. package/esm/typings/src/config.d.ts +8 -0
  13. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
  14. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -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/conversion/validation/validatePipeline.d.ts +4 -0
  19. package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
  20. package/esm/typings/src/errors/VersionMismatchError.d.ts +8 -0
  21. package/esm/typings/src/execution/LlmExecutionTools.d.ts +3 -1
  22. package/esm/typings/src/execution/PipelineExecutor.d.ts +8 -7
  23. package/esm/typings/src/execution/PromptResult.d.ts +17 -5
  24. package/esm/typings/src/execution/ScriptExecutionTools.d.ts +6 -4
  25. package/esm/typings/src/execution/UserInterfaceTools.d.ts +5 -5
  26. package/esm/typings/src/execution/createPipelineExecutor.d.ts +4 -1
  27. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
  28. package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  29. package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -1
  30. package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -1
  31. package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +1 -1
  32. package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
  33. package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
  34. package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
  35. package/esm/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +10 -0
  36. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +8 -23
  37. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
  38. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +7 -14
  39. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
  40. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +2 -2
  41. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
  42. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
  43. package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
  44. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
  45. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
  46. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -1
  47. package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
  48. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
  49. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
  50. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
  51. package/esm/typings/src/llm-providers/utils/cache/CacheItem.d.ts +29 -0
  52. package/esm/typings/src/llm-providers/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
  53. package/esm/typings/src/llm-providers/utils/cache/cacheLlmTools.d.ts +17 -0
  54. package/esm/typings/src/llm-providers/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
  55. package/esm/typings/src/llm-providers/utils/count-total-cost/countTotalCost.d.ts +14 -0
  56. package/esm/typings/src/llm-providers/utils/createLlmToolsFromEnv.d.ts +21 -0
  57. package/esm/typings/src/personas/preparePersona.d.ts +10 -0
  58. package/esm/typings/src/personas/preparePersona.test.d.ts +1 -0
  59. package/esm/typings/src/prepare/PrepareOptions.d.ts +22 -0
  60. package/esm/typings/src/prepare/preparePipeline.d.ts +16 -0
  61. package/esm/typings/src/prepare/unpreparePipeline.d.ts +8 -0
  62. package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
  63. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  64. package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +24 -0
  65. package/esm/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
  66. package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +28 -0
  67. package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +10 -0
  68. package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
  69. package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
  70. package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +8 -0
  71. package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +8 -0
  72. package/esm/typings/src/storage/memory/MemoryStorage.d.ts +31 -0
  73. package/esm/typings/src/storage/utils/PrefixStorage.d.ts +23 -0
  74. package/esm/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +12 -0
  75. package/esm/typings/src/types/ModelRequirements.d.ts +22 -1
  76. package/esm/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
  77. package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
  78. package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
  79. package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +8 -1
  80. package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +40 -0
  81. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +27 -3
  82. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
  83. package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +2 -0
  84. package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
  85. package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +8 -1
  86. package/esm/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
  87. package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
  88. package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
  89. package/esm/typings/src/types/Prompt.d.ts +5 -2
  90. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
  91. package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
  92. package/esm/typings/src/types/typeAliases.d.ts +62 -14
  93. package/esm/typings/src/utils/FromtoItems.d.ts +3 -3
  94. package/esm/typings/src/utils/currentDate.d.ts +7 -0
  95. package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
  96. package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +6 -9
  97. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
  98. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
  99. package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  100. package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
  101. package/esm/typings/src/utils/organization/TODO.d.ts +4 -0
  102. package/esm/typings/src/utils/organization/TODO_USE.d.ts +11 -0
  103. package/esm/typings/src/utils/organization/___.d.ts +4 -0
  104. package/esm/typings/src/utils/organization/notUsing.d.ts +11 -0
  105. package/esm/typings/src/utils/organization/really_any.d.ts +4 -0
  106. package/esm/typings/src/utils/random/randomSeed.d.ts +7 -0
  107. package/package.json +2 -2
  108. package/umd/index.umd.js +2 -1
  109. package/umd/index.umd.js.map +1 -1
  110. package/umd/typings/promptbook-collection/index.d.ts +196 -23
  111. package/umd/typings/src/_packages/core.index.d.ts +5 -1
  112. package/umd/typings/src/_packages/types.index.d.ts +6 -4
  113. package/umd/typings/src/_packages/utils.index.d.ts +4 -3
  114. package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
  115. package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
  116. package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +1 -1
  117. package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
  118. package/umd/typings/src/commands/_common/types/CommandParser.d.ts +15 -12
  119. package/umd/typings/src/config.d.ts +8 -0
  120. package/umd/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
  121. package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -3
  122. package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
  123. package/umd/typings/src/conversion/utils/renameParameter.d.ts +3 -3
  124. package/umd/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
  125. package/umd/typings/src/conversion/validation/validatePipeline.d.ts +4 -0
  126. package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
  127. package/umd/typings/src/errors/VersionMismatchError.d.ts +8 -0
  128. package/umd/typings/src/execution/LlmExecutionTools.d.ts +3 -1
  129. package/umd/typings/src/execution/PipelineExecutor.d.ts +8 -7
  130. package/umd/typings/src/execution/PromptResult.d.ts +17 -5
  131. package/umd/typings/src/execution/ScriptExecutionTools.d.ts +6 -4
  132. package/umd/typings/src/execution/UserInterfaceTools.d.ts +5 -5
  133. package/umd/typings/src/execution/createPipelineExecutor.d.ts +4 -1
  134. package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
  135. package/umd/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  136. package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -1
  137. package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -1
  138. package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +1 -1
  139. package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
  140. package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
  141. package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
  142. package/umd/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +10 -0
  143. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +8 -23
  144. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
  145. package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +7 -14
  146. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
  147. package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +2 -2
  148. package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
  149. package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
  150. package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
  151. package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
  152. package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
  153. package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -1
  154. package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
  155. package/umd/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
  156. package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
  157. package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
  158. package/umd/typings/src/llm-providers/utils/cache/CacheItem.d.ts +29 -0
  159. package/umd/typings/src/llm-providers/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
  160. package/umd/typings/src/llm-providers/utils/cache/cacheLlmTools.d.ts +17 -0
  161. package/umd/typings/src/llm-providers/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
  162. package/umd/typings/src/llm-providers/utils/count-total-cost/countTotalCost.d.ts +14 -0
  163. package/umd/typings/src/llm-providers/utils/createLlmToolsFromEnv.d.ts +21 -0
  164. package/umd/typings/src/personas/preparePersona.d.ts +10 -0
  165. package/umd/typings/src/personas/preparePersona.test.d.ts +1 -0
  166. package/umd/typings/src/prepare/PrepareOptions.d.ts +22 -0
  167. package/umd/typings/src/prepare/preparePipeline.d.ts +16 -0
  168. package/umd/typings/src/prepare/unpreparePipeline.d.ts +8 -0
  169. package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
  170. package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  171. package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +24 -0
  172. package/umd/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
  173. package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +28 -0
  174. package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +10 -0
  175. package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
  176. package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
  177. package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +8 -0
  178. package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +8 -0
  179. package/umd/typings/src/storage/memory/MemoryStorage.d.ts +31 -0
  180. package/umd/typings/src/storage/utils/PrefixStorage.d.ts +23 -0
  181. package/umd/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +12 -0
  182. package/umd/typings/src/types/ModelRequirements.d.ts +22 -1
  183. package/umd/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
  184. package/umd/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
  185. package/umd/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
  186. package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +8 -1
  187. package/umd/typings/src/types/PipelineJson/PersonaJson.d.ts +40 -0
  188. package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +27 -3
  189. package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
  190. package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +2 -0
  191. package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +1 -1
  192. package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +8 -1
  193. package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
  194. package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
  195. package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
  196. package/umd/typings/src/types/Prompt.d.ts +5 -2
  197. package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
  198. package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
  199. package/umd/typings/src/types/typeAliases.d.ts +62 -14
  200. package/umd/typings/src/utils/FromtoItems.d.ts +3 -3
  201. package/umd/typings/src/utils/currentDate.d.ts +7 -0
  202. package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
  203. package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +6 -9
  204. package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
  205. package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
  206. package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  207. package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
  208. package/umd/typings/src/utils/organization/TODO.d.ts +4 -0
  209. package/umd/typings/src/utils/organization/TODO_USE.d.ts +11 -0
  210. package/umd/typings/src/utils/organization/___.d.ts +4 -0
  211. package/umd/typings/src/utils/organization/notUsing.d.ts +11 -0
  212. package/umd/typings/src/utils/organization/really_any.d.ts +4 -0
  213. package/umd/typings/src/utils/random/randomSeed.d.ts +7 -0
  214. package/esm/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
  215. package/esm/typings/src/personas/personaToModelRequirements.d.ts +0 -6
  216. package/esm/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
  217. package/esm/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
  218. package/umd/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
  219. package/umd/typings/src/personas/personaToModelRequirements.d.ts +0 -6
  220. package/umd/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
  221. package/umd/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
  222. /package/esm/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
  223. /package/esm/typings/src/utils/{just.d.ts → organization/just.d.ts} +0 -0
  224. /package/umd/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
  225. /package/umd/typings/src/utils/{just.d.ts → organization/just.d.ts} +0 -0
package/esm/index.es.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Units of text measurement
3
+ * @see https://github.com/webgptorg/promptbook/discussions/30
3
4
  */
4
5
  var EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRAPHS', 'PAGES'];
5
6
  /**
@@ -9,7 +10,7 @@ var EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRAPH
9
10
  /**
10
11
  * The version of the Promptbook library
11
12
  */
12
- var PROMPTBOOK_VERSION = '0.61.0-0';
13
+ var PROMPTBOOK_VERSION = '0.61.0-10';
13
14
  // TODO: !!!! List here all the versions and annotate + put into script
14
15
 
15
16
  export { EXPECTATION_UNITS, PROMPTBOOK_VERSION };
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../../src/types/PipelineJson/Expectations.ts","../../../../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":"AAcA;;;IAGa,iBAAiB,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAW;AAY/G;;;;AC3BA;;;IAGa,kBAAkB,GAA8B,WAAW;AAGxE;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":["../../../../src/types/PipelineJson/Expectations.ts","../../../../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":"AAeA;;;;IAIa,iBAAiB,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAW;AAc/G;;;;AC/BA;;;IAGa,kBAAkB,GAA8B,YAAY;AAGzE;;;;"}
@@ -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,63 @@ 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
+ promptbookVersion: string;
30
+ modelUsage: {
31
+ price: {
32
+ value: number;
33
+ };
34
+ input: {
35
+ tokensCount: {
36
+ value: number;
37
+ };
38
+ charactersCount: {
39
+ value: number;
40
+ };
41
+ wordsCount: {
42
+ value: number;
43
+ };
44
+ sentencesCount: {
45
+ value: number;
46
+ };
47
+ linesCount: {
48
+ value: number;
49
+ };
50
+ paragraphsCount: {
51
+ value: number;
52
+ };
53
+ pagesCount: {
54
+ value: number;
55
+ };
56
+ };
57
+ output: {
58
+ tokensCount: {
59
+ value: number;
60
+ };
61
+ charactersCount: {
62
+ value: number;
63
+ };
64
+ wordsCount: {
65
+ value: number;
66
+ };
67
+ sentencesCount: {
68
+ value: number;
69
+ };
70
+ linesCount: {
71
+ value: number;
72
+ };
73
+ paragraphsCount: {
74
+ value: number;
75
+ };
76
+ pagesCount: {
77
+ value: number;
78
+ };
79
+ };
80
+ };
36
81
  }[];
37
82
  sourceFile: string;
38
83
  } | {
@@ -56,6 +101,7 @@ declare const _default: ({
56
101
  max: number;
57
102
  };
58
103
  };
104
+ personaName: null;
59
105
  modelRequirements: {
60
106
  modelVariant: string;
61
107
  modelName: string;
@@ -63,19 +109,146 @@ declare const _default: ({
63
109
  content: string;
64
110
  resultingParameterName: string;
65
111
  }[];
66
- knowledge: {
112
+ knowledgeSources: never[];
113
+ knowledgePieces: never[];
114
+ personas: never[];
115
+ preparations: {
116
+ id: number;
117
+ promptbookVersion: string;
118
+ modelUsage: {
119
+ price: {
120
+ value: number;
121
+ };
122
+ input: {
123
+ tokensCount: {
124
+ value: number;
125
+ };
126
+ charactersCount: {
127
+ value: number;
128
+ };
129
+ wordsCount: {
130
+ value: number;
131
+ };
132
+ sentencesCount: {
133
+ value: number;
134
+ };
135
+ linesCount: {
136
+ value: number;
137
+ };
138
+ paragraphsCount: {
139
+ value: number;
140
+ };
141
+ pagesCount: {
142
+ value: number;
143
+ };
144
+ };
145
+ output: {
146
+ tokensCount: {
147
+ value: number;
148
+ };
149
+ charactersCount: {
150
+ value: number;
151
+ };
152
+ wordsCount: {
153
+ value: number;
154
+ };
155
+ sentencesCount: {
156
+ value: number;
157
+ };
158
+ linesCount: {
159
+ value: number;
160
+ };
161
+ paragraphsCount: {
162
+ value: number;
163
+ };
164
+ pagesCount: {
165
+ value: number;
166
+ };
167
+ };
168
+ };
169
+ }[];
170
+ sourceFile: string;
171
+ } | {
172
+ title: string;
173
+ pipelineUrl: string;
174
+ promptbookVersion: string;
175
+ parameters: {
176
+ name: string;
177
+ description: string;
178
+ isInput: boolean;
179
+ isOutput: boolean;
180
+ }[];
181
+ promptTemplates: {
67
182
  name: string;
68
183
  title: string;
69
- content: string;
70
- keywords: string[];
71
- index: {
184
+ dependentParameterNames: string[];
185
+ blockType: string;
186
+ expectFormat: string;
187
+ personaName: null;
188
+ modelRequirements: {
189
+ modelVariant: string;
72
190
  modelName: string;
73
- position: number[];
74
- }[];
75
- sources: {
76
- title: string;
77
- href: string;
78
- }[];
191
+ };
192
+ content: string;
193
+ resultingParameterName: string;
194
+ }[];
195
+ knowledgeSources: never[];
196
+ knowledgePieces: never[];
197
+ personas: never[];
198
+ preparations: {
199
+ id: number;
200
+ promptbookVersion: string;
201
+ modelUsage: {
202
+ price: {
203
+ value: number;
204
+ };
205
+ input: {
206
+ tokensCount: {
207
+ value: number;
208
+ };
209
+ charactersCount: {
210
+ value: number;
211
+ };
212
+ wordsCount: {
213
+ value: number;
214
+ };
215
+ sentencesCount: {
216
+ value: number;
217
+ };
218
+ linesCount: {
219
+ value: number;
220
+ };
221
+ paragraphsCount: {
222
+ value: number;
223
+ };
224
+ pagesCount: {
225
+ value: number;
226
+ };
227
+ };
228
+ output: {
229
+ tokensCount: {
230
+ value: number;
231
+ };
232
+ charactersCount: {
233
+ value: number;
234
+ };
235
+ wordsCount: {
236
+ value: number;
237
+ };
238
+ sentencesCount: {
239
+ value: number;
240
+ };
241
+ linesCount: {
242
+ value: number;
243
+ };
244
+ paragraphsCount: {
245
+ value: number;
246
+ };
247
+ pagesCount: {
248
+ value: number;
249
+ };
250
+ };
251
+ };
79
252
  }[];
80
253
  sourceFile: string;
81
254
  })[];
@@ -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 { VersionMismatchError } from '../errors/VersionMismatchError';
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, VersionMismatchError, };
@@ -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';
@@ -27,12 +29,12 @@ import type { ScriptLanguage } from '../types/ScriptLanguage';
27
29
  import type { TaskProgress } from '../types/TaskProgress';
28
30
  import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
29
31
  import type { string_char_emoji } from '../types/typeAliasEmoji';
30
- import type { client_id, string_char, 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_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 } from '../types/typeAliases';
32
+ import type { client_id, number_model_temperature, number_seed, string_char, 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_parameter_name, string_parameter_value, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_script, string_semantic_version, string_sha256, string_system_message, 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 } from '../types/typeAliases';
31
33
  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, number_model_temperature, number_seed, 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_parameter_name, string_parameter_value, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_version, string_script, string_semantic_version, string_sha256, string_system_message, 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
  */
@@ -7,6 +7,7 @@ import { titleToName } from '../conversion/utils/titleToName';
7
7
  import { forEachAsync } from '../execution/utils/forEachAsync';
8
8
  import { replaceParameters } from '../execution/utils/replaceParameters';
9
9
  import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
10
+ import { $currentDate } from '../utils/currentDate';
10
11
  import { countCharacters } from '../utils/expectation-counters/countCharacters';
11
12
  import { countLines } from '../utils/expectation-counters/countLines';
12
13
  import { countPages } from '../utils/expectation-counters/countPages';
@@ -34,6 +35,7 @@ import { removeDiacritics } from '../utils/normalization/removeDiacritics';
34
35
  import { searchKeywords } from '../utils/normalization/searchKeywords';
35
36
  import { parseNumber } from '../utils/parseNumber';
36
37
  import { extractBlock } from '../utils/postprocessing/extractBlock';
38
+ import { $randomSeed } from '../utils/random/randomSeed';
37
39
  import { removeEmojis } from '../utils/removeEmojis';
38
40
  import { removeQuotes } from '../utils/removeQuotes';
39
41
  import { difference } from '../utils/sets/difference';
@@ -53,8 +55,8 @@ import { isValidUrl } from '../utils/validators/url/isValidUrl';
53
55
  import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
54
56
  import { PROMPTBOOK_VERSION } from '../version';
55
57
  export { forEachAsync, PROMPTBOOK_VERSION };
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, // <- [🌻]
58
+ export { $currentDate, $randomSeed, extractBlock, // <- [🌻] + maybe export through `@promptbook/markdown-utils`
59
+ extractParameters, extractVariables, isHostnameOnPrivateNetwork, isUrlOnPrivateNetwork, isValidFilePath, isValidJavascriptName, isValidJsonString, isValidPipelineUrl, isValidPromptbookVersion, isValidSemanticVersion, isValidUrl, isValidUuid, parseNumber, // <- [🌻]
58
60
  removeEmojis, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
59
61
  export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
60
62
  export { splitIntoSentences };
@@ -70,6 +72,5 @@ export type { string_camelCase, string_kebab_case, string_PascalCase, string_SCR
70
72
  export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
71
73
  export { difference, intersection, union };
72
74
  /**
73
- * TODO: [🧠] Maybe create some indipendent package like `@promptbook/markdown-utils`
74
75
  * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
75
76
  */
@@ -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
@@ -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
  };
@@ -1,3 +1,5 @@
1
+ import type { WritableDeep } from 'type-fest';
2
+ import type { PipelineJson } from '../../../types/PipelineJson/PipelineJson';
1
3
  import type { string_markdown_text } from '../../../types/typeAliases';
2
4
  import type { string_name } from '../../../types/typeAliases';
3
5
  import type { string_SCREAMING_CASE } from '../../../utils/normalization/normalizeTo_SCREAMING_CASE';
@@ -5,24 +7,25 @@ import type { CommandUsagePlace } from './CommandUsagePlaces';
5
7
  export type CommandParser<TCommand extends {
6
8
  type: string_name & string_SCREAMING_CASE;
7
9
  }> = {
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>;
10
+ readonly name: string_name & string_SCREAMING_CASE;
11
+ readonly aliasNames?: Array<string_name & string_SCREAMING_CASE>;
12
+ readonly deprecatedNames?: Array<string_name & string_SCREAMING_CASE>;
13
+ readonly usagePlaces: Array<CommandUsagePlace>;
14
+ readonly description: string_markdown_text;
15
+ readonly discussionUrl: `https://github.com/webgptorg/promptbook/discussions/${number | '@@'}`;
16
+ readonly examples: Array<string_markdown_text>;
15
17
  /**
16
18
  * @throws {ParsingError} if the parsing fails
17
19
  */
18
20
  parse(input: CommandParserInput): TCommand;
21
+ applyToPipelineJson?(pipelineJson: WritableDeep<PipelineJson>, personaCommand: TCommand): void;
19
22
  };
20
23
  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>;
24
+ readonly usagePlace: CommandUsagePlace;
25
+ readonly raw: string_markdown_text;
26
+ readonly rawArgs: string_markdown_text;
27
+ readonly normalized: string_name & string_SCREAMING_CASE;
28
+ readonly args: Array<string_name & string_SCREAMING_CASE>;
26
29
  };
27
30
  /**
28
31
  * TODO: !!!! Annotate
@@ -6,6 +6,14 @@ 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;
13
+ /**
14
+ * The maximum length of the (generated) filename
15
+ */
16
+ export declare const MAX_FILENAME_LENGTH = 30;
9
17
  /**
10
18
  * The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
11
19
  */
@@ -2,20 +2,23 @@ import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
2
2
  import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
3
3
  import type { PipelineString } from '../types/PipelineString';
4
4
  /**
5
- * Options for pipelineStringToJson
5
+ * Options for `pipelineStringToJson`
6
6
  */
7
7
  export type PipelineStringToJsonOptions = {
8
8
  /**
9
- * Tools for processing required for knowledge processing *(not for actual execution)*
9
+ * Tools for processing required for preparation of knowledge *(not for actual execution)*
10
+ *
11
+ * Note: If you provide `null`, the knowledge will not be prepared
10
12
  */
11
- llmTools?: LlmExecutionTools;
13
+ readonly llmTools: LlmExecutionTools | null;
12
14
  };
13
15
  /**
14
- * Compile promptbook from string (markdown) format to JSON format
16
+ * Compile pipeline from string (markdown) format to JSON format
15
17
  *
16
- * Note: There are two similar functions:
18
+ * Note: There are 3 similar functions:
17
19
  * - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
18
20
  * - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
21
+ * - `preparePipeline` - just one step in the compilation process
19
22
  *
20
23
  * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
21
24
  * @param options - Options and tools for the compilation
@@ -28,4 +31,5 @@ export type PipelineStringToJsonOptions = {
28
31
  export declare function pipelineStringToJson(pipelineString: PipelineString, options?: PipelineStringToJsonOptions): Promise<PipelineJson>;
29
32
  /**
30
33
  * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
34
+ * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
31
35
  */
@@ -1,14 +1,14 @@
1
1
  import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
2
2
  import type { PipelineString } from '../types/PipelineString';
3
3
  /**
4
- * Compile promptbook from string (markdown) format to JSON format synchronously
4
+ * Compile pipeline from string (markdown) format to JSON format synchronously
5
5
  *
6
- * Note: There are two similar functions:
6
+ * Note: There are 3 similar functions:
7
7
  * - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
8
8
  * - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
9
+ * - `preparePipeline` - just one step in the compilation process
9
10
  *
10
11
  * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
11
- * @param options - Options and tools for the compilation
12
12
  * @returns {Promptbook} compiled in JSON format (.ptbk.json)
13
13
  * @throws {ParsingError} if the promptbook string is not valid
14
14
  *
@@ -22,4 +22,6 @@ export declare function pipelineStringToJsonSync(pipelineString: PipelineString)
22
22
  * TODO: Use spaceTrim more effectively
23
23
  * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
24
24
  * TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
25
+ * TODO: [♈] Probbably move expectations from templates to parameters
26
+ * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
25
27
  */
@@ -5,9 +5,9 @@ export type PrettifyOptions = {
5
5
  /***
6
6
  * If true, adds Mermaid graph to the Promptbook string
7
7
  */
8
- isGraphAdded?: boolean;
8
+ readonly isGraphAdded?: boolean;
9
9
  /**
10
10
  * If true, the string is prettifyed as markdown
11
11
  */
12
- isPrettifyed?: boolean;
12
+ readonly isPrettifyed?: boolean;
13
13
  };
@@ -5,15 +5,15 @@ type RenameParameterOptions = {
5
5
  * Pipeline to search and replace for parameters
6
6
  * This pipeline is returned as copy with replaced parameters
7
7
  */
8
- pipeline: PipelineJson;
8
+ readonly pipeline: PipelineJson;
9
9
  /**
10
10
  * Original parameter name that should be replaced
11
11
  */
12
- oldParameterName: string_name;
12
+ readonly oldParameterName: string_name;
13
13
  /**
14
14
  * New parameter name that should replace the original parameter name
15
15
  */
16
- newParameterName: string_name;
16
+ readonly newParameterName: string_name;
17
17
  };
18
18
  /**
19
19
  * Function renameParameter will find all usable parameters for given prompt template
@@ -9,5 +9,5 @@ import type { PipelineString } from '../../types/PipelineString';
9
9
  * @param path - The path to the file relative to samples/templates directory
10
10
  * @private
11
11
  */
12
- export declare function importPipeline(path: `${string}.ptbk.md`): PipelineString;
13
- export declare function importPipeline(path: `${string}.ptbk.json`): PipelineJson;
12
+ export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.md`): PipelineString;
13
+ export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.json`): PipelineJson;
@@ -25,3 +25,7 @@ export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
25
25
  * > * - ...
26
26
  * > ex port function validatePipeline(promptbook: unknown): asserts promptbook is PipelineJson {
27
27
  */
28
+ /**
29
+ * TODO: [🧠] !!!!! Validate new things
30
+ * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
31
+ */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error type indicates that you try to use a feature that is not available in the current environment
3
+ */
4
+ export declare class EnvironmentMismatchError extends Error {
5
+ readonly name = "EnvironmentMismatchError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,8 @@
1
+ import type { string_semantic_version } from '../types/typeAliases';
2
+ /**
3
+ * This error type indicates that the version of the pipeline is not matching the expected version
4
+ */
5
+ export declare class VersionMismatchError extends Error {
6
+ readonly name = "UnexpectedError";
7
+ constructor(message: string, expectedVersion: string_semantic_version);
8
+ }
@@ -63,8 +63,10 @@ export type AvailableModel = {
63
63
  readonly modelVariant: ModelVariant;
64
64
  };
65
65
  /**
66
- * TODO: !!!! Translation model
66
+ * TODO: [🏳] Add `callTranslationModel`
67
+ * TODO: Maybe reorder `listModels` and put it befor `callChatModel`, `callCompletionModel`, `callEmbeddingModel`
67
68
  * TODO: [🧠] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
68
69
  * TODO: [🍓][♐] Some heuristic to pick the best model in listed models
69
70
  * TODO: [🧠] Should or should not there be a word "GPT" in both callCompletionModel and callChatModel
71
+ * TODO: [🧠][🪐] Should be common things like types, utils in folder containing A,B,C,.. or else outside this listing folder?
70
72
  */