@promptbook/utils 0.41.3 โ†’ 0.41.101

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 (360) hide show
  1. package/bin/promptbook-cli.js +6 -0
  2. package/esm/index.es.js +1719 -1681
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/_packages/core.index.d.ts +20 -20
  5. package/esm/typings/_packages/execute-javascript.index.d.ts +3 -3
  6. package/esm/typings/_packages/openai.index.d.ts +3 -3
  7. package/esm/typings/_packages/remote-client.index.d.ts +4 -4
  8. package/esm/typings/_packages/remote-server.index.d.ts +3 -3
  9. package/esm/typings/_packages/types.index.d.ts +27 -27
  10. package/esm/typings/_packages/utils.index.d.ts +38 -38
  11. package/esm/typings/_packages/wizzard.index.d.ts +5 -5
  12. package/esm/typings/config.d.ts +4 -4
  13. package/esm/typings/conversion/prettify/PrettifyOptions.d.ts +7 -7
  14. package/esm/typings/conversion/prettify/prettifyPromptbookString.d.ts +11 -10
  15. package/esm/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -9
  16. package/esm/typings/conversion/promptbookStringToJson.d.ts +13 -13
  17. package/esm/typings/conversion/test/_importPromptbook.d.ts +12 -12
  18. package/esm/typings/conversion/test/promptbookStringToJson-syntaxErrors.test.d.ts +1 -1
  19. package/esm/typings/conversion/test/promptbookStringToJson.test.d.ts +1 -1
  20. package/esm/typings/conversion/test/validatePromptbookJson-logicErrors.test.d.ts +1 -1
  21. package/esm/typings/conversion/test/validatePromptbookJson.d.ts +26 -26
  22. package/esm/typings/conversion/test/validatePromptbookJson.test.d.ts +1 -1
  23. package/esm/typings/conversion/utils/extractVariables.d.ts +10 -10
  24. package/esm/typings/conversion/utils/extractVariables.test.d.ts +1 -1
  25. package/esm/typings/conversion/utils/parseCommand.d.ts +8 -8
  26. package/esm/typings/conversion/utils/parseCommand.test.d.ts +4 -4
  27. package/esm/typings/conversion/utils/parseNumber.d.ts +12 -12
  28. package/esm/typings/conversion/utils/parseNumber.test.d.ts +1 -1
  29. package/esm/typings/errors/ExpectError.d.ts +9 -9
  30. package/esm/typings/errors/NotFoundError.d.ts +7 -7
  31. package/esm/typings/errors/PromptbookExecutionError.d.ts +7 -7
  32. package/esm/typings/errors/PromptbookLogicError.d.ts +7 -7
  33. package/esm/typings/errors/PromptbookReferenceError.d.ts +7 -7
  34. package/esm/typings/errors/PromptbookSyntaxError.d.ts +7 -7
  35. package/esm/typings/errors/UnexpectedError.d.ts +7 -7
  36. package/esm/typings/execution/CommonExecutionToolsOptions.d.ts +9 -9
  37. package/esm/typings/execution/ExecutionTools.d.ts +25 -25
  38. package/esm/typings/execution/NaturalExecutionTools.d.ts +23 -23
  39. package/esm/typings/execution/PromptResult.d.ts +74 -74
  40. package/esm/typings/execution/PromptbookExecutor.d.ts +39 -39
  41. package/esm/typings/execution/ScriptExecutionTools.d.ts +37 -37
  42. package/esm/typings/execution/UserInterfaceTools.d.ts +45 -45
  43. package/esm/typings/execution/assertsExecutionSuccessful.d.ts +11 -11
  44. package/esm/typings/execution/createPromptbookExecutor.d.ts +41 -41
  45. package/esm/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -22
  46. package/esm/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -4
  47. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -4
  48. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -4
  49. package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +28 -28
  50. package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -16
  51. package/esm/typings/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.d.ts +3 -3
  52. package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -35
  53. package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +23 -23
  54. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -11
  55. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -12
  56. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -17
  57. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -12
  58. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -27
  59. package/esm/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts +17 -17
  60. package/esm/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -1
  61. package/esm/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -1
  62. package/esm/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -1
  63. package/esm/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -1
  64. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -20
  65. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -4
  66. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -20
  67. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -22
  68. package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -11
  69. package/esm/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -1
  70. package/esm/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -15
  71. package/esm/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -1
  72. package/esm/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -1
  73. package/esm/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -15
  74. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -14
  75. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -12
  76. package/esm/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -16
  77. package/esm/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -1
  78. package/esm/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -4
  79. package/esm/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -9
  80. package/esm/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -5
  81. package/esm/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -11
  82. package/esm/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -4
  83. package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
  84. package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -1
  85. package/esm/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -5
  86. package/esm/typings/execution/utils/replaceParameters.d.ts +12 -12
  87. package/esm/typings/execution/utils/replaceParameters.test.d.ts +1 -1
  88. package/esm/typings/library/PromptbookLibrary.d.ts +25 -25
  89. package/esm/typings/library/SimplePromptbookLibrary.d.ts +35 -35
  90. package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +5 -5
  91. package/esm/typings/library/constructors/createPromptbookLibraryFromList.d.ts +5 -5
  92. package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +7 -7
  93. package/esm/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +16 -16
  94. package/esm/typings/library/constructors/createPromptbookSublibrary.d.ts +6 -6
  95. package/esm/typings/types/Command.d.ts +98 -98
  96. package/esm/typings/types/ExecutionTypes.d.ts +13 -13
  97. package/esm/typings/types/ModelRequirements.d.ts +41 -41
  98. package/esm/typings/types/Parameters.d.ts +14 -14
  99. package/esm/typings/types/Prompt.d.ts +41 -41
  100. package/esm/typings/types/PromptbookJson/PromptTemplateJson.d.ts +126 -126
  101. package/esm/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -25
  102. package/esm/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -51
  103. package/esm/typings/types/PromptbookString.d.ts +12 -12
  104. package/esm/typings/types/ScriptLanguage.d.ts +9 -9
  105. package/esm/typings/types/TaskProgress.d.ts +42 -42
  106. package/esm/typings/types/execution-report/ExecutionReportJson.d.ts +56 -56
  107. package/esm/typings/types/execution-report/ExecutionReportString.d.ts +16 -16
  108. package/esm/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -21
  109. package/esm/typings/types/execution-report/config.d.ts +8 -8
  110. package/esm/typings/types/execution-report/countWorkingDuration.d.ts +7 -7
  111. package/esm/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -1
  112. package/esm/typings/types/execution-report/executionReportJsonToString.d.ts +11 -11
  113. package/esm/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -1
  114. package/esm/typings/types/typeAliasEmoji.d.ts +9 -9
  115. package/esm/typings/types/typeAliases.d.ts +432 -432
  116. package/esm/typings/utils/FromtoItems.d.ts +19 -19
  117. package/esm/typings/utils/emojis.d.ts +22 -22
  118. package/esm/typings/utils/expectation-counters/countCharacters.d.ts +5 -5
  119. package/esm/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -1
  120. package/esm/typings/utils/expectation-counters/countLines.d.ts +5 -5
  121. package/esm/typings/utils/expectation-counters/countLines.test.d.ts +1 -1
  122. package/esm/typings/utils/expectation-counters/countPages.d.ts +5 -5
  123. package/esm/typings/utils/expectation-counters/countPages.test.d.ts +1 -1
  124. package/esm/typings/utils/expectation-counters/countParagraphs.d.ts +5 -5
  125. package/esm/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -1
  126. package/esm/typings/utils/expectation-counters/countSentences.d.ts +5 -5
  127. package/esm/typings/utils/expectation-counters/countSentences.test.d.ts +1 -1
  128. package/esm/typings/utils/expectation-counters/countWords.d.ts +5 -5
  129. package/esm/typings/utils/expectation-counters/countWords.test.d.ts +1 -1
  130. package/esm/typings/utils/expectation-counters/index.d.ts +5 -5
  131. package/esm/typings/utils/extractParameters.d.ts +10 -10
  132. package/esm/typings/utils/extractParameters.test.d.ts +1 -1
  133. package/esm/typings/utils/formatNumber.d.ts +6 -6
  134. package/esm/typings/utils/formatNumber.test.d.ts +1 -1
  135. package/esm/typings/utils/getCurrentIsoDate.d.ts +7 -7
  136. package/esm/typings/utils/isRunningInWhatever.d.ts +12 -12
  137. package/esm/typings/utils/isValidJsonString.d.ts +4 -4
  138. package/esm/typings/utils/isValidJsonString.test.d.ts +1 -1
  139. package/esm/typings/utils/just.d.ts +10 -10
  140. package/esm/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -10
  141. package/esm/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -1
  142. package/esm/typings/utils/markdown/createMarkdownChart.d.ts +41 -41
  143. package/esm/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -1
  144. package/esm/typings/utils/markdown/createMarkdownTable.d.ts +7 -7
  145. package/esm/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -1
  146. package/esm/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -6
  147. package/esm/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -1
  148. package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -27
  149. package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -1
  150. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -13
  151. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -1
  152. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -19
  153. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -1
  154. package/esm/typings/utils/markdown/prettifyMarkdown.d.ts +8 -8
  155. package/esm/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -1
  156. package/esm/typings/utils/markdown/removeContentComments.d.ts +8 -8
  157. package/esm/typings/utils/markdown/removeContentComments.test.d.ts +1 -1
  158. package/esm/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -8
  159. package/esm/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -1
  160. package/esm/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -25
  161. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -7
  162. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -1
  163. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -13
  164. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -1
  165. package/esm/typings/utils/postprocessing/extractBlock.d.ts +12 -12
  166. package/esm/typings/utils/removeEmojis.d.ts +7 -7
  167. package/esm/typings/utils/removeEmojis.test.d.ts +1 -1
  168. package/esm/typings/utils/removeQuotes.d.ts +13 -13
  169. package/esm/typings/utils/removeQuotes.test.d.ts +1 -1
  170. package/esm/typings/utils/trimCodeBlock.d.ts +8 -8
  171. package/esm/typings/utils/trimCodeBlock.test.d.ts +1 -1
  172. package/esm/typings/utils/trimEndOfCodeBlock.d.ts +7 -7
  173. package/esm/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -1
  174. package/esm/typings/utils/unwrapResult.d.ts +36 -36
  175. package/esm/typings/utils/unwrapResult.test.d.ts +1 -1
  176. package/esm/typings/utils/validators/url/isValidUrl.d.ts +7 -7
  177. package/esm/typings/utils/validators/url/isValidUrl.test.d.ts +1 -1
  178. package/esm/typings/version.d.ts +5 -5
  179. package/esm/typings/wizzard/Wizzard.d.ts +4 -4
  180. package/esm/typings/wizzard/sample.d.ts +6 -6
  181. package/package.json +9 -4
  182. package/umd/index.umd.js +1722 -1685
  183. package/umd/index.umd.js.map +1 -1
  184. package/umd/typings/_packages/core.index.d.ts +20 -20
  185. package/umd/typings/_packages/execute-javascript.index.d.ts +3 -3
  186. package/umd/typings/_packages/openai.index.d.ts +3 -3
  187. package/umd/typings/_packages/remote-client.index.d.ts +4 -4
  188. package/umd/typings/_packages/remote-server.index.d.ts +3 -3
  189. package/umd/typings/_packages/types.index.d.ts +27 -27
  190. package/umd/typings/_packages/utils.index.d.ts +38 -38
  191. package/umd/typings/_packages/wizzard.index.d.ts +5 -5
  192. package/umd/typings/config.d.ts +4 -4
  193. package/umd/typings/conversion/prettify/PrettifyOptions.d.ts +7 -7
  194. package/umd/typings/conversion/prettify/prettifyPromptbookString.d.ts +11 -10
  195. package/umd/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -9
  196. package/umd/typings/conversion/promptbookStringToJson.d.ts +13 -13
  197. package/umd/typings/conversion/test/_importPromptbook.d.ts +12 -12
  198. package/umd/typings/conversion/test/promptbookStringToJson-syntaxErrors.test.d.ts +1 -1
  199. package/umd/typings/conversion/test/promptbookStringToJson.test.d.ts +1 -1
  200. package/umd/typings/conversion/test/validatePromptbookJson-logicErrors.test.d.ts +1 -1
  201. package/umd/typings/conversion/test/validatePromptbookJson.d.ts +26 -26
  202. package/umd/typings/conversion/test/validatePromptbookJson.test.d.ts +1 -1
  203. package/umd/typings/conversion/utils/extractVariables.d.ts +10 -10
  204. package/umd/typings/conversion/utils/extractVariables.test.d.ts +1 -1
  205. package/umd/typings/conversion/utils/parseCommand.d.ts +8 -8
  206. package/umd/typings/conversion/utils/parseCommand.test.d.ts +4 -4
  207. package/umd/typings/conversion/utils/parseNumber.d.ts +12 -12
  208. package/umd/typings/conversion/utils/parseNumber.test.d.ts +1 -1
  209. package/umd/typings/errors/ExpectError.d.ts +9 -9
  210. package/umd/typings/errors/NotFoundError.d.ts +7 -7
  211. package/umd/typings/errors/PromptbookExecutionError.d.ts +7 -7
  212. package/umd/typings/errors/PromptbookLogicError.d.ts +7 -7
  213. package/umd/typings/errors/PromptbookReferenceError.d.ts +7 -7
  214. package/umd/typings/errors/PromptbookSyntaxError.d.ts +7 -7
  215. package/umd/typings/errors/UnexpectedError.d.ts +7 -7
  216. package/umd/typings/execution/CommonExecutionToolsOptions.d.ts +9 -9
  217. package/umd/typings/execution/ExecutionTools.d.ts +25 -25
  218. package/umd/typings/execution/NaturalExecutionTools.d.ts +23 -23
  219. package/umd/typings/execution/PromptResult.d.ts +74 -74
  220. package/umd/typings/execution/PromptbookExecutor.d.ts +39 -39
  221. package/umd/typings/execution/ScriptExecutionTools.d.ts +37 -37
  222. package/umd/typings/execution/UserInterfaceTools.d.ts +45 -45
  223. package/umd/typings/execution/assertsExecutionSuccessful.d.ts +11 -11
  224. package/umd/typings/execution/createPromptbookExecutor.d.ts +41 -41
  225. package/umd/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -22
  226. package/umd/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -4
  227. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -4
  228. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -4
  229. package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +28 -28
  230. package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -16
  231. package/umd/typings/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.d.ts +3 -3
  232. package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -35
  233. package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +23 -23
  234. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -11
  235. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -12
  236. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -17
  237. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -12
  238. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -27
  239. package/umd/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts +17 -17
  240. package/umd/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -1
  241. package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -1
  242. package/umd/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -1
  243. package/umd/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -1
  244. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -20
  245. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -4
  246. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -20
  247. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -22
  248. package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -11
  249. package/umd/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -1
  250. package/umd/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -15
  251. package/umd/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -1
  252. package/umd/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -1
  253. package/umd/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -15
  254. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -14
  255. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -12
  256. package/umd/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -16
  257. package/umd/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -1
  258. package/umd/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -4
  259. package/umd/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -9
  260. package/umd/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -5
  261. package/umd/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -11
  262. package/umd/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -4
  263. package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
  264. package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -1
  265. package/umd/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -5
  266. package/umd/typings/execution/utils/replaceParameters.d.ts +12 -12
  267. package/umd/typings/execution/utils/replaceParameters.test.d.ts +1 -1
  268. package/umd/typings/library/PromptbookLibrary.d.ts +25 -25
  269. package/umd/typings/library/SimplePromptbookLibrary.d.ts +35 -35
  270. package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +5 -5
  271. package/umd/typings/library/constructors/createPromptbookLibraryFromList.d.ts +5 -5
  272. package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +7 -7
  273. package/umd/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +16 -16
  274. package/umd/typings/library/constructors/createPromptbookSublibrary.d.ts +6 -6
  275. package/umd/typings/types/Command.d.ts +98 -98
  276. package/umd/typings/types/ExecutionTypes.d.ts +13 -13
  277. package/umd/typings/types/ModelRequirements.d.ts +41 -41
  278. package/umd/typings/types/Parameters.d.ts +14 -14
  279. package/umd/typings/types/Prompt.d.ts +41 -41
  280. package/umd/typings/types/PromptbookJson/PromptTemplateJson.d.ts +126 -126
  281. package/umd/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -25
  282. package/umd/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -51
  283. package/umd/typings/types/PromptbookString.d.ts +12 -12
  284. package/umd/typings/types/ScriptLanguage.d.ts +9 -9
  285. package/umd/typings/types/TaskProgress.d.ts +42 -42
  286. package/umd/typings/types/execution-report/ExecutionReportJson.d.ts +56 -56
  287. package/umd/typings/types/execution-report/ExecutionReportString.d.ts +16 -16
  288. package/umd/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -21
  289. package/umd/typings/types/execution-report/config.d.ts +8 -8
  290. package/umd/typings/types/execution-report/countWorkingDuration.d.ts +7 -7
  291. package/umd/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -1
  292. package/umd/typings/types/execution-report/executionReportJsonToString.d.ts +11 -11
  293. package/umd/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -1
  294. package/umd/typings/types/typeAliasEmoji.d.ts +9 -9
  295. package/umd/typings/types/typeAliases.d.ts +432 -432
  296. package/umd/typings/utils/FromtoItems.d.ts +19 -19
  297. package/umd/typings/utils/emojis.d.ts +22 -22
  298. package/umd/typings/utils/expectation-counters/countCharacters.d.ts +5 -5
  299. package/umd/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -1
  300. package/umd/typings/utils/expectation-counters/countLines.d.ts +5 -5
  301. package/umd/typings/utils/expectation-counters/countLines.test.d.ts +1 -1
  302. package/umd/typings/utils/expectation-counters/countPages.d.ts +5 -5
  303. package/umd/typings/utils/expectation-counters/countPages.test.d.ts +1 -1
  304. package/umd/typings/utils/expectation-counters/countParagraphs.d.ts +5 -5
  305. package/umd/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -1
  306. package/umd/typings/utils/expectation-counters/countSentences.d.ts +5 -5
  307. package/umd/typings/utils/expectation-counters/countSentences.test.d.ts +1 -1
  308. package/umd/typings/utils/expectation-counters/countWords.d.ts +5 -5
  309. package/umd/typings/utils/expectation-counters/countWords.test.d.ts +1 -1
  310. package/umd/typings/utils/expectation-counters/index.d.ts +5 -5
  311. package/umd/typings/utils/extractParameters.d.ts +10 -10
  312. package/umd/typings/utils/extractParameters.test.d.ts +1 -1
  313. package/umd/typings/utils/formatNumber.d.ts +6 -6
  314. package/umd/typings/utils/formatNumber.test.d.ts +1 -1
  315. package/umd/typings/utils/getCurrentIsoDate.d.ts +7 -7
  316. package/umd/typings/utils/isRunningInWhatever.d.ts +12 -12
  317. package/umd/typings/utils/isValidJsonString.d.ts +4 -4
  318. package/umd/typings/utils/isValidJsonString.test.d.ts +1 -1
  319. package/umd/typings/utils/just.d.ts +10 -10
  320. package/umd/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -10
  321. package/umd/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -1
  322. package/umd/typings/utils/markdown/createMarkdownChart.d.ts +41 -41
  323. package/umd/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -1
  324. package/umd/typings/utils/markdown/createMarkdownTable.d.ts +7 -7
  325. package/umd/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -1
  326. package/umd/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -6
  327. package/umd/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -1
  328. package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -27
  329. package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -1
  330. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -13
  331. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -1
  332. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -19
  333. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -1
  334. package/umd/typings/utils/markdown/prettifyMarkdown.d.ts +8 -8
  335. package/umd/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -1
  336. package/umd/typings/utils/markdown/removeContentComments.d.ts +8 -8
  337. package/umd/typings/utils/markdown/removeContentComments.test.d.ts +1 -1
  338. package/umd/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -8
  339. package/umd/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -1
  340. package/umd/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -25
  341. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -7
  342. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -1
  343. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -13
  344. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -1
  345. package/umd/typings/utils/postprocessing/extractBlock.d.ts +12 -12
  346. package/umd/typings/utils/removeEmojis.d.ts +7 -7
  347. package/umd/typings/utils/removeEmojis.test.d.ts +1 -1
  348. package/umd/typings/utils/removeQuotes.d.ts +13 -13
  349. package/umd/typings/utils/removeQuotes.test.d.ts +1 -1
  350. package/umd/typings/utils/trimCodeBlock.d.ts +8 -8
  351. package/umd/typings/utils/trimCodeBlock.test.d.ts +1 -1
  352. package/umd/typings/utils/trimEndOfCodeBlock.d.ts +7 -7
  353. package/umd/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -1
  354. package/umd/typings/utils/unwrapResult.d.ts +36 -36
  355. package/umd/typings/utils/unwrapResult.test.d.ts +1 -1
  356. package/umd/typings/utils/validators/url/isValidUrl.d.ts +7 -7
  357. package/umd/typings/utils/validators/url/isValidUrl.test.d.ts +1 -1
  358. package/umd/typings/version.d.ts +5 -5
  359. package/umd/typings/wizzard/Wizzard.d.ts +4 -4
  360. package/umd/typings/wizzard/sample.d.ts +6 -6
