@promptbook/types 0.59.0 → 0.60.0-3

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 (206) hide show
  1. package/README.md +5 -5
  2. package/esm/index.es.js +1 -1
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/core.index.d.ts +23 -23
  5. package/esm/typings/src/_packages/node.index.d.ts +2 -2
  6. package/esm/typings/src/_packages/types.index.d.ts +11 -11
  7. package/esm/typings/src/_packages/utils.index.d.ts +9 -11
  8. package/esm/typings/src/config.d.ts +1 -1
  9. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +12 -0
  10. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +32 -0
  11. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +23 -0
  12. package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +1 -1
  13. package/{umd/typings/src/conversion/prettify/prettifyPromptbookString.d.ts → esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts} +2 -2
  14. package/esm/typings/src/conversion/prettify/{renderPromptbookMermaid.d.ts → renderPipelineMermaidOptions.d.ts} +4 -4
  15. package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
  16. package/esm/typings/src/conversion/utils/extractVariables.d.ts +1 -1
  17. package/esm/typings/src/conversion/utils/parseCommand.d.ts +2 -2
  18. package/esm/typings/src/conversion/utils/parseNumber.d.ts +1 -1
  19. package/esm/typings/src/conversion/utils/renameParameter.d.ts +4 -4
  20. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +13 -0
  21. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +27 -0
  22. package/{umd/typings/src/errors/PromptbookLibraryError.d.ts → esm/typings/src/errors/CollectionError.d.ts} +2 -2
  23. package/esm/typings/src/errors/{PromptbookExecutionError.d.ts → ExecutionError.d.ts} +2 -2
  24. package/{umd/typings/src/errors/PromptbookNotFoundError.d.ts → esm/typings/src/errors/NotFoundError.d.ts} +2 -2
  25. package/{umd/typings/src/errors/PromptbookLogicError.d.ts → esm/typings/src/errors/PipelineLogicError.d.ts} +2 -2
  26. package/{umd/typings/src/errors/PromptbookReferenceError.d.ts → esm/typings/src/errors/ReferenceError.d.ts} +2 -2
  27. package/esm/typings/src/errors/{PromptbookSyntaxError.d.ts → SyntaxError.d.ts} +2 -2
  28. package/esm/typings/src/errors/TemplateError.d.ts +1 -1
  29. package/esm/typings/src/errors/_ExpectError.d.ts +2 -2
  30. package/esm/typings/src/execution/ExecutionTools.d.ts +1 -1
  31. package/esm/typings/src/execution/LlmExecutionTools.d.ts +4 -4
  32. package/esm/typings/src/execution/PromptResult.d.ts +1 -1
  33. package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
  34. package/esm/typings/src/execution/createPromptbookExecutor.d.ts +3 -3
  35. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
  36. package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
  37. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  38. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -1
  39. package/esm/typings/src/library/PipelineCollection.d.ts +25 -0
  40. package/esm/typings/src/library/{SimplePromptbookLibrary.d.ts → SimplePipelineCollection.d.ts} +11 -11
  41. package/{umd/typings/src/library/constructors/createLibraryFromDirectory.d.ts → esm/typings/src/library/constructors/createCollectionFromDirectory.d.ts} +5 -5
  42. package/esm/typings/src/library/constructors/createCollectionFromJson.d.ts +12 -0
  43. package/esm/typings/src/library/constructors/createCollectionFromPromise.d.ts +22 -0
  44. package/esm/typings/src/library/constructors/{createLibraryFromUrl.d.ts → createCollectionFromUrl.d.ts} +5 -5
  45. package/esm/typings/src/library/constructors/createSubcollection.d.ts +12 -0
  46. package/esm/typings/src/library/libraryToJson.d.ts +5 -5
  47. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -3
  48. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +3 -3
  49. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
  50. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +3 -3
  51. package/esm/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
  52. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -3
  53. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -3
  54. package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
  55. package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
  56. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +3 -3
  57. package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
  58. package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
  59. package/esm/typings/src/types/Command.d.ts +4 -4
  60. package/esm/typings/src/types/Parameters.d.ts +1 -1
  61. package/esm/typings/src/types/{PromptbookJson/PromptbookJson.d.ts → PipelineJson/PipelineJson.d.ts} +4 -4
  62. package/{umd/typings/src/types/PromptbookString.d.ts → esm/typings/src/types/PipelineString.d.ts} +3 -3
  63. package/esm/typings/src/types/Prompt.d.ts +3 -3
  64. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +2 -2
  65. package/esm/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
  66. package/esm/typings/src/types/typeAliases.d.ts +2 -2
  67. package/esm/typings/src/utils/emojis.d.ts +2 -2
  68. package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
  69. package/esm/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
  70. package/esm/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
  71. package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
  72. package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
  73. package/esm/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
  74. package/esm/typings/src/utils/expectation-counters/index.d.ts +2 -2
  75. package/esm/typings/src/utils/formatNumber.d.ts +1 -1
  76. package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +1 -1
  77. package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
  78. package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
  79. package/esm/typings/src/utils/markdown-json/MarkdownStructure.d.ts +1 -1
  80. package/esm/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +1 -1
  81. package/esm/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +1 -1
  82. package/package.json +3 -3
  83. package/umd/index.umd.js +1 -1
  84. package/umd/index.umd.js.map +1 -1
  85. package/umd/typings/src/_packages/core.index.d.ts +23 -23
  86. package/umd/typings/src/_packages/node.index.d.ts +2 -2
  87. package/umd/typings/src/_packages/types.index.d.ts +11 -11
  88. package/umd/typings/src/_packages/utils.index.d.ts +9 -11
  89. package/umd/typings/src/config.d.ts +1 -1
  90. package/umd/typings/src/conversion/pipelineJsonToString.d.ts +12 -0
  91. package/umd/typings/src/conversion/pipelineStringToJson.d.ts +32 -0
  92. package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +23 -0
  93. package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +1 -1
  94. package/{esm/typings/src/conversion/prettify/prettifyPromptbookString.d.ts → umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts} +2 -2
  95. package/umd/typings/src/conversion/prettify/{renderPromptbookMermaid.d.ts → renderPipelineMermaidOptions.d.ts} +4 -4
  96. package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
  97. package/umd/typings/src/conversion/utils/extractVariables.d.ts +1 -1
  98. package/umd/typings/src/conversion/utils/parseCommand.d.ts +2 -2
  99. package/umd/typings/src/conversion/utils/parseNumber.d.ts +1 -1
  100. package/umd/typings/src/conversion/utils/renameParameter.d.ts +4 -4
  101. package/umd/typings/src/conversion/validation/_importPipeline.d.ts +13 -0
  102. package/umd/typings/src/conversion/validation/validatePipeline.d.ts +27 -0
  103. package/{esm/typings/src/errors/PromptbookLibraryError.d.ts → umd/typings/src/errors/CollectionError.d.ts} +2 -2
  104. package/umd/typings/src/errors/{PromptbookExecutionError.d.ts → ExecutionError.d.ts} +2 -2
  105. package/{esm/typings/src/errors/PromptbookNotFoundError.d.ts → umd/typings/src/errors/NotFoundError.d.ts} +2 -2
  106. package/{esm/typings/src/errors/PromptbookLogicError.d.ts → umd/typings/src/errors/PipelineLogicError.d.ts} +2 -2
  107. package/{esm/typings/src/errors/PromptbookReferenceError.d.ts → umd/typings/src/errors/ReferenceError.d.ts} +2 -2
  108. package/umd/typings/src/errors/{PromptbookSyntaxError.d.ts → SyntaxError.d.ts} +2 -2
  109. package/umd/typings/src/errors/TemplateError.d.ts +1 -1
  110. package/umd/typings/src/errors/_ExpectError.d.ts +2 -2
  111. package/umd/typings/src/execution/ExecutionTools.d.ts +1 -1
  112. package/umd/typings/src/execution/LlmExecutionTools.d.ts +4 -4
  113. package/umd/typings/src/execution/PromptResult.d.ts +1 -1
  114. package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
  115. package/umd/typings/src/execution/createPromptbookExecutor.d.ts +3 -3
  116. package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
  117. package/umd/typings/src/execution/utils/checkExpectations.d.ts +1 -1
  118. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -1
  119. package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -1
  120. package/umd/typings/src/library/PipelineCollection.d.ts +25 -0
  121. package/umd/typings/src/library/{SimplePromptbookLibrary.d.ts → SimplePipelineCollection.d.ts} +11 -11
  122. package/{esm/typings/src/library/constructors/createLibraryFromDirectory.d.ts → umd/typings/src/library/constructors/createCollectionFromDirectory.d.ts} +5 -5
  123. package/umd/typings/src/library/constructors/createCollectionFromJson.d.ts +12 -0
  124. package/umd/typings/src/library/constructors/createCollectionFromPromise.d.ts +22 -0
  125. package/umd/typings/src/library/constructors/{createLibraryFromUrl.d.ts → createCollectionFromUrl.d.ts} +5 -5
  126. package/umd/typings/src/library/constructors/createSubcollection.d.ts +12 -0
  127. package/umd/typings/src/library/libraryToJson.d.ts +5 -5
  128. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -3
  129. package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +3 -3
  130. package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
  131. package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +3 -3
  132. package/umd/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
  133. package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -3
  134. package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -3
  135. package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
  136. package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
  137. package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +3 -3
  138. package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
  139. package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
  140. package/umd/typings/src/types/Command.d.ts +4 -4
  141. package/umd/typings/src/types/Parameters.d.ts +1 -1
  142. package/umd/typings/src/types/{PromptbookJson/PromptbookJson.d.ts → PipelineJson/PipelineJson.d.ts} +4 -4
  143. package/{esm/typings/src/types/PromptbookString.d.ts → umd/typings/src/types/PipelineString.d.ts} +3 -3
  144. package/umd/typings/src/types/Prompt.d.ts +3 -3
  145. package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +2 -2
  146. package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
  147. package/umd/typings/src/types/typeAliases.d.ts +2 -2
  148. package/umd/typings/src/utils/emojis.d.ts +2 -2
  149. package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
  150. package/umd/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
  151. package/umd/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
  152. package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
  153. package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
  154. package/umd/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
  155. package/umd/typings/src/utils/expectation-counters/index.d.ts +2 -2
  156. package/umd/typings/src/utils/formatNumber.d.ts +1 -1
  157. package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +1 -1
  158. package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
  159. package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
  160. package/umd/typings/src/utils/markdown-json/MarkdownStructure.d.ts +1 -1
  161. package/umd/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +1 -1
  162. package/umd/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +1 -1
  163. package/esm/typings/src/conversion/promptbookJsonToString.d.ts +0 -12
  164. package/esm/typings/src/conversion/promptbookStringToJson.d.ts +0 -32
  165. package/esm/typings/src/conversion/promptbookStringToJsonSync.d.ts +0 -23
  166. package/esm/typings/src/conversion/validation/_importPromptbook.d.ts +0 -13
  167. package/esm/typings/src/conversion/validation/validatePromptbook.d.ts +0 -27
  168. package/esm/typings/src/library/PromptbookLibrary.d.ts +0 -25
  169. package/esm/typings/src/library/constructors/createLibraryFromJson.d.ts +0 -12
  170. package/esm/typings/src/library/constructors/createLibraryFromPromise.d.ts +0 -22
  171. package/esm/typings/src/library/constructors/createSublibrary.d.ts +0 -12
  172. package/umd/typings/src/conversion/promptbookJsonToString.d.ts +0 -12
  173. package/umd/typings/src/conversion/promptbookStringToJson.d.ts +0 -32
  174. package/umd/typings/src/conversion/promptbookStringToJsonSync.d.ts +0 -23
  175. package/umd/typings/src/conversion/validation/_importPromptbook.d.ts +0 -13
  176. package/umd/typings/src/conversion/validation/validatePromptbook.d.ts +0 -27
  177. package/umd/typings/src/library/PromptbookLibrary.d.ts +0 -25
  178. package/umd/typings/src/library/constructors/createLibraryFromJson.d.ts +0 -12
  179. package/umd/typings/src/library/constructors/createLibraryFromPromise.d.ts +0 -22
  180. package/umd/typings/src/library/constructors/createSublibrary.d.ts +0 -12
  181. /package/esm/typings/{promptbook-library → promptbook-collection}/index.d.ts +0 -0
  182. /package/esm/typings/src/conversion/{promptbookStringToJson.test.d.ts → pipelineStringToJson.test.d.ts} +0 -0
  183. /package/esm/typings/src/conversion/{promptbookStringToJsonSync.test.d.ts → pipelineStringToJsonSync.test.d.ts} +0 -0
  184. /package/esm/typings/src/conversion/validation/{promptbookStringToJson-syntaxErrors.test.d.ts → pipelineStringToJson-syntaxErrors.test.d.ts} +0 -0
  185. /package/esm/typings/src/conversion/validation/{validatePromptbook-logicErrors.test.d.ts → validatePipeline-logicErrors.test.d.ts} +0 -0
  186. /package/esm/typings/src/conversion/validation/{validatePromptbook.test.d.ts → validatePipeline.test.d.ts} +0 -0
  187. /package/esm/typings/src/library/constructors/{createLibraryFromDirectory.test.d.ts → createCollectionFromDirectory.test.d.ts} +0 -0
  188. /package/esm/typings/src/library/constructors/{createLibraryFromJson.test.d.ts → createCollectionFromJson.test.d.ts} +0 -0
  189. /package/esm/typings/src/library/constructors/{createLibraryFromPromise.test.d.ts → createCollectionFromPromise.test.d.ts} +0 -0
  190. /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/KnowledgeJson.d.ts +0 -0
  191. /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/MaterialKnowledgePieceJson.d.ts +0 -0
  192. /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateJson.d.ts +0 -0
  193. /package/esm/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateParameterJson.d.ts +0 -0
  194. /package/umd/typings/{promptbook-library → promptbook-collection}/index.d.ts +0 -0
  195. /package/umd/typings/src/conversion/{promptbookStringToJson.test.d.ts → pipelineStringToJson.test.d.ts} +0 -0
  196. /package/umd/typings/src/conversion/{promptbookStringToJsonSync.test.d.ts → pipelineStringToJsonSync.test.d.ts} +0 -0
  197. /package/umd/typings/src/conversion/validation/{promptbookStringToJson-syntaxErrors.test.d.ts → pipelineStringToJson-syntaxErrors.test.d.ts} +0 -0
  198. /package/umd/typings/src/conversion/validation/{validatePromptbook-logicErrors.test.d.ts → validatePipeline-logicErrors.test.d.ts} +0 -0
  199. /package/umd/typings/src/conversion/validation/{validatePromptbook.test.d.ts → validatePipeline.test.d.ts} +0 -0
  200. /package/umd/typings/src/library/constructors/{createLibraryFromDirectory.test.d.ts → createCollectionFromDirectory.test.d.ts} +0 -0
  201. /package/umd/typings/src/library/constructors/{createLibraryFromJson.test.d.ts → createCollectionFromJson.test.d.ts} +0 -0
  202. /package/umd/typings/src/library/constructors/{createLibraryFromPromise.test.d.ts → createCollectionFromPromise.test.d.ts} +0 -0
  203. /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/KnowledgeJson.d.ts +0 -0
  204. /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/MaterialKnowledgePieceJson.d.ts +0 -0
  205. /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateJson.d.ts +0 -0
  206. /package/umd/typings/src/types/{PromptbookJson → PipelineJson}/PromptTemplateParameterJson.d.ts +0 -0
