@promptbook/types 0.8.0

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 (190) hide show
  1. package/README.md +5 -0
  2. package/esm/index.es.js +2 -0
  3. package/esm/index.es.js.map +1 -0
  4. package/esm/typings/_packages/core.index.d.ts +17 -0
  5. package/esm/typings/_packages/execute-javascript.index.d.ts +3 -0
  6. package/esm/typings/_packages/openai.index.d.ts +3 -0
  7. package/esm/typings/_packages/remote-client.index.d.ts +4 -0
  8. package/esm/typings/_packages/remote-server.index.d.ts +3 -0
  9. package/esm/typings/_packages/types.index.d.ts +20 -0
  10. package/esm/typings/_packages/utils.index.d.ts +6 -0
  11. package/esm/typings/_packages/wizzard.index.d.ts +2 -0
  12. package/esm/typings/classes/PromptTemplatePipeline.d.ts +68 -0
  13. package/esm/typings/classes/PromptTemplatePipelineLibrary.d.ts +55 -0
  14. package/esm/typings/config.d.ts +10 -0
  15. package/esm/typings/conversion/_importPtp.d.ts +12 -0
  16. package/esm/typings/conversion/parseCommand.d.ts +6 -0
  17. package/esm/typings/conversion/parseCommand.test.d.ts +1 -0
  18. package/esm/typings/conversion/promptTemplatePipelineStringToJson.d.ts +12 -0
  19. package/esm/typings/conversion/promptTemplatePipelineStringToJson.test.d.ts +1 -0
  20. package/esm/typings/conversion/validatePromptTemplatePipelineJson.d.ts +26 -0
  21. package/esm/typings/conversion/validatePromptTemplatePipelineJson.test.d.ts +1 -0
  22. package/esm/typings/execution/CommonExecutionToolsOptions.d.ts +6 -0
  23. package/esm/typings/execution/ExecutionTools.d.ts +25 -0
  24. package/esm/typings/execution/NaturalExecutionTools.d.ts +22 -0
  25. package/esm/typings/execution/PromptResult.d.ts +38 -0
  26. package/esm/typings/execution/PtpExecutor.d.ts +19 -0
  27. package/esm/typings/execution/ScriptExecutionTools.d.ts +34 -0
  28. package/esm/typings/execution/UserInterfaceTools.d.ts +30 -0
  29. package/esm/typings/execution/createPtpExecutor.d.ts +18 -0
  30. package/esm/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -0
  31. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
  32. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
  33. package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +27 -0
  34. package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +11 -0
  35. package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -0
  36. package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +16 -0
  37. package/esm/typings/execution/plugins/natural-execution-tools/remote/createRemoteServer.d.ts +16 -0
  38. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Error.d.ts +3 -0
  39. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Progress.d.ts +4 -0
  40. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Request.d.ts +6 -0
  41. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Response.d.ts +4 -0
  42. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +20 -0
  43. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +19 -0
  44. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
  45. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -0
  46. package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
  47. package/esm/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +4 -0
  48. package/esm/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -0
  49. package/esm/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
  50. package/esm/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
  51. package/esm/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -0
  52. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -0
  53. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
  54. package/esm/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -0
  55. package/esm/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
  56. package/esm/typings/types/Command.d.ts +65 -0
  57. package/esm/typings/types/ExecutionTypes.d.ts +13 -0
  58. package/esm/typings/types/ModelRequirements.d.ts +28 -0
  59. package/esm/typings/types/Parameters.d.ts +14 -0
  60. package/esm/typings/types/Prompt.d.ts +35 -0
  61. package/esm/typings/types/PromptTemplatePipelineJson/PromptTemplateJson.d.ts +82 -0
  62. package/esm/typings/types/PromptTemplatePipelineJson/PromptTemplateParameterJson.d.ts +23 -0
  63. package/esm/typings/types/PromptTemplatePipelineJson/PromptTemplatePipelineJson.d.ts +56 -0
  64. package/esm/typings/types/PromptTemplatePipelineString.d.ts +14 -0
  65. package/esm/typings/types/ScriptLanguage.d.ts +9 -0
  66. package/esm/typings/types/TaskProgress.d.ts +12 -0
  67. package/esm/typings/types/typeAliasEmoji.d.ts +9 -0
  68. package/esm/typings/types/typeAliases.d.ts +477 -0
  69. package/esm/typings/utils/emojis.d.ts +16 -0
  70. package/esm/typings/utils/just.d.ts +10 -0
  71. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +15 -0
  72. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
  73. package/esm/typings/utils/markdown/extractBlocksFromMarkdown.d.ts +13 -0
  74. package/esm/typings/utils/markdown/extractBlocksFromMarkdown.test.d.ts +1 -0
  75. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +16 -0
  76. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
  77. package/esm/typings/utils/markdown/removeContentComments.d.ts +8 -0
  78. package/esm/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
  79. package/esm/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
  80. package/esm/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
  81. package/esm/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
  82. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
  83. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
  84. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
  85. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
  86. package/esm/typings/utils/removeEmojis.d.ts +7 -0
  87. package/esm/typings/utils/removeEmojis.test.d.ts +1 -0
  88. package/esm/typings/utils/removeQuotes.d.ts +13 -0
  89. package/esm/typings/utils/removeQuotes.test.d.ts +1 -0
  90. package/esm/typings/utils/replaceParameters.d.ts +16 -0
  91. package/esm/typings/utils/replaceParameters.test.d.ts +1 -0
  92. package/esm/typings/utils/unwrapResult.d.ts +13 -0
  93. package/esm/typings/utils/unwrapResult.test.d.ts +1 -0
  94. package/esm/typings/wizzard/Wizzard.d.ts +1 -0
  95. package/esm/typings/wizzard/sample.d.ts +5 -0
  96. package/package.json +43 -0
  97. package/umd/index.umd.js +9 -0
  98. package/umd/index.umd.js.map +1 -0
  99. package/umd/typings/_packages/core.index.d.ts +17 -0
  100. package/umd/typings/_packages/execute-javascript.index.d.ts +3 -0
  101. package/umd/typings/_packages/openai.index.d.ts +3 -0
  102. package/umd/typings/_packages/remote-client.index.d.ts +4 -0
  103. package/umd/typings/_packages/remote-server.index.d.ts +3 -0
  104. package/umd/typings/_packages/types.index.d.ts +20 -0
  105. package/umd/typings/_packages/utils.index.d.ts +6 -0
  106. package/umd/typings/_packages/wizzard.index.d.ts +2 -0
  107. package/umd/typings/classes/PromptTemplatePipeline.d.ts +68 -0
  108. package/umd/typings/classes/PromptTemplatePipelineLibrary.d.ts +55 -0
  109. package/umd/typings/config.d.ts +10 -0
  110. package/umd/typings/conversion/_importPtp.d.ts +12 -0
  111. package/umd/typings/conversion/parseCommand.d.ts +6 -0
  112. package/umd/typings/conversion/parseCommand.test.d.ts +1 -0
  113. package/umd/typings/conversion/promptTemplatePipelineStringToJson.d.ts +12 -0
  114. package/umd/typings/conversion/promptTemplatePipelineStringToJson.test.d.ts +1 -0
  115. package/umd/typings/conversion/validatePromptTemplatePipelineJson.d.ts +26 -0
  116. package/umd/typings/conversion/validatePromptTemplatePipelineJson.test.d.ts +1 -0
  117. package/umd/typings/execution/CommonExecutionToolsOptions.d.ts +6 -0
  118. package/umd/typings/execution/ExecutionTools.d.ts +25 -0
  119. package/umd/typings/execution/NaturalExecutionTools.d.ts +22 -0
  120. package/umd/typings/execution/PromptResult.d.ts +38 -0
  121. package/umd/typings/execution/PtpExecutor.d.ts +19 -0
  122. package/umd/typings/execution/ScriptExecutionTools.d.ts +34 -0
  123. package/umd/typings/execution/UserInterfaceTools.d.ts +30 -0
  124. package/umd/typings/execution/createPtpExecutor.d.ts +18 -0
  125. package/umd/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -0
  126. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
  127. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
  128. package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +27 -0
  129. package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +11 -0
  130. package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -0
  131. package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +16 -0
  132. package/umd/typings/execution/plugins/natural-execution-tools/remote/createRemoteServer.d.ts +16 -0
  133. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Error.d.ts +3 -0
  134. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Progress.d.ts +4 -0
  135. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Request.d.ts +6 -0
  136. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Ptps_Response.d.ts +4 -0
  137. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +20 -0
  138. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +19 -0
  139. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
  140. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -0
  141. package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
  142. package/umd/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +4 -0
  143. package/umd/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -0
  144. package/umd/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
  145. package/umd/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
  146. package/umd/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -0
  147. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -0
  148. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
  149. package/umd/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -0
  150. package/umd/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
  151. package/umd/typings/types/Command.d.ts +65 -0
  152. package/umd/typings/types/ExecutionTypes.d.ts +13 -0
  153. package/umd/typings/types/ModelRequirements.d.ts +28 -0
  154. package/umd/typings/types/Parameters.d.ts +14 -0
  155. package/umd/typings/types/Prompt.d.ts +35 -0
  156. package/umd/typings/types/PromptTemplatePipelineJson/PromptTemplateJson.d.ts +82 -0
  157. package/umd/typings/types/PromptTemplatePipelineJson/PromptTemplateParameterJson.d.ts +23 -0
  158. package/umd/typings/types/PromptTemplatePipelineJson/PromptTemplatePipelineJson.d.ts +56 -0
  159. package/umd/typings/types/PromptTemplatePipelineString.d.ts +14 -0
  160. package/umd/typings/types/ScriptLanguage.d.ts +9 -0
  161. package/umd/typings/types/TaskProgress.d.ts +12 -0
  162. package/umd/typings/types/typeAliasEmoji.d.ts +9 -0
  163. package/umd/typings/types/typeAliases.d.ts +477 -0
  164. package/umd/typings/utils/emojis.d.ts +16 -0
  165. package/umd/typings/utils/just.d.ts +10 -0
  166. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +15 -0
  167. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
  168. package/umd/typings/utils/markdown/extractBlocksFromMarkdown.d.ts +13 -0
  169. package/umd/typings/utils/markdown/extractBlocksFromMarkdown.test.d.ts +1 -0
  170. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +16 -0
  171. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
  172. package/umd/typings/utils/markdown/removeContentComments.d.ts +8 -0
  173. package/umd/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
  174. package/umd/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
  175. package/umd/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
  176. package/umd/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
  177. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
  178. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
  179. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
  180. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
  181. package/umd/typings/utils/removeEmojis.d.ts +7 -0
  182. package/umd/typings/utils/removeEmojis.test.d.ts +1 -0
  183. package/umd/typings/utils/removeQuotes.d.ts +13 -0
  184. package/umd/typings/utils/removeQuotes.test.d.ts +1 -0
  185. package/umd/typings/utils/replaceParameters.d.ts +16 -0
  186. package/umd/typings/utils/replaceParameters.test.d.ts +1 -0
  187. package/umd/typings/utils/unwrapResult.d.ts +13 -0
  188. package/umd/typings/utils/unwrapResult.test.d.ts +1 -0
  189. package/umd/typings/wizzard/Wizzard.d.ts +1 -0
  190. package/umd/typings/wizzard/sample.d.ts +5 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Removes quotes and optional introduce text from a string
