@promptbook/openai 0.60.0-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 +8 -8
  2. package/esm/index.es.js +25 -25
  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 +25 -25
  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
@@ -22,11 +22,11 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
22
22
  /**
23
23
  * Calls Anthropic Claude API to use a chat model.
24
24
  */
25
- gptChat(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
25
+ callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
26
26
  /**
27
27
  * Calls Anthropic Claude API to use a complete model.
28
28
  */
29
- gptComplete(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
29
+ callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
30
30
  /**
31
31
  * Get the model that should be used as default
32
32
  */
@@ -43,6 +43,6 @@ export declare class AnthropicClaudeExecutionTools implements LlmExecutionTools
43
43
  /**
44
44
  * TODO: !!!! [🍆] JSON mode
45
45
  * TODO: [🧠] Maybe handle errors via transformAnthropicError (like transformAzureError)
46
- * TODO: Maybe Create some common util for gptChat and gptComplete
46
+ * TODO: Maybe Create some common util for callChatModel and callCompletionModel
47
47
  * TODO: Maybe make custom OpenaiError
48
48
  */
@@ -22,11 +22,11 @@ export declare class AzureOpenAiExecutionTools implements LlmExecutionTools {
22
22
  /**
23
23
  * Calls OpenAI API to use a chat model.
24
24
  */
25
- gptChat(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
25
+ callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
26
26
  /**
27
27
  * Calls Azure OpenAI API to use a complete model.
28
28
  */
29
- gptComplete(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
29
+ callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
30
30
  /**
31
31
  * Changes Azure error (which is not propper Error but object) to propper Error
32
32
  */
@@ -37,6 +37,6 @@ export declare class AzureOpenAiExecutionTools implements LlmExecutionTools {
37
37
  listModels(): Promise<Array<AvailableModel>>;
38
38
  }
39
39
  /**
40
- * TODO: Maybe Create some common util for gptChat and gptComplete
40
+ * TODO: Maybe Create some common util for callChatModel and callCompletionModel
41
41
  * TODO: Maybe make custom AzureOpenaiError
42
42
  */
@@ -13,11 +13,11 @@ export declare class MockedEchoLlmExecutionTools implements LlmExecutionTools {
13
13
  /**
14
14
  * Mocks chat model
15
15
  */
16
- gptChat(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
16
+ callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
17
17
  /**
18
18
  * Mocks completion model
19
19
  */
20
- gptComplete(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
20
+ callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
21
21
  /**
22
22
  * List all available mocked-models that can be used
23
23
  */
@@ -13,11 +13,11 @@ export declare class MockedFackedLlmExecutionTools implements LlmExecutionTools
13
13
  /**
14
14
  * Fakes chat model
15
15
  */
16
- gptChat(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptChatResult & PromptCompletionResult>;
16
+ callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptChatResult & PromptCompletionResult>;
17
17
  /**
18
18
  * Fakes completion model
19
19
  */
20
- gptComplete(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptCompletionResult>;
20
+ callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectations' | 'postprocessing'>): Promise<PromptCompletionResult>;
21
21
  /**
22
22
  * List all available fake-models that can be used
23
23
  */
@@ -25,4 +25,4 @@ export declare class MockedFackedLlmExecutionTools implements LlmExecutionTools
25
25
  }
26
26
  /**
27
27
  * TODO: [🕵️‍♀️] Maybe just remove
28
- */
28
+ */
@@ -1,5 +1,5 @@
1
1
  import type { PostprocessingFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
2
- import type { Expectations } from '../../types/PromptbookJson/PromptTemplateJson';
2
+ import type { Expectations } from '../../types/PipelineJson/PromptTemplateJson';
3
3
  /**
4
4
  * Gets the expectations and creates a fake text that meets the expectations
5
5
  *
@@ -20,15 +20,15 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
20
20
  /**
21
21
  * Calls the best available chat model
22
22
  */
23
- gptChat(prompt: Prompt): Promise<PromptChatResult>;
23
+ callChatModel(prompt: Prompt): Promise<PromptChatResult>;
24
24
  /**
25
25
  * Calls the best available completion model
26
26
  */
27
- gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
27
+ callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
28
28
  /**
29
29
  * Calls the best available model
30
30
  */
31
- private gptCommon;
31
+ private callModelCommon;
32
32
  /**
33
33
  * List all available models that can be used
34
34
  * This liost is a combination of all available models from all execution tools
@@ -23,11 +23,11 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
23
23
  /**
24
24
  * Calls OpenAI API to use a chat model.
25
25
  */
26
- gptChat(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectFormat'>): Promise<PromptChatResult>;
26
+ callChatModel(prompt: Pick<Prompt, 'content' | 'modelRequirements' | 'expectFormat'>): Promise<PromptChatResult>;
27
27
  /**
28
28
  * Calls OpenAI API to use a complete model.
29
29
  */
30
- gptComplete(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
30
+ callCompletionModel(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
31
31
  /**
32
32
  * Calls OpenAI API to use a embedding model
33
33
  */
@@ -55,6 +55,6 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
55
55
  }
56
56
  /**
57
57
  * TODO: [🧠][🧙‍♂️] Maybe there can be some wizzard for thoose who want to use just OpenAI
58
- * TODO: Maybe Create some common util for gptChat and gptComplete
58
+ * TODO: Maybe Create some common util for callChatModel and callCompletionModel
59
59
  * TODO: Maybe make custom OpenaiError
60
60
  */
@@ -7,7 +7,7 @@ import type { Prompt } from '../../types/Prompt';
7
7
  * @param promptContent The content of the prompt
8
8
  * @param resultContent The content of the result (for embedding prompts or failed prompts pass empty string)
9
9
  * @param rawResponse The raw response from OpenAI API
10
- * @throws {PromptbookExecutionError} If the usage is not defined in the response from OpenAI
10
+ * @throws {ExecutionError} If the usage is not defined in the response from OpenAI
11
11
  * @private internal util of `OpenAiExecutionTools`
12
12
  */
13
13
  export declare function computeOpenaiUsage(promptContent: Prompt['content'], // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
@@ -4,13 +4,13 @@
4
4
  * @see https://openai.com/api/pricing/
5
5
  * @see https://docs.anthropic.com/en/docs/models-overview
6
6
  *
7
- * @private within the library, used only as internal helper for `OPENAI_MODELS` and `computeUsage`
7
+ * @private within the package, used only as internal helper for `OPENAI_MODELS` and `computeUsage`
8
8
  */
9
9
  type string_model_price = `$${number}.${number} / ${number}M tokens`;
10
10
  /**
11
11
  * Function computeUsage will create price per one token based on the string value found on openai page
12
12
  *
13
- * @private within the library, used only as internal helper for `OPENAI_MODELS`
13
+ * @private within the package, used only as internal helper for `OPENAI_MODELS`
14
14
  */
15
15
  export declare function computeUsage(value: string_model_price): number;
16
16
  export {};
@@ -22,15 +22,15 @@ export declare class RemoteLlmExecutionTools implements LlmExecutionTools {
22
22
  /**
23
23
  * Calls remote proxy server to use a chat model.
24
24
  */
25
- gptChat(prompt: Prompt): Promise<PromptChatResult>;
25
+ callChatModel(prompt: Prompt): Promise<PromptChatResult>;
26
26
  /**
27
27
  * Calls remote proxy server to use a completion model.
28
28
  */
29
- gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
29
+ callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
30
30
  /**
31
31
  * Calls remote proxy server to use both completion or chat model.
32
32
  */
33
- private gptCommon;
33
+ private callModelCommon;
34
34
  /**
35
35
  * List all available models that can be used
36
36
  */
@@ -1,6 +1,6 @@
1
1
  import type { CommonExecutionToolsOptions } from '../../../execution/CommonExecutionToolsOptions';
2
2
  import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
3
- import type { PromptbookLibrary } from '../../../library/PromptbookLibrary';
3
+ import type { PipelineCollection } from '../../../library/PipelineCollection';
4
4
  import type { client_id } from '../../../types/typeAliases';
5
5
  import type { string_uri } from '../../../types/typeAliases';
6
6
  export type RemoteServerOptions = CommonExecutionToolsOptions & {
@@ -20,7 +20,7 @@ export type RemoteServerOptions = CommonExecutionToolsOptions & {
20
20
  *
21
21
  * This is used to checkl validity of the prompt to prevent DDoS
22
22
  */
23
- readonly library: PromptbookLibrary;
23
+ readonly library: PipelineCollection;
24
24
  /**
25
25
  * Creates llm execution tools for each client
26
26
  */
@@ -10,7 +10,7 @@ import type { RemoteServerOptions } from './interfaces/RemoteServerOptions';
10
10
  */
11
11
  export declare function startRemoteServer(options: RemoteServerOptions): IDestroyable;
12
12
  /**
13
- * TODO: [⚖] Expose the library to be able to connect to same library via createLibraryFromUrl
13
+ * TODO: [⚖] Expose the library to be able to connect to same library via createCollectionFromUrl
14
14
  * TODO: Handle progress - support streaming
15
15
  * TODO: [🤹‍♂️] Do not hang up immediately but wait until client closes OR timeout
16
16
  * TODO: [🤹‍♂️] Timeout on chat to free up resources
@@ -1,10 +1,10 @@
1
+ import type { ExecutionType } from './ExecutionTypes';
2
+ import type { ModelRequirements } from './ModelRequirements';
3
+ import type { ExpectationAmount } from './PipelineJson/PromptTemplateJson';
4
+ import type { ExpectationUnit } from './PipelineJson/PromptTemplateJson';
1
5
  import type { string_markdown_text } from './typeAliases';
2
6
  import type { string_name } from './typeAliases';
3
7
  import type { string_version } from './typeAliases';
4
- import type { ExecutionType } from './ExecutionTypes';
5
- import type { ModelRequirements } from './ModelRequirements';
6
- import type { ExpectationAmount } from './PromptbookJson/PromptTemplateJson';
7
- import type { ExpectationUnit } from './PromptbookJson/PromptTemplateJson';
8
8
  /**
9
9
  * Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
10
10
  * It is parsed from the markdown from ul/ol items - one command per one item.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parameters of the prompt template (pipeline)
2
+ * Parameters of the pipeline
3
3
  *
4
4
  * There are three types of parameters:
5
5
  * - **INPUT PARAMETERs** are required to execute the pipeline.
@@ -1,5 +1,5 @@
1
1
  import type { string_markdown_text } from '../typeAliases';
2
- import type { string_promptbook_url } from '../typeAliases';
2
+ import type { string_pipeline_url } from '../typeAliases';
3
3
  import type { string_version } from '../typeAliases';
4
4
  import type { KnowledgeJson } from './KnowledgeJson';
5
5
  import type { PromptTemplateJson } from './PromptTemplateJson';
@@ -8,9 +8,9 @@ import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson'
8
8
  * Promptbook is the **core concept of this library**.
9
9
  * It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
10
10
  *
11
- * @see https://github.com/webgptorg/promptbook#promptbook
11
+ * @see !!! https://github.com/webgptorg/promptbook#promptbook
12
12
  */
13
- export type PromptbookJson = {
13
+ export type PipelineJson = {
14
14
  /**
15
15
  * Unique identifier of the promptbook
16
16
  *
@@ -20,7 +20,7 @@ export type PromptbookJson = {
20
20
  * For example: https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@1.0.0
21
21
  * Warning: Do not hash part of the URL, hash part is used for identification of the prompt template in the pipeline
22
22
  */
23
- readonly promptbookUrl?: string_promptbook_url;
23
+ readonly promptbookUrl?: string_pipeline_url;
24
24
  /**
25
25
  * Title of the promptbook
26
26
  * -It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
@@ -2,11 +2,11 @@
2
2
  * Promptbook is the **core concept of this library**.
3
3
  * It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
4
4
  *
5
- * @see https://github.com/webgptorg/promptbook#promptbook
5
+ * @see !!! https://github.com/webgptorg/promptbook#promptbook
6
6
  */
7
- export type PromptbookString = string & {
7
+ export type PipelineString = string & {
8
8
  readonly _type: 'Promptbook';
9
9
  };
10
10
  /**
11
- * TODO: !! Better validation (validatePromptbookString) or remove branded type and make it just string
11
+ * TODO: !! Better validation (validatePipelineString) or remove branded type and make it just string
12
12
  */
@@ -1,10 +1,10 @@
1
1
  import type { PostprocessingFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
2
2
  import type { ExpectFormatCommand } from './Command';
3
3
  import type { ModelRequirements } from './ModelRequirements';
4
- import type { Expectations } from './PromptbookJson/PromptTemplateJson';
4
+ import type { Expectations } from './PipelineJson/PromptTemplateJson';
5
5
  import type { string_name } from './typeAliases';
6
+ import type { string_pipeline_url_with_hashtemplate } from './typeAliases';
6
7
  import type { string_prompt } from './typeAliases';
7
- import type { string_promptbook_url_with_hashtemplate } from './typeAliases';
8
8
  import type { string_title } from './typeAliases';
9
9
  /**
10
10
  * Prompt in a text along with model requirements, but without any execution or templating logic.
@@ -52,7 +52,7 @@ export type Prompt = {
52
52
  *
53
53
  * @example https://promptbook.webgpt.com/cs/write-website-content.ptbk.md#keywords
54
54
  */
55
- readonly promptbookUrl: string_promptbook_url_with_hashtemplate;
55
+ readonly promptbookUrl: string_pipeline_url_with_hashtemplate;
56
56
  /**
57
57
  * Parameters used in the prompt
58
58
  *
@@ -1,7 +1,7 @@
1
1
  import type { PromptResult } from '../../execution/PromptResult';
2
2
  import type { Prompt } from '../Prompt';
3
3
  import type { string_markdown_text } from '../typeAliases';
4
- import type { string_promptbook_url } from '../typeAliases';
4
+ import type { string_pipeline_url } from '../typeAliases';
5
5
  import type { string_version } from '../typeAliases';
6
6
  /**
7
7
  * ExecutionReport is result of executing one promptbook
@@ -17,7 +17,7 @@ export type ExecutionReportJson = {
17
17
  /**
18
18
  * Unique identifier of the promptbook from promptbook which was executed
19
19
  */
20
- readonly promptbookUrl?: string_promptbook_url;
20
+ readonly promptbookUrl?: string_pipeline_url;
21
21
  /**
22
22
  * Title of from promptbook which was executed
23
23
  */
@@ -2,6 +2,6 @@ import type { FromtoItems } from '../../utils/FromtoItems';
2
2
  /**
3
3
  * Count the duration of working time
4
4
  *
5
- * @private within the library
5
+ * @private within the package
6
6
  */
7
7
  export declare function countWorkingDuration(items: FromtoItems): number;
@@ -181,13 +181,13 @@ export type string_url = string;
181
181
  *
182
182
  * For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md"`
183
183
  */
184
- export type string_promptbook_url = string;
184
+ export type string_pipeline_url = string;
185
185
  /**
186
186
  * Semantic helper
187
187
  *
188
188
  * For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md#keywords"`
189
189
  */
190
- export type string_promptbook_url_with_hashtemplate = string;
190
+ export type string_pipeline_url_with_hashtemplate = string;
191
191
  /**
192
192
  * Semantic helper
193
193
  *
@@ -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;
@@ -1,12 +0,0 @@
1
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
- import type { PromptbookString } from '../types/PromptbookString';
3
- /**
4
- * Converts promptbook in JSON format to string format
5
- *
6
- * @param promptbookJson Promptbook in JSON format (.ptbk.json)
7
- * @returns Promptbook in string format (.ptbk.md)
8
- */
9
- export declare function promptbookJsonToString(promptbookJson: PromptbookJson): PromptbookString;
10
- /**
11
- * TODO: Escape all
12
- */
@@ -1,32 +0,0 @@
1
- import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
2
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
3
- import type { PromptbookString } from '../types/PromptbookString';
4
- /**
5
- * Options for promptbookStringToJson
6
- */
7
- type PromptbookStringToJsonOptions = {
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
- * - `promptbookStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
18
- * - `promptbookStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
19
- *
20
- * @param promptbookString {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 {PromptbookSyntaxError} 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 promptbookStringToJson(promptbookString: PromptbookString, options?: PromptbookStringToJsonOptions): Promise<PromptbookJson>;
29
- export {};
30
- /**
31
- * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
32
- */
@@ -1,23 +0,0 @@
1
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
- import type { PromptbookString } from '../types/PromptbookString';
3
- /**
4
- * Compile promptbook from string (markdown) format to JSON format synchronously
5
- *
6
- * Note: There are two similar functions:
7
- * - `promptbookStringToJson` **(preferred)** - which propperly compiles the promptbook and use embedding for external knowledge
8
- * - `promptbookStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
9
- *
10
- * @param promptbookString {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 {PromptbookSyntaxError} 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 promptbookStringToJsonSync(promptbookString: PromptbookString): PromptbookJson;
19
- /**
20
- * TODO: Report here line/column of error
21
- * TODO: Use spaceTrim more effectively
22
- * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
23
- */
@@ -1,13 +0,0 @@
1
- import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
- import type { PromptbookString } from '../../types/PromptbookString';
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 importPromptbook(path: `${string}.ptbk.md`): PromptbookString;
13
- export declare function importPromptbook(path: `${string}.ptbk.json`): PromptbookJson;
@@ -1,27 +0,0 @@
1
- import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
- /**
3
- * Validates PromptbookJson if it is logically valid
4
- *
5
- * It checks:
6
- * - if it has correct parameters dependency
7
- *
8
- * It does NOT check:
9
- * - if it is valid json
10
- * - if it is meaningful
11
- *
12
- * @param promptbook valid or invalid PromptbookJson
13
- * @returns the same promptbook if it is logically valid
14
- * @throws {PromptbookLogicError} on logical error in the promptbook
15
- */
16
- export declare function validatePromptbook(promptbook: PromptbookJson): PromptbookJson;
17
- /**
18
- * TODO: [🧠] Work with promptbookVersion
19
- * TODO: Use here some json-schema, Zod or something similar and change it to:
20
- * > /**
21
- * > * Validates PromptbookJson if it is logically valid.
22
- * > *
23
- * > * It checks:
24
- * > * - it has a valid structure
25
- * > * - ...
26
- * > ex port function validatePromptbook(promptbook: unknown): asserts promptbook is PromptbookJson {
27
- */
@@ -1,25 +0,0 @@
1
- import type { Promisable } from 'type-fest';
2
- import type { Prompt } from '../types/Prompt';
3
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
4
- import type { string_promptbook_url } from '../types/typeAliases';
5
- /**
6
- * Library of promptbooks that groups together promptbooks for an application.
7
- *
8
- * @see https://github.com/webgptorg/promptbook#promptbook-library
9
- */
10
- export type PromptbookLibrary = {
11
- /**
12
- * Gets all promptbooks in the library
13
- */
14
- listPromptbooks(): Promisable<Array<string_promptbook_url>>;
15
- /**
16
- * Gets promptbook by its URL
17
- *
18
- * Note: This is not a direct fetching from the URL, but a lookup in the library
19
- */
20
- getPromptbookByUrl(url: string_promptbook_url): Promisable<PromptbookJson>;
21
- /**
22
- * Checks whether given prompt was defined in any promptbook in the library
23
- */
24
- isResponsibleForPrompt(prompt: Prompt): Promisable<boolean>;
25
- };