@@ -5,7 +5,7 @@ import type { string_char_emoji } from '../types/typeAliasEmoji';
5
5
  *
6
6
  * @see https://getemoji.com/
7
7
  *
8
- * @private within the library
8
+ * @private within the package
9
9
  * @deprecated Use /\p{Extended_Pictographic}/ instead
10
10
  */
11
11
  export declare const EMOJIS_IN_CATEGORIES: Record<string, Array<string_char_emoji>>;
@@ -13,7 +13,7 @@ export declare const EMOJIS_IN_CATEGORIES: Record<string, Array<string_char_emoj
13
13
  *
14
14
  * All possible emoji chars like "🍆", "🍡", "🍤"...
15
15
  *
16
- * @private within the library
16
+ * @private within the package
17
17
  * @deprecated Use /\p{Extended_Pictographic}/ instead
18
18
  */
19
19
  export declare const EMOJIS: Set<string_char_emoji>;
@@ -1,4 +1,4 @@
1
- import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  /**
3
3
  * Counts number of characters in the text
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  /**
3
3
  * Counts number of lines in the text
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  /**
3
3
  * Counts number of pages in the text
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  /**
3
3
  * Counts number of paragraphs in the text
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  /**
3
3
  * Split text into sentences
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  /**
3
3
  * Counts number of words in the text
4
4
  */
