@promptbook/remote-client 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 +2 -2
  2. package/esm/index.es.js +8 -8
  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 +8 -8
  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
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This error indicates errors during the execution of the promptbook
3
3
  */
4
- export declare class PromptbookExecutionError extends Error {
5
- readonly name = "PromptbookExecutionError";
4
+ export declare class ExecutionError extends Error {
5
+ readonly name = "ExecutionError";
6
6
  constructor(message: string);
7
7
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This error indicates that promptbook not found in the library
3
3
  */
4
- export declare class PromptbookNotFoundError extends Error {
5
- readonly name = "PromptbookNotFoundError";
4
+ export declare class NotFoundError extends Error {
5
+ readonly name = "NotFoundError";
6
6
  constructor(message: string);
7
7
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
3
3
  */
4
- export declare class PromptbookLogicError extends Error {
5
- readonly name = "PromptbookLogicError";
4
+ export declare class PipelineLogicError extends Error {
5
+ readonly name = "PipelineLogicError";
6
6
  constructor(message: string);
7
7
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This error indicates errors in referencing promptbooks between each other
3
3
  */
4
- export declare class PromptbookReferenceError extends Error {
5
- readonly name = "PromptbookReferenceError";
4
+ export declare class ReferenceError extends Error {
5
+ readonly name = "ReferenceError";
6
6
  constructor(message: string);
7
7
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
3
3
  */
4
- export declare class PromptbookSyntaxError extends Error {
5
- readonly name = "PromptbookSyntaxError";
4
+ export declare class SyntaxError extends Error {
5
+ readonly name = "SyntaxError";
6
6
  constructor(message: string);
7
7
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This error occurs during the parameter replacement in the template
3
3
  *
4
- * Note: This is a kindof subtype of PromptbookExecutionError because it occurs during the execution of the pipeline
4
+ * Note: This is a kindof subtype of ExecutionError because it occurs during the execution of the pipeline
5
5
  */
6
6
  export declare class TemplateError extends Error {
7
7
  readonly name = "TemplateError";
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This error occurs when some expectation is not met in the execution of the pipeline
3
3
  *
4
- * @private Always catched and rethrown as `PromptbookExecutionError`
5
- * Note: This is a kindof subtype of PromptbookExecutionError
4
+ * @private Always catched and rethrown as `ExecutionError`
5
+ * Note: This is a kindof subtype of ExecutionError
6
6
  */
7
7
  export declare class ExpectError extends Error {
8
8
  readonly name = "ExpectError";
@@ -2,7 +2,7 @@ import type { LlmExecutionTools } from './LlmExecutionTools';
2
2
  import type { ScriptExecutionTools } from './ScriptExecutionTools';
3
3
  import type { UserInterfaceTools } from './UserInterfaceTools';
4
4
  /**
5
- * All the tools needed to execute prompts (template pipelines).
5
+ * All the tools needed to execute pipelines.
6
6
  *
7
7
  * @see https://github.com/webgptorg/promptbook#execution-tools
8
8
  */
@@ -16,11 +16,11 @@ export type LlmExecutionTools = {
16
16
  /**
17
17
  * Use a chat model
18
18
  */
19
- gptChat(prompt: Prompt): Promise<PromptChatResult>;
19
+ callChatModel(prompt: Prompt): Promise<PromptChatResult>;
20
20
  /**
21
21
  * Use a completion model
22
22
  */
23
- gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
23
+ callCompletionModel(prompt: Prompt): Promise<PromptCompletionResult>;
24
24
  /**
25
25
  * List all available models that can be used
26
26
  */
@@ -46,6 +46,6 @@ export type AvailableModel = {
46
46
  /**
47
47
  * TODO: [🧠] Emulation of one type of model with another one - emuate chat with completion; emulate translation with chat
48
48
  * TODO: [🍓][♐] Some heuristic to pick the best model in listed models
49
- * TODO: [🏳] gptChat -> chat, gptComplete -> complete, translate
50
- * TODO: [🧠] Should or should not there be a word "GPT" in both gptComplete and gptChat
49
+ * TODO: [🏳] callChatModel -> chat, callCompletionModel -> complete, translate
50
+ * TODO: [🧠] Should or should not there be a word "GPT" in both callCompletionModel and callChatModel
51
51
  */
@@ -1,5 +1,5 @@
1
1
  import type { KebabCase } from 'type-fest';
2
- import type { ExpectationUnit } from '../types/PromptbookJson/PromptTemplateJson';
2
+ import type { ExpectationUnit } from '../types/PipelineJson/PromptTemplateJson';
3
3
  import type { number_positive } from '../types/typeAliases';
4
4
  import type { number_usd } from '../types/typeAliases';
5
5
  import type { string_date_iso8601 } from '../types/typeAliases';
@@ -3,7 +3,7 @@ import type { PromptbookExecutor } from './PromptbookExecutor';
3
3
  * Asserts that the execution of a promptnook is successful
4
4
  *
5
5
  * @param executionResult - The partial result of the promptnook execution
6
- * @throws {PromptbookExecutionError} If the execution is not successful or if multiple errors occurred
6
+ * @throws {ExecutionError} If the execution is not successful or if multiple errors occurred
7
7
  */
8
8
  export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PromptbookExecutor>>, 'isSuccessful' | 'errors'>): void;
9
9
  /**
@@ -1,4 +1,4 @@
1
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
1
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
2
2
  import type { ExecutionTools } from './ExecutionTools';
3
3
  import type { PromptbookExecutor } from './PromptbookExecutor';
4
4
  type CreatePromptbookExecutorSettings = {
@@ -16,7 +16,7 @@ interface CreatePromptbookExecutorOptions {
16
16
  /**
17
17
  * The promptbook to be executed
18
18
  */
19
- readonly promptbook: PromptbookJson;
19
+ readonly promptbook: PipelineJson;
20
20
  /**
21
21
  * The execution tools to be used during the execution of the PROMPTBOOK
22
22
  */
@@ -30,7 +30,7 @@ interface CreatePromptbookExecutorOptions {
30
30
  * Creates executor function from promptbook and execution tools.
31
31
  *
32
32
  * @returns The executor function
33
- * @throws {PromptbookLogicError} on logical error in the promptbook
33
+ * @throws {PipelineLogicError} on logical error in the promptbook
34
34
  */
35
35
  export declare function createPromptbookExecutor(options: CreatePromptbookExecutorOptions): PromptbookExecutor;
36
36
  export {};
@@ -2,6 +2,6 @@
2
2
  *
3
3
  * @param message
4
4
  * @returns
5
- * @throws {PromptbookExecutionError}
5
+ * @throws {ExecutionError}
6
6
  */
7
7
  export declare function extractMultiplicatedOccurrence(message: string): string;
@@ -1,4 +1,4 @@
1
- import type { Expectations } from '../../types/PromptbookJson/PromptTemplateJson';
1
+ import type { Expectations } from '../../types/PipelineJson/PromptTemplateJson';
2
2
  /**
3
3
  * Function checkExpectations will check if the expectations on given value are met
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
2
- import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
2
+ import type { KnowledgeJson } from '../../../types/PipelineJson/KnowledgeJson';
3
3
  import type { string_markdown } from '../../../types/typeAliases';
4
4
  type PrepareKnowledgeFromMarkdownOptions = {
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
2
- import type { KnowledgeJson } from '../../../types/PromptbookJson/KnowledgeJson';
2
+ import type { KnowledgeJson } from '../../../types/PipelineJson/KnowledgeJson';
3
3
  import type { string_base64 } from '../../../types/typeAliases';
4
4
  type PrepareKnowledgeFromPdfOptions = {
5
5
  /**
@@ -0,0 +1,25 @@
1
+ import type { Promisable } from 'type-fest';
2
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
3
+ import type { Prompt } from '../types/Prompt';
4
+ import type { string_pipeline_url } from '../types/typeAliases';
5
+ /**
6
+ * Collection that groups together pipelines, knowledge, personas, tools and actions
7
+ *
8
+ * @see !!! https://github.com/webgptorg/pipeline#pipeline-library
9
+ */
10
+ export type PipelineCollection = {
11
+ /**
12
+ * Gets all pipelines in the library
13
+ */
14
+ listPipelines(): Promisable<Array<string_pipeline_url>>;
15
+ /**
16
+ * Gets pipeline by its URL
17
+ *
18
+ * Note: This is not a direct fetching from the URL, but a lookup in the library
19
+ */
20
+ getPipelineByUrl(url: string_pipeline_url): Promisable<PipelineJson>;
21
+ /**
22
+ * Checks whether given prompt was defined in any pipeline in the library
23
+ */
24
+ isResponsibleForPrompt(prompt: Prompt): Promisable<boolean>;
25
+ };
@@ -1,36 +1,36 @@
1
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
1
2
  import type { Prompt } from '../types/Prompt';
2
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
3
- import type { string_promptbook_url } from '../types/typeAliases';
4
- import type { PromptbookLibrary } from './PromptbookLibrary';
3
+ import type { string_pipeline_url } from '../types/typeAliases';
4
+ import type { PipelineCollection } from './PipelineCollection';
5
5
  /**
6
6
  * Library of promptbooks that groups together promptbooks for an application.
7
7
  * This implementation is a very thin wrapper around the Array / Map of promptbooks.
8
8
  *
9
- * @private use `createLibraryFromJson` instead
10
- * @see https://github.com/webgptorg/promptbook#promptbook-library
9
+ * @private use `createCollectionFromJson` instead
10
+ * @see https://github.com/webgptorg/promptbook#promptbook-collection
11
11
  */
12
- export declare class SimplePromptbookLibrary implements PromptbookLibrary {
12
+ export declare class SimplePipelineCollection implements PipelineCollection {
13
13
  private library;
14
14
  /**
15
15
  * Constructs a promptbook library from promptbooks
16
16
  *
17
17
  * @param promptbooks !!!
18
18
  *
19
- * @private Use instead `createLibraryFromJson`
19
+ * @private Use instead `createCollectionFromJson`
20
20
  * Note: During the construction logic of all promptbooks are validated
21
- * Note: It is not recommended to use this constructor directly, use `createLibraryFromJson` *(or other variant)* instead
21
+ * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
22
22
  */
23
- constructor(...promptbooks: Array<PromptbookJson>);
23
+ constructor(...promptbooks: Array<PipelineJson>);
24
24
  /**
25
25
  * Gets all promptbooks in the library
26
26
  */
27
- listPromptbooks(): Array<string_promptbook_url>;
27
+ listPipelines(): Array<string_pipeline_url>;
28
28
  /**
29
29
  * Gets promptbook by its URL
30
30
  *
31
31
  * Note: This is not a direct fetching from the URL, but a lookup in the library
32
32
  */
33
- getPromptbookByUrl(url: string_promptbook_url): PromptbookJson;
33
+ getPipelineByUrl(url: string_pipeline_url): PipelineJson;
34
34
  /**
35
35
  * Checks whether given prompt was defined in any promptbook in the library
36
36
  */
@@ -1,9 +1,9 @@
1
1
  import type { string_folder_path } from '../../types/typeAliases';
2
- import type { PromptbookLibrary } from '../PromptbookLibrary';
2
+ import type { PipelineCollection } from '../PipelineCollection';
3
3
  /**
4
- * Options for `createLibraryFromDirectory` function
4
+ * Options for `createCollectionFromDirectory` function
5
5
  */
6
- type CreatePromptbookLibraryFromDirectoryOptions = {
6
+ type CreatePipelineCollectionFromDirectoryOptions = {
7
7
  /**
8
8
  * If true, the directory is searched recursively for promptbooks
9
9
  *
@@ -37,9 +37,9 @@ type CreatePromptbookLibraryFromDirectoryOptions = {
37
37
  *
38
38
  * @param path - path to the directory with promptbooks
39
39
  * @param options - Misc options for the library
40
- * @returns PromptbookLibrary
40
+ * @returns PipelineCollection
41
41
  */
42
- export declare function createLibraryFromDirectory(path: string_folder_path, options?: CreatePromptbookLibraryFromDirectoryOptions): Promise<PromptbookLibrary>;
42
+ export declare function createCollectionFromDirectory(path: string_folder_path, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
43
43
  export {};
44
44
  /**
45
45
  * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
@@ -0,0 +1,12 @@
1
+ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
+ import type { PipelineCollection } from '../PipelineCollection';
3
+ /**
4
+ * Creates PipelineCollection from array of PipelineJson or PipelineString
5
+ *
6
+ * Note: Functions `libraryToJson` and `createCollectionFromJson` are complementary
7
+ * Note: During the construction syntax and logic of all sources are validated
8
+ *
9
+ * @param promptbookSources
10
+ * @returns PipelineCollection
11
+ */
12
+ export declare function createCollectionFromJson(...promptbooks: Array<PipelineJson>): PipelineCollection;
@@ -0,0 +1,22 @@
1
+ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
+ import type { PipelineCollection } from '../PipelineCollection';
3
+ /**
4
+ * Constructs Promptbook from async sources
5
+ * It can be one of the following:
6
+ * - Promise of array of PipelineJson or PipelineString
7
+ * - Factory function that returns Promise of array of PipelineJson or PipelineString
8
+ *
9
+ * Note: This is useful as internal tool for other constructor functions like
10
+ * `createCollectionFromUrl` or `createCollectionFromDirectory`
11
+ * Consider using those functions instead of this one
12
+ *
13
+ * Note: The function does NOT return promise it returns the library directly which waits for the sources to be resolved
14
+ * when error occurs in given promise or factory function, it is thrown during `listPipelines` or `getPipelineByUrl` call
15
+ *
16
+ * Note: Consider using `createCollectionFromDirectory` or `createCollectionFromUrl`
17
+ *
18
+ * @param promptbookSourcesPromiseOrFactory
19
+ * @returns PipelineCollection
20
+ * @deprecated Do not use, it will became internal tool for other constructor functions
21
+ */
22
+ export declare function createCollectionFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PipelineJson>> | (() => Promise<Array<PipelineJson>>)): PipelineCollection;
@@ -1,9 +1,9 @@
1
1
  import type { string_url } from '../../types/typeAliases';
2
- import type { PromptbookLibrary } from '../PromptbookLibrary';
2
+ import type { PipelineCollection } from '../PipelineCollection';
3
3
  /**
4
- * Options for `createLibraryFromDirectory` function
4
+ * Options for `createCollectionFromDirectory` function
5
5
  */
6
- type CreatePromptbookLibraryFromUrlyOptions = {
6
+ type CreatePipelineCollectionFromUrlyOptions = {
7
7
  /**
8
8
  * If true, the library creation outputs information about each file it reads
9
9
  *
@@ -20,9 +20,9 @@ type CreatePromptbookLibraryFromUrlyOptions = {
20
20
  /**
21
21
  * Constructs Promptbook from remote Promptbase URL
22
22
 
23
- * @returns PromptbookLibrary
23
+ * @returns PipelineCollection
24
24
  */
25
- export declare function createLibraryFromUrl(url: string_url | URL, options: CreatePromptbookLibraryFromUrlyOptions): Promise<PromptbookLibrary>;
25
+ export declare function createCollectionFromUrl(url: string_url | URL, options: CreatePipelineCollectionFromUrlyOptions): Promise<PipelineCollection>;
26
26
  export {};
27
27
  /**
28
28
  * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
@@ -0,0 +1,12 @@
1
+ import type { string_pipeline_url } from '../../types/typeAliases';
2
+ import type { PipelineCollection } from '../PipelineCollection';
3
+ /**
4
+ * Creates PipelineCollection as a subset of another PipelineCollection
5
+ *
6
+ * Note: You can use any type of library as a parent library - local, remote, etc.
7
+ * Note: This is just a thin wrapper / proxy around the parent library
8
+ *
9
+ * @param promptbookSources
10
+ * @returns PipelineCollection
11
+ */
12
+ export declare function createSubcollection(library: PipelineCollection, predicate: (url: string_pipeline_url) => boolean): PipelineCollection;
@@ -1,8 +1,8 @@
1
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
- import type { PromptbookLibrary } from './PromptbookLibrary';
1
+ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
2
+ import type { PipelineCollection } from './PipelineCollection';
3
3
  /**
4
- * Converts PromptbookLibrary to serialized JSON
4
+ * Converts PipelineCollection to serialized JSON
5
5
  *
6
- * Note: Functions `libraryToJson` and `createLibraryFromJson` are complementary
6
+ * Note: Functions `libraryToJson` and `createCollectionFromJson` are complementary
7
7
  */
8
- export declare function libraryToJson(library: PromptbookLibrary): Promise<Array<PromptbookJson>>;
8
+ export declare function libraryToJson(library: PipelineCollection): Promise<Array<PipelineJson>>;
@@ -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.