@@ -1,39 +1,39 @@
1
- import type { Promisable } from 'type-fest';
2
- import type { TaskProgress } from '../types/TaskProgress';
3
- import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
4
- import type { string_name } from '../types/typeAliases';
5
- /**
6
- * Executor is a simple async function that takes INPUT PARAMETERs and returns result parameters _(along with all intermediate parameters and INPUT PARAMETERs = it extends input object)_.
7
- * Executor is made by combining execution tools and promptbook library.
8
- *
9
- * It can be done in two ways:
10
- * - From `PromptbookLibrary.getExecutor` method
11
- * - `createPromptbookExecutor` utility function
12
- *
13
- * @see https://github.com/webgptorg/promptbook#executor
14
- */
15
- export type PromptbookExecutor = {
16
- (inputParameters: Record<string_name, string>, onProgress: (taskProgress: TaskProgress) => Promisable<void>): Promise<{
17
- /**
18
- * Whether the execution was successful
19
- */
20
- isSuccessful: boolean;
21
- /**
22
- * Errors that occured during the execution
23
- */
24
- errors: Array<Error>;
25
- /**
26
- * The report of the execution
27
- */
28
- executionReport: ExecutionReportJson;
29
- /**
30
- * Result parameters of the execution
31
- *
32
- * Note: If the execution was not successful, there are only some of the result parameters
33
- */
34
- outputParameters: Record<string_name, string>;
35
- }>;
36
- };
37
- /**
38
- * TODO: [๐Ÿง ] Should this file be in /execution or /types folder?
39
- */
1
+ import type { Promisable } from 'type-fest';
2
+ import type { TaskProgress } from '../types/TaskProgress';
3
+ import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
4
+ import type { string_name } from '../types/typeAliases';
5
+ /**
6
+ * Executor is a simple async function that takes INPUT PARAMETERs and returns result parameters _(along with all intermediate parameters and INPUT PARAMETERs = it extends input object)_.
7
+ * Executor is made by combining execution tools and promptbook library.
8
+ *
9
+ * It can be done in two ways:
10
+ * - From `PromptbookLibrary.getExecutor` method
11
+ * - `createPromptbookExecutor` utility function
12
+ *
13
+ * @see https://github.com/webgptorg/promptbook#executor
14
+ */
15
+ export type PromptbookExecutor = {
16
+ (inputParameters: Record<string_name, string>, onProgress: (taskProgress: TaskProgress) => Promisable<void>): Promise<{
17
+ /**
18
+ * Whether the execution was successful
19
+ */
20
+ isSuccessful: boolean;
21
+ /**
22
+ * Errors that occured during the execution
23
+ */
24
+ errors: Array<Error>;
25
+ /**
26
+ * The report of the execution
27
+ */
28
+ executionReport: ExecutionReportJson;
29
+ /**
30
+ * Result parameters of the execution
31
+ *
32
+ * Note: If the execution was not successful, there are only some of the result parameters
33
+ */
34
+ outputParameters: Record<string_name, string>;
35
+ }>;
36
+ };
37
+ /**
38
+ * TODO: [๐Ÿง ] Should this file be in /execution or /types folder?
39
+ */
@@ -1,37 +1,37 @@
1
- import { string_name, string_script } from '.././types/typeAliases';
2
- import { ScriptLanguage } from '../types/ScriptLanguage';
3
- /**
4
- * Represents all the tools needed to EXECUTE SCRIPTs
5
- *
6
- * @see https://github.com/webgptorg/promptbook#script-execution-tools
7
- */
8
- export type ScriptExecutionTools = {
9
- execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
10
- };
11
- /**
12
- * Input for the script execution
13
- */
14
- export type ScriptExecutionToolsExecuteOptions = {
15
- /**
16
- * Language of the script
17
- */
18
- scriptLanguage: ScriptLanguage;
19
- /**
20
- * Parameters for the script
21
- * Theese parameters are passed to the script as variables
22
- * For example: { "name": "John" } => const name = "John";
23
- */
24
- parameters: Record<string_name, string>;
25
- /**
26
- * The content of the script to execute
27
- * - It can be a single statement
28
- * - It can be multiple statements separated by semicolon and return
29
- * - It can be a function (but you need to call it)
30
- * - It can be IIFE (immediately invoked function expression)
31
- * - It can use the parameters as variables and functions from global scope
32
- */
33
- script: string_script;
34
- };
35
- /**
36
- * TODO: [๐Ÿง ][๐Ÿ’™] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
37
- */
1
+ import { string_name, string_script } from '.././types/typeAliases';
2
+ import { ScriptLanguage } from '../types/ScriptLanguage';
3
+ /**
4
+ * Represents all the tools needed to EXECUTE SCRIPTs
5
+ *
6
+ * @see https://github.com/webgptorg/promptbook#script-execution-tools
7
+ */
8
+ export type ScriptExecutionTools = {
9
+ execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
10
+ };
11
+ /**
12
+ * Input for the script execution
13
+ */
14
+ export type ScriptExecutionToolsExecuteOptions = {
15
+ /**
16
+ * Language of the script
17
+ */
18
+ scriptLanguage: ScriptLanguage;
19
+ /**
20
+ * Parameters for the script
21
+ * Theese parameters are passed to the script as variables
22
+ * For example: { "name": "John" } => const name = "John";
23
+ */
24
+ parameters: Record<string_name, string>;
25
+ /**
26
+ * The content of the script to execute
27
+ * - It can be a single statement
28
+ * - It can be multiple statements separated by semicolon and return
29
+ * - It can be a function (but you need to call it)
30
+ * - It can be IIFE (immediately invoked function expression)
31
+ * - It can use the parameters as variables and functions from global scope
32
+ */
33
+ script: string_script;
34
+ };
35
+ /**
36
+ * TODO: [๐Ÿง ][๐Ÿ’™] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
37
+ */
@@ -1,45 +1,45 @@
1
- import { number_integer, number_positive } from '../types/typeAliases';
2
- /**
3
- * Represents all the tools needed to interact with the user.
4
- *
5
- * @see https://github.com/webgptorg/promptbook#user-interface-tools
6
- */
7
- export type UserInterfaceTools = {
8
- /**
9
- * Asks the user to answer a free-text (multi-line) question
10
- *
11
- * @param options the question to ask
12
- * @returns the answer from the user
13
- */
14
- promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
15
- };
16
- export type UserInterfaceToolsPromptDialogOptions = {
17
- /**
18
- * Prompt title
19
- *
20
- * Note: This is not a prompt to language model but a prompt to the user
21
- * @example "Your name"
22
- */
23
- promptTitle: string;
24
- /**
25
- * Prompt message
26
- *
27
- * Note: This is not a prompt to language model but a prompt to the user
28
- * @example "Please enter your name, including your last name, title, etc."
29
- */
30
- promptMessage: string;
31
- /**
32
- * Default value for the input/textarea
33
- */
34
- defaultValue: string | null;
35
- /**
36
- * Placeholder for the input/textarea
37
- */
38
- placeholder?: string;
39
- /**
40
- * Priority of the prompt
41
- *
42
- * Note: This would be reflected for example into the UI z-index of the prompt modal
43
- */
44
- priority: number_integer & number_positive;
45
- };
1
+ import { number_integer, number_positive } from '../types/typeAliases';
2
+ /**
3
+ * Represents all the tools needed to interact with the user.
4
+ *
5
+ * @see https://github.com/webgptorg/promptbook#user-interface-tools
6
+ */
7
+ export type UserInterfaceTools = {
8
+ /**
9
+ * Asks the user to answer a free-text (multi-line) question
10
+ *
11
+ * @param options the question to ask
12
+ * @returns the answer from the user
13
+ */
14
+ promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
15
+ };
16
+ export type UserInterfaceToolsPromptDialogOptions = {
17
+ /**
18
+ * Prompt title
19
+ *
20
+ * Note: This is not a prompt to language model but a prompt to the user
21
+ * @example "Your name"
22
+ */
23
+ promptTitle: string;
24
+ /**
25
+ * Prompt message
26
+ *
27
+ * Note: This is not a prompt to language model but a prompt to the user
28
+ * @example "Please enter your name, including your last name, title, etc."
29
+ */
30
+ promptMessage: string;
31
+ /**
32
+ * Default value for the input/textarea
33
+ */
34
+ defaultValue: string | null;
35
+ /**
36
+ * Placeholder for the input/textarea
37
+ */
38
+ placeholder?: string;
39
+ /**
40
+ * Priority of the prompt
41
+ *
42
+ * Note: This would be reflected for example into the UI z-index of the prompt modal
43
+ */
44
+ priority: number_integer & number_positive;
45
+ };
@@ -1,11 +1,11 @@
1
- import type { PromptbookExecutor } from './PromptbookExecutor';
2
- /**
3
- * Asserts that the execution of a promptnook is successful
4
- *
5
- * @param executionResult - The partial result of the promptnook execution
6
- * @throws Error - If the execution is not successful or if multiple errors occurred
7
- */
8
- export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PromptbookExecutor>>, 'isSuccessful' | 'errors'>): void;
9
- /**
10
- * TODO: [๐Ÿง ] Can this return type be better typed than void
11
- */
1
+ import type { PromptbookExecutor } from './PromptbookExecutor';
2
+ /**
3
+ * Asserts that the execution of a promptnook is successful
4
+ *
5
+ * @param executionResult - The partial result of the promptnook execution
6
+ * @throws Error - If the execution is not successful or if multiple errors occurred
7
+ */
8
+ export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PromptbookExecutor>>, 'isSuccessful' | 'errors'>): void;
9
+ /**
10
+ * TODO: [๐Ÿง ] Can this return type be better typed than void
11
+ */
@@ -1,41 +1,41 @@
1
- import { PromptbookJson } from '../_packages/types.index';
2
- import { ExecutionTools } from './ExecutionTools';
3
- import { PromptbookExecutor } from './PromptbookExecutor';
4
- type CreatePromptbookExecutorSettings = {
5
- /**
6
- * When executor does not satisfy expectations it will be retried this amount of times
7
- *
8
- * @default 3
9
- */
10
- readonly maxExecutionAttempts: number;
11
- };
12
- /**
13
- * Options for creating a promptbook executor
14
- */
15
- interface CreatePromptbookExecutorOptions {
16
- /**
17
- * The promptbook to be executed
18
- */
19
- readonly promptbook: PromptbookJson;
20
- /**
21
- * The execution tools to be used during the execution of the PROMPTBOOK
22
- */
23
- readonly tools: ExecutionTools;
24
- /**
25
- * Optional settings for the PROMPTBOOK executor
26
- */
27
- readonly settings?: Partial<CreatePromptbookExecutorSettings>;
28
- }
29
- /**
30
- * Creates executor function from promptbook and execution tools.
31
- *
32
- * Note: Consider using getExecutor method of the library instead of using this function
33
- */
34
- export declare function createPromptbookExecutor(options: CreatePromptbookExecutorOptions): PromptbookExecutor;
35
- export {};
36
- /**
37
- * TODO: [๐Ÿง ] When not meet expectations in PROMPT_DIALOG, make some way to tell the user
38
- * TODO: [๐Ÿ‘ง] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
39
- * Note: CreatePromptbookExecutorOptions are just connected to PromptbookExecutor so do not extract to types folder
40
- * TODO: [๐Ÿง ][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
41
- */
1
+ import { PromptbookJson } from '../_packages/types.index';
2
+ import { ExecutionTools } from './ExecutionTools';
3
+ import { PromptbookExecutor } from './PromptbookExecutor';
4
+ type CreatePromptbookExecutorSettings = {
5
+ /**
6
+ * When executor does not satisfy expectations it will be retried this amount of times
7
+ *
8
+ * @default 3
9
+ */
10
+ readonly maxExecutionAttempts: number;
11
+ };
12
+ /**
13
+ * Options for creating a promptbook executor
14
+ */
15
+ interface CreatePromptbookExecutorOptions {
16
+ /**
17
+ * The promptbook to be executed
18
+ */
19
+ readonly promptbook: PromptbookJson;
20
+ /**
21
+ * The execution tools to be used during the execution of the PROMPTBOOK
22
+ */
23
+ readonly tools: ExecutionTools;
24
+ /**
25
+ * Optional settings for the PROMPTBOOK executor
26
+ */
27
+ readonly settings?: Partial<CreatePromptbookExecutorSettings>;
28
+ }
29
+ /**
30
+ * Creates executor function from promptbook and execution tools.
31
+ *
32
+ * Note: Consider using getExecutor method of the library instead of using this function
33
+ */
34
+ export declare function createPromptbookExecutor(options: CreatePromptbookExecutorOptions): PromptbookExecutor;
35
+ export {};
36
+ /**
37
+ * TODO: [๐Ÿง ] When not meet expectations in PROMPT_DIALOG, make some way to tell the user
38
+ * TODO: [๐Ÿ‘ง] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
39
+ * Note: CreatePromptbookExecutorOptions are just connected to PromptbookExecutor so do not extract to types folder
40
+ * TODO: [๐Ÿง ][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
41
+ */
@@ -1,22 +1,22 @@
1
- import { Prompt } from '../../../../types/Prompt';
2
- import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
- import { NaturalExecutionTools } from '../../../NaturalExecutionTools';
4
- import { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
5
- /**
6
- * Mocked execution Tools for just echoing the requests for testing purposes.
7
- */
8
- export declare class MockedEchoNaturalExecutionTools implements NaturalExecutionTools {
9
- private readonly options;
10
- constructor(options: CommonExecutionToolsOptions);
11
- /**
12
- * Mocks chat model
13
- */
14
- gptChat(prompt: Prompt): Promise<PromptChatResult>;
15
- /**
16
- * Mocks completion model
17
- */
18
- gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
19
- }
20
- /**
21
- * TODO: Allow in spaceTrim: nesting with > ${block(prompt.request)}
22
- */
1
+ import { Prompt } from '../../../../types/Prompt';
2
+ import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
+ import { NaturalExecutionTools } from '../../../NaturalExecutionTools';
4
+ import { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
5
+ /**
6
+ * Mocked execution Tools for just echoing the requests for testing purposes.
7
+ */
8
+ export declare class MockedEchoNaturalExecutionTools implements NaturalExecutionTools {
9
+ private readonly options;
10
+ constructor(options: CommonExecutionToolsOptions);
11
+ /**
12
+ * Mocks chat model
13
+ */
14
+ gptChat(prompt: Prompt): Promise<PromptChatResult>;
15
+ /**
16
+ * Mocks completion model
17
+ */
18
+ gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
19
+ }
20
+ /**
21
+ * TODO: Allow in spaceTrim: nesting with > ${block(prompt.request)}
22
+ */
@@ -1,4 +1,4 @@
1
- export {};
2
- /**
3
- * TODO: [๐Ÿง ] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
4
- */
1
+ export {};
2
+ /**
3
+ * TODO: [๐Ÿง ] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
4
+ */
@@ -1,4 +1,4 @@
1
- export {};
2
- /**
3
- * TODO: [๐Ÿง ] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
4
- */
1
+ export {};
2
+ /**
3
+ * TODO: [๐Ÿง ] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
4
+ */
@@ -1,4 +1,4 @@
1
- export {};
2
- /**
3
- * TODO: [๐Ÿง ] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
4
- */
1
+ export {};
2
+ /**
3
+ * TODO: [๐Ÿง ] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
4
+ */
@@ -1,28 +1,28 @@
1
- import type { Prompt } from '../../../../types/Prompt';
2
- import type { NaturalExecutionTools } from '../../../NaturalExecutionTools';
3
- import type { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
4
- import type { OpenAiExecutionToolsOptions } from './OpenAiExecutionToolsOptions';
5
- /**
6
- * Execution Tools for calling OpenAI API.
7
- */
8
- export declare class OpenAiExecutionTools implements NaturalExecutionTools {
9
- private readonly options;
10
- /**
11
- * OpenAI API client.
12
- */
13
- private readonly openai;
14
- constructor(options: OpenAiExecutionToolsOptions);
15
- /**
16
- * Calls OpenAI API to use a chat model.
17
- */
18
- gptChat(prompt: Prompt): Promise<PromptChatResult>;
19
- /**
20
- * Calls OpenAI API to use a complete model.
21
- */
22
- gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
23
- }
24
- /**
25
-
26
- * TODO: Maybe Create some common util for gptChat and gptComplete
27
- * TODO: Maybe make custom OpenaiError
28
- */
1
+ import type { Prompt } from '../../../../types/Prompt';
2
+ import type { NaturalExecutionTools } from '../../../NaturalExecutionTools';
3
+ import type { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
4
+ import type { OpenAiExecutionToolsOptions } from './OpenAiExecutionToolsOptions';
5
+ /**
6
+ * Execution Tools for calling OpenAI API.
7
+ */
8
+ export declare class OpenAiExecutionTools implements NaturalExecutionTools {
9
+ private readonly options;
10
+ /**
11
+ * OpenAI API client.
12
+ */
13
+ private readonly openai;
14
+ constructor(options: OpenAiExecutionToolsOptions);
15
+ /**
16
+ * Calls OpenAI API to use a chat model.
17
+ */
18
+ gptChat(prompt: Prompt): Promise<PromptChatResult>;
19
+ /**
20
+ * Calls OpenAI API to use a complete model.
21
+ */
22
+ gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
23
+ }
24
+ /**
25
+
26
+ * TODO: Maybe Create some common util for gptChat and gptComplete
27
+ * TODO: Maybe make custom OpenaiError
28
+ */
@@ -1,16 +1,16 @@
1
- import { string_token } from '../../../.././types/typeAliases';
2
- import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
- /**
4
- * Options for OpenAiExecutionTools
5
- */
6
- export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
7
- /**
8
- * OpenAI API key
9
- */
10
- openAiApiKey: string_token;
11
- /**
12
- * A unique identifier representing your end-user, which can help OpenAI to monitor
13
- * and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
14
- */
15
- user?: string_token;
16
- };
1
+ import { string_token } from '../../../.././types/typeAliases';
2
+ import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
+ /**
4
+ * Options for OpenAiExecutionTools
5
+ */
6
+ export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
7
+ /**
8
+ * OpenAI API key
9
+ */
10
+ openAiApiKey: string_token;
11
+ /**
12
+ * A unique identifier representing your end-user, which can help OpenAI to monitor
13
+ * and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
14
+ */
15
+ user?: string_token;
16
+ };
@@ -1,3 +1,3 @@
1
- import type OpenAI from 'openai';
2
- import type { PromptResult } from '../../../PromptResult';
3
- export declare function computeOpenaiUsage(rawResponse: Pick<OpenAI.Chat.Completions.ChatCompletion | OpenAI.Completions.Completion, 'model' | 'usage'>): PromptResult['usage'];
1
+ import type OpenAI from 'openai';
2
+ import type { PromptResult } from '../../../PromptResult';
3
+ export declare function computeOpenaiUsage(rawResponse: Pick<OpenAI.Chat.Completions.ChatCompletion | OpenAI.Completions.Completion, 'model' | 'usage'>): PromptResult['usage'];
@@ -1,35 +1,35 @@
1
- import { Prompt } from '../../../../types/Prompt';
2
- import { NaturalExecutionTools } from '../../../NaturalExecutionTools';
3
- import { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
4
- import { RemoteNaturalExecutionToolsOptions } from './RemoteNaturalExecutionToolsOptions';
5
- /**
6
- * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
7
- *
8
- * You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
9
- * This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
10
- *
11
- * @see https://github.com/webgptorg/promptbook#remote-server
12
- */
13
- export declare class RemoteNaturalExecutionTools implements NaturalExecutionTools {
14
- private readonly options;
15
- constructor(options: RemoteNaturalExecutionToolsOptions);
16
- /**
17
- * Creates a connection to the remote proxy server.
18
- */
19
- private makeConnection;
20
- /**
21
- * Calls remote proxy server to use a chat model.
22
- */
23
- gptChat(prompt: Prompt): Promise<PromptChatResult>;
24
- /**
25
- * Calls remote proxy server to use a completion model.
26
- */
27
- gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
28
- /**
29
- * Calls remote proxy server to use both completion or chat model.
30
- */
31
- private gptCommon;
32
- }
33
- /**
34
- * TODO: [๐Ÿคนโ€โ™‚๏ธ] RemoteNaturalExecutionTools should extend Destroyable and implement IDestroyable
35
- */
1
+ import { Prompt } from '../../../../types/Prompt';
2
+ import { NaturalExecutionTools } from '../../../NaturalExecutionTools';
3
+ import { PromptChatResult, PromptCompletionResult } from '../../../PromptResult';
4
+ import { RemoteNaturalExecutionToolsOptions } from './RemoteNaturalExecutionToolsOptions';
5
+ /**
6
+ * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
7
+ *
8
+ * You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
9
+ * This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
10
+ *
11
+ * @see https://github.com/webgptorg/promptbook#remote-server
12
+ */
13
+ export declare class RemoteNaturalExecutionTools implements NaturalExecutionTools {
14
+ private readonly options;
15
+ constructor(options: RemoteNaturalExecutionToolsOptions);
16
+ /**
17
+ * Creates a connection to the remote proxy server.
18
+ */
19
+ private makeConnection;
20
+ /**
21
+ * Calls remote proxy server to use a chat model.
22
+ */
23
+ gptChat(prompt: Prompt): Promise<PromptChatResult>;
24
+ /**
25
+ * Calls remote proxy server to use a completion model.
26
+ */
27
+ gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
28
+ /**
29
+ * Calls remote proxy server to use both completion or chat model.
30
+ */
31
+ private gptCommon;
32
+ }
33
+ /**
34
+ * TODO: [๐Ÿคนโ€โ™‚๏ธ] RemoteNaturalExecutionTools should extend Destroyable and implement IDestroyable
35
+ */
@@ -1,23 +1,23 @@
1
- import type { client_id, string_uri } from '../../../.././types/typeAliases';
2
- import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
- /**
4
- * Options for RemoteNaturalExecutionTools
5
- */
6
- export type RemoteNaturalExecutionToolsOptions = CommonExecutionToolsOptions & {
7
- /**
8
- * URL of the remote PROMPTBOOK server
9
- * On this server will be connected to the socket.io server
10
- */
11
- readonly remoteUrl: URL;
12
- /**
13
- * Path for the Socket.io server to listen
14
- *
15
- * @default '/socket.io'
16
- * @example '/promptbook/socket.io'
17
- */
18
- readonly path: string_uri;
19
- /**
20
- * Your client ID
21
- */
22
- readonly clientId: client_id;
23
- };
1
+ import type { client_id, string_uri } from '../../../.././types/typeAliases';
2
+ import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
+ /**
4
+ * Options for RemoteNaturalExecutionTools
5
+ */
6
+ export type RemoteNaturalExecutionToolsOptions = CommonExecutionToolsOptions & {
7
+ /**
8
+ * URL of the remote PROMPTBOOK server
9
+ * On this server will be connected to the socket.io server
10
+ */
11
+ readonly remoteUrl: URL;
12
+ /**
13
+ * Path for the Socket.io server to listen
14
+ *
15
+ * @default '/socket.io'
16
+ * @example '/promptbook/socket.io'
17
+ */
18
+ readonly path: string_uri;
19
+ /**
20
+ * Your client ID
21
+ */
22
+ readonly clientId: client_id;
23
+ };