@@ -1,5 +1,5 @@
1
- import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
2
- import type { ExpectationUnit } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/PromptTemplateJson';
2
+ import type { ExpectationUnit } from '../../types/PipelineJson/PromptTemplateJson';
3
3
  /**
4
4
  * Index of all counter functions
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Format either small or big number
3
3
  *
4
- * @private within the library
4
+ * @private within the package
5
5
  */
6
6
  export declare function formatNumber(value: number): string;
@@ -3,7 +3,7 @@ import type { string_name } from '../../types/typeAliases';
3
3
  /**
4
4
  * Add or modify an auto-generated section in a markdown file
5
5
  *
6
- * @private within the library
6
+ * @private within the package
7
7
  */
8
8
  export declare function addAutoGeneratedSection(content: string_markdown, options: {
9
9
  sectionName: string_name;
@@ -31,7 +31,7 @@ type CreateMarkdownChartOptions = {
31
31
  /**
32
32
  * Function createMarkdownChart will draw a chart in markdown from ⬛+🟦 tiles
33
33
  *
34
- * @private within the library
34
+ * @private within the package
35
35
  */
36
36
  export declare function createMarkdownChart(options: CreateMarkdownChartOptions): string_markdown;
37
37
  export {};
@@ -3,6 +3,6 @@ import type { string_markdown_text } from '../../types/typeAliases';
3
3
  /**
4
4
  * Create a markdown table from a 2D array of strings
5
5
  *
6
- * @private within the library
6
+ * @private within the package
7
7
  */
8
8
  export declare function createMarkdownTable(table: Array<Array<string_markdown_text>>): string_markdown;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Represents the structure of a markdown file.
3
3
  *
4
- * @private within the library
4
+ * @private within the package
5
5
  */
6
6
  export type MarkdownStructure = {
7
7
  /**
@@ -2,6 +2,6 @@ import type { MarkdownStructure } from './MarkdownStructure';
2
2
  /**
3
3
  * Computes the deepness of the markdown structure.
4
4
  *
5
- * @private within the library
5
+ * @private within the package
6
6
  */
7
7
  export declare function countMarkdownStructureDeepness(markdownStructure: MarkdownStructure): number;
@@ -8,6 +8,6 @@ import type { MarkdownStructure } from './MarkdownStructure';
8
8
  * @param markdown The markdown string to parse.
9
9
  * @returns The MarkdownStructure object.
10
10
  *
11
- * @private within the library
11
+ * @private within the package
12
12
  */
13
13
  export declare function markdownToMarkdownStructure(markdown: string): MarkdownStructure;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.59.0",
4
- "description": "Library to supercharge your use of large language models",
3
+ "version": "0.60.0-3",
4
+ "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "repository": {
@@ -45,7 +45,7 @@
45
45
  }
46
46
  ],
47
47
  "peerDependencies": {
48
- "@promptbook/core": "0.59.0"
48
+ "@promptbook/core": "0.60.0-3"
49
49
  },
50
50
  "main": "./umd/index.umd.js",
51
51
  "module": "./esm/index.es.js",
package/umd/index.umd.js CHANGED
@@ -17,7 +17,7 @@
17
17
  /**
18
18
  * The version of the Promptbook library
19
19
  */
20
- var PROMPTBOOK_VERSION = '0.59.0-36';
20
+ var PROMPTBOOK_VERSION = '0.60.0-2';
21
21
 
22
22
  exports.EXPECTATION_UNITS = EXPECTATION_UNITS;
23
23
  exports.PROMPTBOOK_VERSION = PROMPTBOOK_VERSION;
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../../../src/types/PromptbookJson/PromptTemplateJson.ts","../../../../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;;;;CA2CA;;;KAGa,iBAAiB,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAW;CAmH/G;;;;;;CC/JA;;;KAGa,kBAAkB,GAAmB;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":["../../../../src/types/PipelineJson/PromptTemplateJson.ts","../../../../src/version.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;;;;;CA2CA;;;KAGa,iBAAiB,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAW;CAmH/G;;;;;;CC/JA;;;KAGa,kBAAkB,GAAmB;;;;;;;;;;;"}
@@ -1,17 +1,17 @@
1
- import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
2
- import { promptbookJsonToString } from '../conversion/promptbookJsonToString';
3
- import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
4
- import { promptbookStringToJsonSync } from '../conversion/promptbookStringToJsonSync';
5
- import { validatePromptbook } from '../conversion/validation/validatePromptbook';
6
- import { ExpectError } from '../errors/_ExpectError';
7
- import { PromptbookExecutionError } from '../errors/PromptbookExecutionError';
8
- import { PromptbookLibraryError } from '../errors/PromptbookLibraryError';
9
- import { PromptbookLogicError } from '../errors/PromptbookLogicError';
10
- import { PromptbookNotFoundError } from '../errors/PromptbookNotFoundError';
11
- import { PromptbookReferenceError } from '../errors/PromptbookReferenceError';
12
- import { PromptbookSyntaxError } from '../errors/PromptbookSyntaxError';
1
+ import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
2
+ import { pipelineStringToJson } from '../conversion/pipelineStringToJson';
3
+ import { pipelineStringToJsonSync } from '../conversion/pipelineStringToJsonSync';
4
+ import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
5
+ import { validatePipeline } from '../conversion/validation/validatePipeline';
6
+ import { CollectionError } from '../errors/CollectionError';
7
+ import { ExecutionError } from '../errors/ExecutionError';
8
+ import { NotFoundError } from '../errors/NotFoundError';
9
+ import { PipelineLogicError } from '../errors/PipelineLogicError';
10
+ import { ReferenceError } from '../errors/ReferenceError';
11
+ import { SyntaxError } from '../errors/SyntaxError';
13
12
  import { TemplateError } from '../errors/TemplateError';
14
13
  import { UnexpectedError } from '../errors/UnexpectedError';
14
+ import { ExpectError } from '../errors/_ExpectError';
15
15
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
16
16
  import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
17
17
  import { embeddingVectorToString } from '../execution/embeddingVectorToString';
@@ -22,23 +22,23 @@ import { CallbackInterfaceTools } from '../knowledge/dialogs/callback/CallbackIn
22
22
  import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callback/CallbackInterfaceToolsOptions';
23
23
  import { SimplePromptInterfaceTools } from '../knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools';
24
24
  import { prepareKnowledgeFromMarkdown } from '../knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown';
25
- import { createLibraryFromJson } from '../library/constructors/createLibraryFromJson';
26
- import { createLibraryFromPromise } from '../library/constructors/createLibraryFromPromise';
27
- import { createLibraryFromUrl } from '../library/constructors/createLibraryFromUrl';
28
- import { createSublibrary } from '../library/constructors/createSublibrary';
25
+ import { createCollectionFromJson } from '../library/constructors/createCollectionFromJson';
26
+ import { createCollectionFromPromise } from '../library/constructors/createCollectionFromPromise';
27
+ import { createCollectionFromUrl } from '../library/constructors/createCollectionFromUrl';
28
+ import { createSubcollection } from '../library/constructors/createSubcollection';
29
29
  import { libraryToJson } from '../library/libraryToJson';
30
30
  import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
31
- import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
31
+ import { ExecutionTypes } from '../types/ExecutionTypes';
32
32
  import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
33
33
  import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
34
- import { ExecutionTypes } from '../types/ExecutionTypes';
34
+ import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
35
35
  import { PROMPTBOOK_VERSION } from '../version';
36
36
  export { PROMPTBOOK_VERSION };
37
37
  export { ExecutionTypes };
38
- export { addUsage, assertsExecutionSuccessful, checkExpectations, embeddingVectorToString, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, isPassingExpectations, prepareKnowledgeFromMarkdown, prettifyPromptbookString, usageToWorktime, };
39
- export { createLibraryFromJson, createLibraryFromPromise, createLibraryFromUrl, createSublibrary, libraryToJson };
38
+ export { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, addUsage, assertsExecutionSuccessful, checkExpectations, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, prepareKnowledgeFromMarkdown, prettifyPipelineString, usageToWorktime, };
39
+ export { createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createSubcollection as createSublibrary, libraryToJson, };
40
40
  export { SimplePromptInterfaceTools };
41
- export { promptbookJsonToString, promptbookStringToJson, promptbookStringToJsonSync, validatePromptbook };
42
- export { createPromptbookExecutor, MultipleLlmExecutionTools };
41
+ export { pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, validatePipeline };
42
+ export { MultipleLlmExecutionTools, createPromptbookExecutor };
43
43
  export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
44
- export { ExpectError, PromptbookExecutionError, PromptbookLibraryError, PromptbookLogicError, PromptbookNotFoundError, PromptbookReferenceError, PromptbookSyntaxError, TemplateError, UnexpectedError, };
44
+ export { CollectionError, ExecutionError, ExpectError, NotFoundError, PipelineLogicError, ReferenceError, SyntaxError, TemplateError, UnexpectedError, };
@@ -1,4 +1,4 @@
1
- import { createLibraryFromDirectory } from '../library/constructors/createLibraryFromDirectory';
1
+ import { createCollectionFromDirectory } from '../library/constructors/createCollectionFromDirectory';
2
2
  import { PROMPTBOOK_VERSION } from '../version';
3
3
  export { PROMPTBOOK_VERSION };
4
- export { createLibraryFromDirectory };
4
+ export { createCollectionFromDirectory };
@@ -2,32 +2,32 @@ import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionTo
2
2
  import { EmbeddingVector } from '../execution/EmbeddingVector';
3
3
  import type { ExecutionTools } from '../execution/ExecutionTools';
4
4
  import type { AvailableModel, LlmExecutionTools } from '../execution/LlmExecutionTools';
5
- import type { PromptEmbeddingResult, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, UncertainNumber } from '../execution/PromptResult';
5
+ import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, UncertainNumber } from '../execution/PromptResult';
6
6
  import type { PromptbookExecutor } from '../execution/PromptbookExecutor';
7
7
  import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
8
8
  import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
9
- import type { PromptbookLibrary } from '../library/PromptbookLibrary';
9
+ import type { PipelineCollection } from '../library/PipelineCollection';
10
10
  import type { ExecutionType } from '../types/ExecutionTypes';
11
11
  import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
12
12
  import type { Parameters } from '../types/Parameters';
13
+ import { KnowledgeJson } from '../types/PipelineJson/KnowledgeJson';
14
+ import { MaterialKnowledgePieceJson } from '../types/PipelineJson/MaterialKnowledgePieceJson';
15
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
16
+ import type { ExpectationAmount, ExpectationUnit, Expectations, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
17
+ import { EXPECTATION_UNITS } from '../types/PipelineJson/PromptTemplateJson';
18
+ import type { PromptTemplateParameterJson } from '../types/PipelineJson/PromptTemplateParameterJson';
19
+ import type { PipelineString } from '../types/PipelineString';
13
20
  import type { Prompt } from '../types/Prompt';
14
- import { KnowledgeJson } from '../types/PromptbookJson/KnowledgeJson';
15
- import { MaterialKnowledgePieceJson } from '../types/PromptbookJson/MaterialKnowledgePieceJson';
16
- import type { ExpectationAmount, Expectations, ExpectationUnit, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
17
- import { EXPECTATION_UNITS } from '../types/PromptbookJson/PromptTemplateJson';
18
- import type { PromptTemplateParameterJson } from '../types/PromptbookJson/PromptTemplateParameterJson';
19
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
20
- import type { PromptbookString } from '../types/PromptbookString';
21
21
  import type { ScriptLanguage } from '../types/ScriptLanguage';
22
22
  import type { TaskProgress } from '../types/TaskProgress';
23
23
  import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
24
24
  import type { string_char_emoji } from '../types/typeAliasEmoji';
25
- import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, 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_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, 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_version } from '../types/typeAliases';
25
+ import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, 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_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_version } from '../types/typeAliases';
26
26
  import type { FromtoItems } from '../utils/FromtoItems';
27
27
  import { PROMPTBOOK_VERSION } from '../version';
28
28
  export { PROMPTBOOK_VERSION };
29
29
  export { EXPECTATION_UNITS };
30
- export type { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, KnowledgeJson, LlmExecutionTools, LlmTemplateJson, MaterialKnowledgePieceJson, ModelRequirements, ModelVariant, Parameters, Prompt, PromptbookExecutor, PromptbookJson, PromptbookLibrary, PromptbookString, PromptChatResult, PromptEmbeddingResult, EmbeddingVector, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, 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_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, 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_version, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, };
30
+ export type { AvailableModel, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems, KnowledgeJson, LlmExecutionTools, LlmTemplateJson, MaterialKnowledgePieceJson, ModelRequirements, ModelVariant, Parameters, PipelineCollection, PipelineJson, PipelineString, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, PromptbookExecutor, 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_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_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_version, };
31
31
  /**
32
32
  * TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
33
33
  */
@@ -1,5 +1,5 @@
1
1
  import { spaceTrim } from 'spacetrim';
2
- import { renderPromptbookMermaid } from '../conversion/prettify/renderPromptbookMermaid';
2
+ import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
3
3
  import { extractParametersFromPromptTemplate } from '../conversion/utils/extractParametersFromPromptTemplate';
4
4
  import { extractVariables } from '../conversion/utils/extractVariables';
5
5
  import { parseNumber } from '../conversion/utils/parseNumber';
@@ -8,32 +8,30 @@ import { titleToName } from '../conversion/utils/titleToName';
8
8
  import { forEachAsync } from '../execution/utils/forEachAsync';
9
9
  import { replaceParameters } from '../execution/utils/replaceParameters';
10
10
  import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
11
- import { CountUtils } from '../utils/expectation-counters/index';
12
11
  import { countCharacters } from '../utils/expectation-counters/countCharacters';
13
12
  import { countLines } from '../utils/expectation-counters/countLines';
14
13
  import { countPages } from '../utils/expectation-counters/countPages';
15
14
  import { countParagraphs } from '../utils/expectation-counters/countParagraphs';
16
- import { countSentences } from '../utils/expectation-counters/countSentences';
17
- import { splitIntoSentences } from '../utils/expectation-counters/countSentences';
15
+ import { countSentences, splitIntoSentences } from '../utils/expectation-counters/countSentences';
18
16
  import { countWords } from '../utils/expectation-counters/countWords';
17
+ import { CountUtils } from '../utils/expectation-counters/index';
19
18
  import { extractParameters } from '../utils/extractParameters';
20
19
  import { extractAllBlocksFromMarkdown } from '../utils/markdown/extractAllBlocksFromMarkdown';
21
20
  import { extractAllListItemsFromMarkdown } from '../utils/markdown/extractAllListItemsFromMarkdown';
22
21
  import { extractOneBlockFromMarkdown } from '../utils/markdown/extractOneBlockFromMarkdown';
23
22
  import { removeContentComments } from '../utils/markdown/removeContentComments';
24
23
  import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
24
+ import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
25
+ import type { IKeywords, string_keyword } from '../utils/normalization/IKeywords';
25
26
  import { capitalize } from '../utils/normalization/capitalize';
26
27
  import { decapitalize } from '../utils/normalization/decapitalize';
27
- import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
28
- import type { IKeywords } from '../utils/normalization/IKeywords';
29
- import type { string_keyword } from '../utils/normalization/IKeywords';
30
28
  import { isValidKeyword } from '../utils/normalization/isValidKeyword';
31
29
  import { nameToUriPart } from '../utils/normalization/nameToUriPart';
32
30
  import { nameToUriParts } from '../utils/normalization/nameToUriParts';
33
31
  import { normalizeToKebabCase } from '../utils/normalization/normalize-to-kebab-case';
34
- import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
35
32
  import { normalizeTo_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
36
33
  import { normalizeTo_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
34
+ import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
37
35
  import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
38
36
  import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
39
37
  import { parseKeywords } from '../utils/normalization/parseKeywords';
@@ -50,12 +48,12 @@ import { trimCodeBlock } from '../utils/trimCodeBlock';
50
48
  import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
51
49
  import { unwrapResult } from '../utils/unwrapResult';
52
50
  import { PROMPTBOOK_VERSION } from '../version';
53
- export { forEachAsync, PROMPTBOOK_VERSION };
51
+ export { PROMPTBOOK_VERSION, forEachAsync };
54
52
  export { extractAllBlocksFromMarkdown, // <- [🌻]
55
53
  extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
56
54
  extractOneBlockFromMarkdown, extractParameters, extractVariables, isValidJsonString, parseNumber, // <- [🌻]
57
55
  removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
58
- export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
56
+ export { CountUtils, countCharacters, countLines, countPages, countParagraphs, countSentences, countWords };
59
57
  export { splitIntoSentences };
60
58
  export declare const normalizeTo: {
61
59
  camelCase: typeof normalizeTo_camelCase;
@@ -64,7 +62,7 @@ export declare const normalizeTo: {
64
62
  snake_case: typeof normalizeTo_snake_case;
65
63
  'kebab-case': typeof normalizeToKebabCase;
66
64
  };
67
- 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, };
65
+ export { DIACRITIC_VARIANTS_LETTERS, IKeywords, capitalize, decapitalize, isValidKeyword, nameToUriPart, nameToUriParts, normalizeToKebabCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_camelCase, normalizeTo_snake_case, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, titleToName, };
68
66
  export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
69
67
  export { difference, intersection, union };
70
68
  /**
@@ -7,6 +7,6 @@ export declare const LOOP_LIMIT = 1000;
7
7
  */
8
8
  export declare const CHARACTER_LOOP_LIMIT = 100000;
9
9
  /**
10
- * The name of the builded promptbook library made by CLI `promptbook make` and for lookup in `createLibraryFromDirectory`
10
+ * The name of the builded promptbook library made by CLI `promptbook make` and for lookup in `createCollectionFromDirectory`
11
11
  */
12
12
  export declare const PROMPTBOOK_MAKED_BASE_FILENAME = "index";
@@ -0,0 +1,12 @@
1
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
2
+ import type { PipelineString } from '../types/PipelineString';
3
+ /**
4
+ * Converts promptbook in JSON format to string format
5
+ *
6
+ * @param pipelineJson Promptbook in JSON format (.ptbk.json)
7
+ * @returns Promptbook in string format (.ptbk.md)
8
+ */
9
+ export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
10
+ /**
11
+ * TODO: Escape all
12
+ */
@@ -0,0 +1,32 @@
1
+ import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
2
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
3
+ import type { PipelineString } from '../types/PipelineString';
4
+ /**
5
+ * Options for pipelineStringToJson
6
+ */
7
+ type PipelineStringToJsonOptions = {
8
+ /**
9
+ * Tools for processing required for knowledge processing *(not for actual execution)*
10
+ */
11
+ llmTools?: LlmExecutionTools;
12
+ };
13
+ /**
14
+ * Compile promptbook from string (markdown) format to JSON format
15
+ *
16
+ * Note: There are two similar functions:
17
+ * - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
18
+ * - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
19
+ *
20
+ * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
21
+ * @param options - Options and tools for the compilation
22
+ * @returns {Promptbook} compiled in JSON format (.ptbk.json)
23
+ * @throws {SyntaxError} if the promptbook string is not valid
24
+ *
25
+ * Note: This function does not validate logic of the pipeline only the syntax
26
+ * Note: This function acts as compilation process
27
+ */
28
+ export declare function pipelineStringToJson(pipelineString: PipelineString, options?: PipelineStringToJsonOptions): Promise<PipelineJson>;
29
+ export {};
30
+ /**
31
+ * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
32
+ */
@@ -0,0 +1,23 @@
1
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
2
+ import type { PipelineString } from '../types/PipelineString';
3
+ /**
4
+ * Compile promptbook from string (markdown) format to JSON format synchronously
5
+ *
6
+ * Note: There are two similar functions:
7
+ * - `pipelineStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
8
+ * - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
9
+ *
10
+ * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
11
+ * @param options - Options and tools for the compilation
12
+ * @returns {Promptbook} compiled in JSON format (.ptbk.json)
13
+ * @throws {SyntaxError} if the promptbook string is not valid
14
+ *
15
+ * Note: This function does not validate logic of the pipeline only the syntax
16
+ * Note: This function acts as compilation process
17
+ */
18
+ export declare function pipelineStringToJsonSync(pipelineString: PipelineString): PipelineJson;
19
+ /**
20
+ * TODO: Report here line/column of error
21
+ * TODO: Use spaceTrim more effectively
22
+ * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
23
+ */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Options for `prettifyPromptbookString` function
2
+ * Options for `prettifyPipelineString` function
3
3
  */
4
4
  export type PrettifyOptions = {
5
5
  /***
@@ -1,9 +1,9 @@
1
- import type { PromptbookString } from '../../types/PromptbookString';
1
+ import type { PipelineString } from '../../types/PipelineString';
2
2
  import type { PrettifyOptions } from './PrettifyOptions';
3
3
  /**
4
4
  * Prettyfies Promptbook string and adds Mermaid graph
5
5
  */
6
- export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): Promise<PromptbookString>;
6
+ export declare function prettifyPipelineString(pipelineString: PipelineString, options: PrettifyOptions): Promise<PipelineString>;
7
7
  /**
8
8
  * TODO: Maybe use some Mermaid library instead of string templating
9
9
  * TODO: [🕌] When more than 2 functionalities, split into separate functions
@@ -1,10 +1,10 @@
1
- import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
- import type { PromptTemplateJson } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
+ import type { PromptTemplateJson } from '../../types/PipelineJson/PromptTemplateJson';
3
3
  import type { string_href } from '../../types/typeAliases';
4
4
  /**
5
5
  * Addtional options for rendering Mermaid graph
6
6
  */
7
- export type renderPromptbookMermaidOptions = {
7
+ export type renderPipelineMermaidOptions = {
8
8
  /**
9
9
  * Callback for creating from prompt template graph node
10
10
  */
@@ -18,7 +18,7 @@ export type renderPromptbookMermaidOptions = {
18
18
  *
19
19
  * Note: The result is not wrapped in a Markdown code block
20
20
  */
21
- export declare function renderPromptbookMermaid(promptbookJson: PromptbookJson, options?: renderPromptbookMermaidOptions): string;
21
+ export declare function renderPromptbookMermaid(pipelineJson: PipelineJson, options?: renderPipelineMermaidOptions): string;
22
22
  /**
23
23
  * TODO: Maybe use some Mermaid library instead of string templating
24
24
  * TODO: [🕌] When more than 2 functionalities, split into separate functions
@@ -1,11 +1,11 @@
1
- import type { PromptTemplateJson } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { PromptTemplateJson } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  import type { string_name } from '../../types/typeAliases';
3
3
  /**
4
4
  * Parses the prompt template and returns the set of all used parameters
5
5
  *
6
6
  * @param promptTemplate the template with used parameters
7
7
  * @returns the set of parameter names
8
- * @throws {PromptbookSyntaxError} if the script is invalid
8
+ * @throws {SyntaxError} if the script is invalid
9
9
  */
10
10
  export declare function extractParametersFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | 'executionType' | 'content'>): Set<string_name>;
11
11
  /**
@@ -5,7 +5,7 @@ import type { string_javascript_name } from '../../types/typeAliases';
5
5
  *
6
6
  * @param script from which to extract the variables
7
7
  * @returns the list of variable names
8
- * @throws {PromptbookSyntaxError} if the script is invalid
8
+ * @throws {SyntaxError} if the script is invalid
9
9
  */
10
10
  export declare function extractVariables(script: string_javascript): Set<string_javascript_name>;
11
11
  /**
@@ -4,8 +4,8 @@ import type { string_markdown_text } from '../../types/typeAliases';
4
4
  * Parses one line of ul/ol to command
5
5
  *
6
6
  * @returns parsed command object
7
- * @throws {PromptbookSyntaxError} if the command is invalid
7
+ * @throws {SyntaxError} if the command is invalid
8
8
  *
9
- * @private within the promptbookStringToJson
9
+ * @private within the pipelineStringToJson
10
10
  */
11
11
  export declare function parseCommand(listItem: string_markdown_text): Command;
@@ -5,7 +5,7 @@
5
5
  * Note: it also works only with decimal numbers
6
6
  *
7
7
  * @returns parsed number
8
- * @throws {PromptbookSyntaxError} if the value is not a number
8
+ * @throws {SyntaxError} if the value is not a number
9
9
  *
10
10
  * @private within the parseCommand
11
11
  */
@@ -1,11 +1,11 @@
1
- import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
1
+ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
2
  import type { string_name } from '../../types/typeAliases';
3
3
  type RenameParameterOptions = {
4
4
  /**
5
5
  * Promptbook to search and replace for parameters
6
6
  * This promptbook is returned as copy with replaced parameters
7
7
  */
8
- promptbook: PromptbookJson;
8
+ promptbook: PipelineJson;
9
9
  /**
10
10
  * Original parameter name that should be replaced
11
11
  */
@@ -19,7 +19,7 @@ type RenameParameterOptions = {
19
19
  * Function renameParameter will find all usable parameters for given prompt template
20
20
  * In other words, it will find all parameters that are not used in the prompt template itseld and all its dependencies
21
21
  *
22
- * @throws {PromptbookLogicError} If the new parameter name is already used in the promptbook
22
+ * @throws {PipelineLogicError} If the new parameter name is already used in the promptbook
23
23
  */
24
- export declare function renameParameter(options: RenameParameterOptions): PromptbookJson;
24
+ export declare function renameParameter(options: RenameParameterOptions): PipelineJson;
25
25
  export {};
@@ -0,0 +1,13 @@
1
+ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
+ import type { PipelineString } from '../../types/PipelineString';
3
+ /**
4
+ * Import the text file
5
+ *
6
+ * Note: Using here custom import to work in jest tests
7
+ * Note: Using sync version is 💩 in the production code, but it's ok here in tests
8
+ *
9
+ * @param path - The path to the file relative to samples/templates directory
10
+ * @private
11
+ */
12
+ export declare function importPipeline(path: `${string}.ptbk.md`): PipelineString;
13
+ export declare function importPipeline(path: `${string}.ptbk.json`): PipelineJson;