3
+ *
4
+ * Tip: This is very usefull for post-processing of the result of the LLM model
5
+ * Note: This function trims the text and removes whole introduce sentence if it is present
6
+ * Note: There are two simmilar functions:
7
+ * - `removeQuotes` which removes only bounding quotes
8
+ * - `unwrapResult` which removes whole introduce sentence
9
+ *
10
+ * @param text optionally quoted text
11
+ * @returns text without quotes
12
+ */
13
+ export declare function unwrapResult(text: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const Wizzard: any;
@@ -0,0 +1,5 @@
1
+ export {};
2
+ /**
3
+ url, sources nebo folder
4
+ * TODO: [🧠] OpenAi apiKey vs token
5
+ */
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@promptbook/types",
3
+ "version": "0.8.0",
4
+ "description": "Library to supercharge your use of large language models",
5
+ "private": false,
6
+ "sideEffects": false,
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/webgptorg/promptbook"
10
+ },
11
+ "contributors": [
12
+ "Pavol Hejný <me@pavolhejny.com> (https://www.pavolhejny.com/)"
13
+ ],
14
+ "keywords": [
15
+ "autogpt",
16
+ "openai",
17
+ "gpt-3",
18
+ "gpt-4",
19
+ "chatgpt",
20
+ "ai",
21
+ "machine-learning",
22
+ "natural-language-processing",
23
+ "nlp",
24
+ "prompt",
25
+ "template",
26
+ "pipeline",
27
+ "automation",
28
+ "text-generation",
29
+ "language-model"
30
+ ],
31
+ "license": "SEE LICENSE IN LICENSE",
32
+ "bugs": {
33
+ "url": "https://github.com/webgptorg/promptbook/issues"
34
+ },
35
+ "homepage": "https://www.npmjs.com/package/@promptbook/core",
36
+ "dependencies": {},
37
+ "peerDependencies": {
38
+ "@promptbook/core": "0.8.0"
39
+ },
40
+ "main": "./umd/index.umd.js",
41
+ "module": "./esm/index.es.js",
42
+ "typings": "./esm/typings/_packages/types.index.d.ts"
43
+ }
@@ -0,0 +1,9 @@
1
+ (function (factory) {
2
+ typeof define === 'function' && define.amd ? define(factory) :
3
+ factory();
4
+ })((function () { 'use strict';
5
+
6
+
7
+
8
+ }));
9
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ import { PromptTemplatePipeline } from '../classes/PromptTemplatePipeline';
2
+ import { PromptTemplatePipelineLibrary } from '../classes/PromptTemplatePipelineLibrary';
3
+ import { PTP_VERSION } from '../config';
4
+ import { promptTemplatePipelineStringToJson } from '../conversion/promptTemplatePipelineStringToJson';
5
+ import { validatePromptTemplatePipelineJson } from '../conversion/validatePromptTemplatePipelineJson';
6
+ import { createPtpExecutor } from '../execution/createPtpExecutor';
7
+ import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
8
+ import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';
9
+ import { CallbackInterfaceToolsOptions } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions';
10
+ import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools';
11
+ import { ExecutionTypes } from '../types/ExecutionTypes';
12
+ export { ExecutionTypes, PTP_VERSION, PromptTemplatePipeline, PromptTemplatePipelineLibrary };
13
+ export { SimplePromptInterfaceTools };
14
+ export { promptTemplatePipelineStringToJson, validatePromptTemplatePipelineJson };
15
+ export { MockedEchoNaturalExecutionTools };
16
+ export { createPtpExecutor };
17
+ export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
@@ -0,0 +1,3 @@
1
+ import { JavascriptEvalExecutionTools } from '../execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools';
2
+ import { JavascriptExecutionTools } from '../execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools';
3
+ export { JavascriptEvalExecutionTools, JavascriptExecutionTools };
@@ -0,0 +1,3 @@
1
+ import { OpenAiExecutionTools } from '../execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools';
2
+ import { OpenAiExecutionToolsOptions } from '../execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions';
3
+ export { OpenAiExecutionTools, OpenAiExecutionToolsOptions };
@@ -0,0 +1,4 @@
1
+ import { RemoteServerOptions } from '../execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions';
2
+ import { RemoteNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools';
3
+ import { RemoteNaturalExecutionToolsOptions } from '../execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions';
4
+ export { RemoteNaturalExecutionTools, RemoteNaturalExecutionToolsOptions, RemoteServerOptions };
@@ -0,0 +1,3 @@
1
+ import { createRemoteServer } from '../execution/plugins/natural-execution-tools/remote/createRemoteServer';
2
+ import { RemoteServerOptions } from '../execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions';
3
+ export { createRemoteServer, RemoteServerOptions };
@@ -0,0 +1,20 @@
1
+ import { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
2
+ import { ExecutionTools } from '../execution/ExecutionTools';
3
+ import { NaturalExecutionTools } from '../execution/NaturalExecutionTools';
4
+ import { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult } from '../execution/PromptResult';
5
+ import { PtpExecutor } from '../execution/PtpExecutor';
6
+ import { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
7
+ import { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
8
+ import { ExecutionType } from '../types/ExecutionTypes';
9
+ import { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
10
+ import { Parameters } from '../types/Parameters';
11
+ import { Prompt } from '../types/Prompt';
12
+ import { PromptTemplateJson } from '../types/PromptTemplatePipelineJson/PromptTemplateJson';
13
+ import { PromptTemplateParameterJson } from '../types/PromptTemplatePipelineJson/PromptTemplateParameterJson';
14
+ import { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
15
+ import { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineString';
16
+ import { ScriptLanguage } from '../types/ScriptLanguage';
17
+ import { DoneTaskProgress, PendingTaskProgress, TaskProgress } from '../types/TaskProgress';
18
+ import { string_char_emoji } from '../types/typeAliasEmoji';
19
+ import { ILicense, IPersonProfile, IRepository, number_bytes, number_days, number_gigabytes, number_hours, number_integer, number_kilobytes, number_likeness, number_megabytes, number_miliseconds, number_minutes, number_months, number_negative, number_percent, number_positive, number_seconds, number_terabytes, number_weeks, number_years, string_attribute, string_attribute_value_scope, string_business_category_name, string_char, string_chat_prompt, string_color, string_completion_prompt, string_css, string_css_class, string_css_cursor, string_css_property, string_css_selector, string_css_value, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_image_prompt, string_javascript, string_javascript_name, string_license, string_license_token, string_markdown, string_markdown_text, string_midjourney_prompt, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_page, string_password, string_person_fullname, string_person_profile, string_pgp_key, string_prompt, string_protocol, string_ptp_url, string_ptp_url_with_hashtemplate, string_script, string_sha256, string_ssh_key, string_svg, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_translate_name, string_translate_name_not_normalized, string_uri, string_uri_part, string_uriid, string_url, string_url_image, string_version, string_version_dependency, string_wallpaper_id, string_xml, uuid, uuid_first_segment } from '../types/typeAliases';
20
+ export { CommonExecutionToolsOptions, DoneTaskProgress, ExecutionTools, ExecutionType, ILicense, IPersonProfile, IRepository, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, PendingTaskProgress, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptTemplatePipelineJson, PromptTemplatePipelineString, PtpExecutor, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, number_bytes, number_days, number_gigabytes, number_hours, number_integer, number_kilobytes, number_likeness, number_megabytes, number_miliseconds, number_minutes, number_months, number_negative, number_percent, number_positive, number_seconds, number_terabytes, number_weeks, number_years, string_attribute, string_attribute_value_scope, string_business_category_name, string_char, string_char_emoji, string_chat_prompt, string_color, string_completion_prompt, string_css, string_css_class, string_css_cursor, string_css_property, string_css_selector, string_css_value, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_image_prompt, string_javascript, string_javascript_name, string_license, string_license_token, string_markdown, string_markdown_text, string_midjourney_prompt, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_page, string_password, string_person_fullname, string_person_profile, string_pgp_key, string_prompt, string_protocol, string_ptp_url, string_ptp_url_with_hashtemplate, string_script, string_sha256, string_ssh_key, string_svg, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_translate_name, string_translate_name_not_normalized, string_uri, string_uri_part, string_uriid, string_url, string_url_image, string_version, string_version_dependency, string_wallpaper_id, string_xml, uuid, uuid_first_segment, };
@@ -0,0 +1,6 @@
1
+ import { removeContentComments } from '../utils/markdown/removeContentComments';
2
+ import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
3
+ import { removeEmojis } from '../utils/removeEmojis';
4
+ import { removeQuotes } from '../utils/removeQuotes';
5
+ import { unwrapResult } from '../utils/unwrapResult';
6
+ export { removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, unwrapResult };
@@ -0,0 +1,2 @@
1
+ import { Wizzard } from '../wizzard/Wizzard';
2
+ export { Wizzard };
@@ -0,0 +1,68 @@
1
+ import { string_name } from '.././types/typeAliases';
2
+ import { PromptTemplateJson } from '../types/PromptTemplatePipelineJson/PromptTemplateJson';
3
+ import { PromptTemplateParameterJson } from '../types/PromptTemplatePipelineJson/PromptTemplateParameterJson';
4
+ import { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
5
+ import { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineString';
6
+ /**
7
+ * Prompt template pipeline is the **core concept of this library**.
8
+ * It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
9
+ *
10
+ * It can have 3 formats:
11
+ * - **.ptp.md file** in custom markdown format described above
12
+ * - **JSON** format, parsed from the .ptp.md file
13
+ * - _(this)_ **Object** which is created from JSON format and bound with tools around (but not the execution logic)
14
+ *
15
+ * @see https://github.com/webgptorg/promptbook#prompt-template-pipeline
16
+ */
17
+ export declare class PromptTemplatePipeline {
18
+ readonly ptpUrl: URL | null;
19
+ readonly parameters: Record<string_name, PromptTemplateParameterJson>;
20
+ readonly promptTemplates: Array<PromptTemplateJson>;
21
+ /**
22
+ * Constructs PromptTemplatePipeline from any source
23
+ *
24
+ * Note: During the construction syntax and logic of source is validated
25
+ *
26
+ * @param source content of .ptp.md or .ptp.json file
27
+ * @returns PromptTemplatePipeline
28
+ */
29
+ static fromSource(ptpSource: PromptTemplatePipelineString | PromptTemplatePipelineJson): PromptTemplatePipeline;
30
+ /**
31
+ * Constructs PromptTemplatePipeline from markdown source
32
+ *
33
+ * Note: During the construction syntax and logic of source is validated
34
+ *
35
+ * @param ptpString content of .ptp.md file
36
+ * @returns PromptTemplatePipeline
37
+ */
38
+ static fromString(ptpString: PromptTemplatePipelineString): PromptTemplatePipeline;
39
+ /**
40
+ * Constructs PromptTemplatePipeline from JSON source
41
+ *
42
+ * Note: During the construction the source is logic validated
43
+ *
44
+ * @param ptpjson content of .ptp.json file parsed into JSON
45
+ * @returns PromptTemplatePipeline
46
+ */
47
+ static fromJson(ptpjson: PromptTemplatePipelineJson): PromptTemplatePipeline;
48
+ private constructor();
49
+ /**
50
+ * Returns the first prompt template in the pipeline
51
+ */
52
+ get entryPromptTemplate(): PromptTemplateJson;
53
+ /**
54
+ * Gets the parameter that is the result of given prompt template
55
+ */
56
+ getResultingParameter(promptTemplateName: string_name): PromptTemplateParameterJson;
57
+ /**
58
+ * Gets the following prompt template in the pipeline or null if there is no following prompt template and this is the last one
59
+ */
60
+ getFollowingPromptTemplate(promptTemplateName: string_name): PromptTemplateJson | null;
61
+ }
62
+ /**
63
+ * TODO: !! [👐][🧠] Split of PromptTemplatePipeline,PromptTemplatePipelineLibrary between interface and class
64
+ * TODO: !! [👐] Make parameters and promptTemplates private WHEN split between interface and class
65
+ * TODO: !! Add generic type for entry and result parameters
66
+ * TODO: Can be Array elegantly typed such as it must have at least one element?
67
+ * TODO: [🧠] Each PromptTemplatePipeline should have its unique hash to be able to compare them and execute on server ONLY the desired ones
68
+ */
@@ -0,0 +1,55 @@
1
+ import { string_name } from '.././types/typeAliases';
2
+ import { ExecutionTools } from '../execution/ExecutionTools';
3
+ import { PtpExecutor } from '../execution/PtpExecutor';
4
+ import { Prompt } from '../types/Prompt';
5
+ import { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
6
+ import { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineString';
7
+ import { PromptTemplatePipeline } from './PromptTemplatePipeline';
8
+ /**
9
+ * Library of prompt template pipelines that groups together prompt template pipelines for an application. This is a very thin wrapper around the Array / Set of prompt template pipelines.
10
+ *
11
+ * Prompt Template Pipeline library is a useful helper in execution, it can be shared between execution and consumer parts of the app and make common knowledge about prompt template pipelines.
12
+ *
13
+ * It allows to create executor functions from prompt template pipelines in the library.
14
+ *
15
+ * @see https://github.com/webgptorg/promptbook#prompt-template-pipeline-library
16
+ */
17
+ export declare class PromptTemplatePipelineLibrary {
18
+ readonly promptTemplatePipelines: Record<string_name, PromptTemplatePipeline>;
19
+ /**
20
+ * Constructs PromptTemplatePipeline from any sources
21
+ *
22
+ * Note: During the construction syntax and logic of all sources are validated
23
+ * Note: You can combine .ptp.md and .ptp.json files BUT it is not recommended
24
+ *
25
+ * @param ptpSources contents of .ptp.md or .ptp.json files
26
+ * @returns PromptTemplatePipelineLibrary
27
+ */
28
+ static fromSources(ptpSources: Record<string_name, PromptTemplatePipelineJson | PromptTemplatePipelineString>): PromptTemplatePipelineLibrary;
29
+ private constructor();
30
+ /**
31
+ * Gets prompt template pipeline by name
32
+ */
33
+ getPtp(name: string_name): PromptTemplatePipeline;
34
+ /**
35
+ * Checks whether prompt is in the library
36
+ */
37
+ isPromptInLibrary(prompt: Prompt): boolean;
38
+ /**
39
+ * Gets executor function for given prompt template pipeline
40
+ */
41
+ createExecutor(name: string_name, tools: ExecutionTools): PtpExecutor;
42
+ }
43
+ /**
44
+ * TODO: !! [👐][🧠] Split of PromptTemplatePipeline,PromptTemplatePipelineLibrary between interface and class
45
+ * TODO: !! [👐] Make promptTemplatePipelines private WHEN split between interface and class
46
+ * TODO: [🧠] Maybe isPromptInLibrary should be separate utility function
47
+ * TODO: [🧠] Maybe createExecutor should be separate utility function
48
+ * TODO: Static method fromDirectory
49
+ * TODO: [🤜] Add generic type for entry and result parameters
50
+ * TODO: [🧠] Is it better to ptpLibrary.executePtp('writeXyz',{...}) OR ptpLibrary.createExecutor('writeXyz')({...}) OR createExecutor(ptpLibrary.getPtp('writeXyz'))
51
+ * TODO: [🧠] Formarly (before commit 62229afce7668a5b85077cc18becf798b583bf8d) there were two classes PromptTemplatePipelineLibrary+PtpLibraryExecutor (maybe it was better?)
52
+ * TODO: [🧠] Is it better to pass tools into getExecutor or into constructor
53
+ * Maybe it is not a good idea to cache executors when they are can be created with different tools
54
+ * TODO: [👧] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
55
+ */
@@ -0,0 +1,10 @@
1
+ import { ModelRequirements } from './types/ModelRequirements';
2
+ import { string_version } from './types/typeAliases';
3
+ /**
4
+ * The version of the PTP
5
+ */
6
+ export declare const PTP_VERSION: string_version;
7
+ /**
8
+ * Default model requirements for the pipeline
9
+ */
10
+ export declare const DEFAULT_MODEL_REQUIREMENTS: ModelRequirements;
@@ -0,0 +1,12 @@
1
+ import { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
2
+ import { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineString';
3
+ /**
4
+ * Import the text file
5
+ *
6
+ * Note: Using here custom import to work in jest tests
7
+ * Note: Using sync version is 💩 in the production code, but it's ok here in tests
8
+ *
9
+ * @private
10
+ */
11
+ export declare function importPtp(path: `${string}.ptp.md`): PromptTemplatePipelineString;
12
+ export declare function importPtp(path: `${string}.ptp.json`): PromptTemplatePipelineJson;
@@ -0,0 +1,6 @@
1
+ import { string_markdown_text } from '.././types/typeAliases';
2
+ import { Command } from '../types/Command';
3
+ /**
4
+ * Parses one line of ul/ol to command
5
+ */
6
+ export declare function parseCommand(listItem: string_markdown_text): Command;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
2
+ import { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineString';
3
+ /**
4
+ * Parse prompt template pipeline from string format to JSON format
5
+ *
6
+ * Note: This function does not validate logic of the pipeline only the syntax
7
+ */
8
+ export declare function promptTemplatePipelineStringToJson(promptTemplatePipelineString: PromptTemplatePipelineString): PromptTemplatePipelineJson;
9
+ /**
10
+ * TODO: Report here line/column of error
11
+ * TODO: Use spaceTrim more effectively
12
+ */
@@ -0,0 +1,26 @@
1
+ import { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
2
+ /**
3
+ * Validates PromptTemplatePipelineJson if it is logically valid.
4
+ *
5
+ * It checks:
6
+ * - if it has correct parameters dependency
7
+ *
8
+ * It does NOT check:
9
+ * - if it is valid json
10
+ * - if it is meaningful
11
+ *
12
+ * @param ptp valid or invalid PromptTemplatePipelineJson
13
+ * @throws {Error} if invalid
14
+ */
15
+ export declare function validatePromptTemplatePipelineJson(ptp: PromptTemplatePipelineJson): void;
16
+ /**
17
+ * TODO: [🧠] Work with ptpVersion
18
+ * TODO: Use here some json-schema, Zod or something similar and change it to:
19
+ * > /**
20
+ * > * Validates PromptTemplatePipelineJson if it is logically valid.
21
+ * > *
22
+ * > * It checks:
23
+ * > * - it has a valid structure
24
+ * > * - ...
25
+ * > ex port function validatePromptTemplatePipelineJson(ptp: unknown): asserts ptp is PromptTemplatePipelineJson {
26
+ */
@@ -0,0 +1,6 @@
1
+ export interface CommonExecutionToolsOptions {
2
+ /**
3
+ * If true, the internal executions will be logged
4
+ */
5
+ readonly isVerbose?: boolean;
6
+ }
@@ -0,0 +1,25 @@
1
+ import { NaturalExecutionTools } from './NaturalExecutionTools';
2
+ import { ScriptExecutionTools } from './ScriptExecutionTools';
3
+ import { UserInterfaceTools } from './UserInterfaceTools';
4
+ /**
5
+ * All the tools needed to execute prompts (template pipelines).
6
+ *
7
+ * @see https://github.com/webgptorg/promptbook#execution-tools
8
+ */
9
+ export interface ExecutionTools {
10
+ /**
11
+ * Tools for executing prompts to large language models like GPT-4
12
+ */
13
+ natural: NaturalExecutionTools;
14
+ /**
15
+ * Tools for executing scripts
16
+ *
17
+ * Note: You can pass multiple ScriptExecutionTools, they will be tried one by one until one of them supports the script
18
+ * If none of them supports the script, an error is thrown
19
+ */
20
+ script: Array<ScriptExecutionTools>;
21
+ /**
22
+ * Tools for interacting with the user
23
+ */
24
+ userInterface: UserInterfaceTools;
25
+ }
@@ -0,0 +1,22 @@
1
+ import { Prompt } from '../types/Prompt';
2
+ import { PromptChatResult, PromptCompletionResult } from './PromptResult';
3
+ /**
4
+ * Vontainer for all the tools needed to execute prompts to large language models like GPT-4
5
+ * On its interface it exposes common methods for prompt execution.
6
+ * Inside (in constructor) it calls OpenAI, Azure, GPU, proxy, cache, logging,...
7
+ *
8
+ * @see https://github.com/webgptorg/promptbook#natural-execution-tools
9
+ */
10
+ export interface NaturalExecutionTools {
11
+ /**
12
+ * Use a chat model
13
+ */
14
+ gptChat(prompt: Prompt): Promise<PromptChatResult>;
15
+ /**
16
+ * Use a completion model
17
+ */
18
+ gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
19
+ }
20
+ /**
21
+ * TODO: [🧠] Should or should not there be a word "GPT" in both gptComplete and gptChat
22
+ */
@@ -0,0 +1,38 @@
1
+ import { string_model_name } from '.././types/typeAliases';
2
+ /**
3
+ * Prompt result is the simplest concept of execution.
4
+ * It is the result of executing one prompt _(NOT a template)_.
5
+ *
6
+ * @see https://github.com/webgptorg/promptbook#prompt-result
7
+ */
8
+ export type PromptResult = PromptCompletionResult | PromptChatResult;
9
+ /**
10
+ * Prompt completion result
11
+ * It contains only the following text NOT the whole completion
12
+ */
13
+ export type PromptCompletionResult = PromptCommonResult;
14
+ /**
15
+ * Prompt chat result
16
+ */
17
+ export interface PromptChatResult extends PromptCommonResult {
18
+ }
19
+ export interface PromptCommonResult {
20
+ /**
21
+ * Exact text response from the model
22
+ */
23
+ readonly content: string;
24
+ /**
25
+ * Name of the model used to generate the response
26
+ */
27
+ readonly model: string_model_name;
28
+ /**
29
+ * Raw response from the model
30
+ */
31
+ readonly rawResponse: object;
32
+ }
33
+ /**
34
+ * TODO: [🧠] Should here be link to the prompt?
35
+ * TODO: [🧠] Maybe type raw properly - not onject but OpenAI.result.whatever
36
+ * TODO: [🧠] Maybe remove redundant raw.choices.text
37
+ * TODO: Log raw even if prompt failed - log the raw error
38
+ */
@@ -0,0 +1,19 @@
1
+ import { Promisable } from 'type-fest';
2
+ import { string_name } from '.././types/typeAliases';
3
+ import { TaskProgress } from '../types/TaskProgress';
4
+ /**
5
+ * 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)_.
6
+ * Executor is made by combining execution tools and prompt template pipeline library.
7
+ *
8
+ * It can be done in two ways:
9
+ * - From `PromptTemplatePipelineLibrary.getExecutor` method
10
+ * - `createPtpExecutor` utility function
11
+ *
12
+ * @see https://github.com/webgptorg/promptbook#executor
13
+ */
14
+ export interface PtpExecutor {
15
+ (inputParameters: Record<string_name, string>, onProgress: (taskProgress: TaskProgress) => Promisable<void>): Promise<Record<string_name, string>>;
16
+ }
17
+ /**
18
+ * TODO: [🧠] Should this file be in /execution or /types folder?
19
+ */
@@ -0,0 +1,34 @@
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 interface ScriptExecutionTools {
9
+ execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
10
+ }
11
+ /**
12
+ * Input for the script execution
13
+ */
14
+ export interface 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
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Represents all the tools needed to interact with the user.
3
+ *
4
+ * @see https://github.com/webgptorg/promptbook#user-interface-tools
5
+ */
6
+ export interface UserInterfaceTools {
7
+ /**
8
+ * Asks the user to answer a free-text (multiline) question
9
+ *
10
+ * @param options the question to ask
11
+ * @returns the answer from the user
12
+ */
13
+ promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
14
+ }
15
+ export interface UserInterfaceToolsPromptDialogOptions {
16
+ /**
17
+ * Prompt message
18
+ *
19
+ * Note: This is not a prompt to language model but a prompt to the user
20
+ */
21
+ prompt: string;
22
+ /**
23
+ * Default value for the input/textarea
24
+ */
25
+ defaultValue: string | null;
26
+ /**
27
+ * Placeholder for the input/textarea
28
+ */
29
+ placeholder?: string;
30
+ }
@@ -0,0 +1,18 @@
1
+ import { PromptTemplatePipeline } from '../classes/PromptTemplatePipeline';
2
+ import { ExecutionTools } from './ExecutionTools';
3
+ import { PtpExecutor } from './PtpExecutor';
4
+ interface CreatePtpExecutorOptions {
5
+ readonly ptp: PromptTemplatePipeline;
6
+ readonly tools: ExecutionTools;
7
+ }
8
+ /**
9
+ * Creates executor function from prompt template pipeline and execution tools.
10
+ *
11
+ * Note: Consider using getExecutor method of the library instead of using this function
12
+ */
13
+ export declare function createPtpExecutor(options: CreatePtpExecutorOptions): PtpExecutor;
14
+ export {};
15
+ /**
16
+ * TODO: [👧] Strongly type the executors to avoid need of remove nullables whtn noUncheckedIndexedAccess in tsconfig.json
17
+ * Note: CreatePtpExecutorOptions are just connected to PtpExecutor so do not extract to types folder
18
+ */
@@ -0,0 +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
+ */
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
4
+ */
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
4
+ */