@promptbook/openai 0.61.0-10 → 0.61.0-12

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 (207) hide show
  1. package/esm/index.es.js +9 -2
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/promptbook-collection/index.d.ts +83 -2
  4. package/esm/typings/src/_packages/core.index.d.ts +2 -2
  5. package/esm/typings/src/_packages/types.index.d.ts +2 -2
  6. package/esm/typings/src/_packages/utils.index.d.ts +3 -1
  7. package/esm/typings/src/cli/cli-commands/hello.d.ts +3 -0
  8. package/esm/typings/src/cli/cli-commands/make.d.ts +3 -0
  9. package/esm/typings/src/cli/cli-commands/prettify.d.ts +3 -0
  10. package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
  11. package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
  12. package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
  13. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -0
  14. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  15. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -1
  16. package/esm/typings/src/config.d.ts +4 -0
  17. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
  18. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +1 -0
  19. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +2 -0
  20. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +6 -0
  21. package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
  22. package/{umd/typings/src/errors/VersionMismatch.d.ts → esm/typings/src/errors/VersionMismatchError.d.ts} +1 -1
  23. package/esm/typings/src/execution/CommonExecutionToolsOptions.d.ts +1 -0
  24. package/esm/typings/src/execution/LlmExecutionTools.d.ts +3 -1
  25. package/esm/typings/src/execution/PipelineExecutor.d.ts +4 -3
  26. package/esm/typings/src/execution/PromptResult.d.ts +12 -0
  27. package/esm/typings/src/execution/ScriptExecutionTools.d.ts +4 -2
  28. package/esm/typings/src/execution/createPipelineExecutor.d.ts +2 -0
  29. package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -0
  30. package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -0
  31. package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +1 -0
  32. package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +1 -0
  33. package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -0
  34. package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +1 -1
  35. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -0
  36. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
  37. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -0
  38. package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +22 -0
  39. package/esm/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +10 -0
  40. package/esm/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +10 -0
  41. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
  42. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
  43. package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +16 -0
  44. package/esm/typings/src/llm-providers/_common/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
  45. package/esm/typings/src/llm-providers/_common/utils/count-total-cost/countTotalCost.d.ts +14 -0
  46. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -0
  47. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  48. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
  49. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -0
  50. package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
  51. package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +3 -0
  52. package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +1 -1
  53. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
  54. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
  55. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -1
  56. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +1 -0
  57. package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
  58. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
  59. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
  60. package/esm/typings/src/personas/preparePersona.d.ts +4 -2
  61. package/esm/typings/src/prepare/preparePipeline.d.ts +3 -1
  62. package/esm/typings/src/prepare/unpreparePipeline.d.ts +1 -0
  63. package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +25 -0
  64. package/esm/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
  65. package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +30 -0
  66. package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +13 -0
  67. package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
  68. package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
  69. package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +9 -0
  70. package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +9 -0
  71. package/esm/typings/src/storage/memory/MemoryStorage.d.ts +34 -0
  72. package/esm/typings/src/storage/utils/PrefixStorage.d.ts +26 -0
  73. package/esm/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
  74. package/esm/typings/src/types/ModelRequirements.d.ts +21 -1
  75. package/esm/typings/src/types/Parameters.d.ts +0 -1
  76. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -2
  77. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -5
  78. package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +1 -0
  79. package/esm/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
  80. package/esm/typings/src/types/PipelineString.d.ts +1 -1
  81. package/esm/typings/src/types/Prompt.d.ts +5 -2
  82. package/esm/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
  83. package/esm/typings/src/types/typeAliases.d.ts +35 -1
  84. package/esm/typings/src/utils/emojis.d.ts +2 -2
  85. package/esm/typings/src/utils/formatNumber.d.ts +1 -1
  86. package/esm/typings/src/utils/isRunningInWhatever.d.ts +3 -0
  87. package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +1 -1
  88. package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
  89. package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
  90. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
  91. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +7 -0
  92. package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  93. package/esm/typings/src/utils/organization/TODO.d.ts +2 -0
  94. package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -0
  95. package/esm/typings/src/utils/organization/___.d.ts +2 -0
  96. package/esm/typings/src/utils/organization/just.d.ts +1 -0
  97. package/esm/typings/src/utils/organization/keepImported.d.ts +12 -0
  98. package/esm/typings/src/utils/organization/notUsing.d.ts +12 -0
  99. package/esm/typings/src/utils/organization/really_any.d.ts +2 -0
  100. package/esm/typings/src/utils/random/randomSeed.d.ts +7 -0
  101. package/esm/typings/src/version.d.ts +3 -0
  102. package/package.json +2 -2
  103. package/umd/index.umd.js +9 -2
  104. package/umd/index.umd.js.map +1 -1
  105. package/umd/typings/promptbook-collection/index.d.ts +83 -2
  106. package/umd/typings/src/_packages/core.index.d.ts +2 -2
  107. package/umd/typings/src/_packages/types.index.d.ts +2 -2
  108. package/umd/typings/src/_packages/utils.index.d.ts +3 -1
  109. package/umd/typings/src/cli/cli-commands/hello.d.ts +3 -0
  110. package/umd/typings/src/cli/cli-commands/make.d.ts +3 -0
  111. package/umd/typings/src/cli/cli-commands/prettify.d.ts +3 -0
  112. package/umd/typings/src/cli/promptbookCli.d.ts +1 -0
  113. package/umd/typings/src/collection/PipelineCollection.d.ts +1 -1
  114. package/umd/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
  115. package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -0
  116. package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  117. package/umd/typings/src/commands/_common/types/CommandParser.d.ts +4 -1
  118. package/umd/typings/src/config.d.ts +4 -0
  119. package/umd/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
  120. package/umd/typings/src/conversion/pipelineStringToJson.d.ts +1 -0
  121. package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +2 -0
  122. package/umd/typings/src/conversion/validation/validatePipeline.d.ts +6 -0
  123. package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
  124. package/{esm/typings/src/errors/VersionMismatch.d.ts → umd/typings/src/errors/VersionMismatchError.d.ts} +1 -1
  125. package/umd/typings/src/execution/CommonExecutionToolsOptions.d.ts +1 -0
  126. package/umd/typings/src/execution/LlmExecutionTools.d.ts +3 -1
  127. package/umd/typings/src/execution/PipelineExecutor.d.ts +4 -3
  128. package/umd/typings/src/execution/PromptResult.d.ts +12 -0
  129. package/umd/typings/src/execution/ScriptExecutionTools.d.ts +4 -2
  130. package/umd/typings/src/execution/createPipelineExecutor.d.ts +2 -0
  131. package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +1 -0
  132. package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +1 -0
  133. package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +1 -0
  134. package/umd/typings/src/formats/xml/XmlFormatDefinition.d.ts +1 -0
  135. package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -0
  136. package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +1 -1
  137. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +1 -0
  138. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
  139. package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +1 -0
  140. package/umd/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +22 -0
  141. package/umd/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +10 -0
  142. package/umd/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +10 -0
  143. package/umd/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
  144. package/umd/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
  145. package/umd/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +16 -0
  146. package/umd/typings/src/llm-providers/_common/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
  147. package/umd/typings/src/llm-providers/_common/utils/count-total-cost/countTotalCost.d.ts +14 -0
  148. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -0
  149. package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  150. package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
  151. package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -0
  152. package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
  153. package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +3 -0
  154. package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +1 -1
  155. package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +1 -1
  156. package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +1 -1
  157. package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +3 -1
  158. package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +1 -0
  159. package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
  160. package/umd/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
  161. package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
  162. package/umd/typings/src/personas/preparePersona.d.ts +4 -2
  163. package/umd/typings/src/prepare/preparePipeline.d.ts +3 -1
  164. package/umd/typings/src/prepare/unpreparePipeline.d.ts +1 -0
  165. package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +25 -0
  166. package/umd/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
  167. package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +30 -0
  168. package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +13 -0
  169. package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
  170. package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
  171. package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +9 -0
  172. package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +9 -0
  173. package/umd/typings/src/storage/memory/MemoryStorage.d.ts +34 -0
  174. package/umd/typings/src/storage/utils/PrefixStorage.d.ts +26 -0
  175. package/umd/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
  176. package/umd/typings/src/types/ModelRequirements.d.ts +21 -1
  177. package/umd/typings/src/types/Parameters.d.ts +0 -1
  178. package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +1 -2
  179. package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -5
  180. package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +1 -0
  181. package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
  182. package/umd/typings/src/types/PipelineString.d.ts +1 -1
  183. package/umd/typings/src/types/Prompt.d.ts +5 -2
  184. package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
  185. package/umd/typings/src/types/typeAliases.d.ts +35 -1
  186. package/umd/typings/src/utils/emojis.d.ts +2 -2
  187. package/umd/typings/src/utils/formatNumber.d.ts +1 -1
  188. package/umd/typings/src/utils/isRunningInWhatever.d.ts +3 -0
  189. package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +1 -1
  190. package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
  191. package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
  192. package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
  193. package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +7 -0
  194. package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  195. package/umd/typings/src/utils/organization/TODO.d.ts +2 -0
  196. package/umd/typings/src/utils/organization/TODO_USE.d.ts +1 -0
  197. package/umd/typings/src/utils/organization/___.d.ts +2 -0
  198. package/umd/typings/src/utils/organization/just.d.ts +1 -0
  199. package/umd/typings/src/utils/organization/keepImported.d.ts +12 -0
  200. package/umd/typings/src/utils/organization/notUsing.d.ts +12 -0
  201. package/umd/typings/src/utils/organization/really_any.d.ts +2 -0
  202. package/umd/typings/src/utils/random/randomSeed.d.ts +7 -0
  203. package/umd/typings/src/version.d.ts +3 -0
  204. package/esm/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
  205. package/esm/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTests.d.ts +0 -7
  206. package/umd/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
  207. package/umd/typings/src/knowledge/prepare-knowledge/_common/utils/getLlmToolsForTests.d.ts +0 -7
@@ -1,4 +1,7 @@
1
+ import type { number_model_temperature } from './typeAliases';
2
+ import type { number_seed } from './typeAliases';
1
3
  import type { string_model_name } from './typeAliases';
4
+ import type { string_system_message } from './typeAliases';
2
5
  export declare const MODEL_VARIANTS: readonly ["COMPLETION", "CHAT", "EMBEDDING"];
3
6
  /**
4
7
  * Model variant describes the very general type of the model
@@ -31,13 +34,30 @@ export type ModelRequirements = {
31
34
  * @example 'gpt-4', 'gpt-4-32k-0314', 'gpt-3.5-turbo-instruct',...
32
35
  */
33
36
  readonly modelName?: string_model_name;
37
+ /**
38
+ * System message to be used in the model
39
+ */
40
+ readonly systemMessage?: string_system_message;
41
+ /**
42
+ * The temperature of the model
43
+ *
44
+ * Note: [💱] Promptbook is using just `temperature` (not `top_k` and `top_p`)
45
+ */
46
+ readonly temperature?: number_model_temperature;
47
+ /**
48
+ * Seed for the model
49
+ */
50
+ readonly seed?: number_seed;
34
51
  /**
35
52
  * Maximum number of tokens that can be generated by the model
36
53
  */
37
54
  readonly maxTokens?: number;
38
55
  };
39
56
  /**
40
- * TODO: !!!!! Add and use systemMessage, temprerature, top_k, top_p, presencePenalty, frequencyPenalty, bestOf, n, logitBias, logitBiasType, stop, ... to ModelRequirements
57
+ * TODO: [🧠][🈁] `seed` should maybe be somewhere else (not in `ModelRequirements`) (simmilar that `user` identification is not here)
58
+ * TODO: [🧠][💱] Add more model options: `stop_token`, `logit_bias`, `logprobs` (`top_logprobs`), `top_k`, `top_p`, `presence_penalty`, `frequency_penalty`, `bestOf`, `logitBias`, `logitBiasType`,...
59
+ * [💱] Probbably keep using just `temperature` in Promptbook (not `top_k` and `top_p`)
60
+ * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
41
61
  * TODO: Maybe figure out better word than "variant"
42
62
  * TODO: Add here more requirement options like max context size, max tokens, etc.
43
63
  * TODO: [💕][🧠] Just selecting gpt3 or gpt4 level of model
@@ -10,6 +10,5 @@
10
10
  */
11
11
  export type Parameters = object;
12
12
  /**
13
- * TODO: !!!!! Implement samples into parameters
14
13
  * TODO: Constrain type to Simple key-value object, only string keys and string values and no index signature + only camelCase keys and spaceTrimmed values
15
14
  */
@@ -14,7 +14,7 @@ import type { PromptTemplateParameterJson } from './PromptTemplateParameterJson'
14
14
  * Promptbook is the **core concept of this package**.
15
15
  * It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
16
16
  *
17
- * @see !!! https://github.com/webgptorg/promptbook#promptbook
17
+ * @see @@@ https://github.com/webgptorg/promptbook#promptbook
18
18
  */
19
19
  export type PipelineJson = {
20
20
  /**
@@ -79,7 +79,6 @@ export type PipelineJson = {
79
79
  readonly preparations: Array<PreparationJson>;
80
80
  };
81
81
  /**
82
- * TODO: !!!!! Implement new commands
83
82
  * Note: There was a proposal for multiple types of promptbook objects 78816ff33e2705ee1a187aa2eb8affd976d4ea1a
84
83
  * But then immediately reverted back to the single type
85
84
  * With knowledge as part of the promptbook and collection just as a collection of promptbooks
@@ -1,16 +1,11 @@
1
1
  import type { PromptResultUsage } from '../../execution/PromptResult';
2
2
  import type { string_promptbook_version } from '../../version';
3
3
  import type { number_id } from '../typeAliases';
4
- import type { string_date_iso8601 } from '../typeAliases';
5
4
  export type PreparationJson = {
6
5
  /**
7
6
  * Incremental ID of the preparation
8
7
  */
9
8
  readonly id: number_id;
10
- /**
11
- * Date and time of the preparation
12
- */
13
- readonly date: string_date_iso8601;
14
9
  /**
15
10
  * Version of the promptbook used for the preparation
16
11
  */
@@ -22,4 +17,5 @@ export type PreparationJson = {
22
17
  };
23
18
  /**
24
19
  * TODO: Maybe put here used `modelName`
20
+ * TODO: [🍥] When using `date` it changes all samples .ptbk.json files each time so until some more elegant solution omit the time from prepared pipeline
25
21
  */
@@ -80,4 +80,5 @@ export interface PromptTemplateJsonCommon {
80
80
  }
81
81
  /**
82
82
  * TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template
83
+ * TODO: [♈] Probbably move expectations from templates to parameters
83
84
  */
@@ -1,5 +1,6 @@
1
1
  import type { string_markdown_text } from '../typeAliases';
2
- import type { string_name } from '../typeAliases';
2
+ import type { string_parameter_name } from '../typeAliases';
3
+ import type { string_parameter_value } from '../typeAliases';
3
4
  /**
4
5
  * Describes one parameter of the promptbook
5
6
  */
@@ -9,7 +10,7 @@ export type PromptTemplateParameterJson = {
9
10
  * - It must be unique across the pipeline
10
11
  * - It should start lowercase and contain letters and numbers
11
12
  */
12
- readonly name: string_name;
13
+ readonly name: string_parameter_name;
13
14
  /**
14
15
  * The parameter is input of the pipeline
15
16
  */
@@ -23,4 +24,12 @@ export type PromptTemplateParameterJson = {
23
24
  * - It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
24
25
  */
25
26
  readonly description?: string_markdown_text;
27
+ /**
28
+ * Sample values of the parameter
29
+ * Note: This values won't be actually used as some default values, but they are just for better understanding of the parameter
30
+ */
31
+ readonly sampleValues?: Array<string_parameter_value>;
26
32
  };
33
+ /**
34
+ * TODO: [♈] Probbably move expectations from templates to parameters
35
+ */
@@ -2,7 +2,7 @@
2
2
  * Promptbook is the **core concept of this package**.
3
3
  * It represents a series of prompt templates chained together to form a pipeline / one big prompt template with input and result parameters.
4
4
  *
5
- * @see !!! https://github.com/webgptorg/promptbook#promptbook
5
+ * @see @@@ https://github.com/webgptorg/promptbook#promptbook
6
6
  */
7
7
  export type PipelineString = string & {
8
8
  readonly _type: 'Promptbook';
@@ -2,13 +2,15 @@ import type { ExpectFormatCommand } from '../commands/EXPECT/ExpectFormatCommand
2
2
  import type { PostprocessingFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
3
3
  import type { ModelRequirements } from './ModelRequirements';
4
4
  import type { Expectations } from './PipelineJson/Expectations';
5
- import type { string_name } from './typeAliases';
5
+ import type { string_parameter_name } from './typeAliases';
6
+ import type { string_parameter_value } from './typeAliases';
6
7
  import type { string_pipeline_url_with_hashtemplate } from './typeAliases';
7
8
  import type { string_prompt } from './typeAliases';
8
9
  import type { string_title } from './typeAliases';
9
10
  /**
10
11
  * Prompt in a text along with model requirements, but without any execution or templating logic.
11
12
  *
13
+ * Note: [🛫] This is NOT fully serializable as JSON, it contains functions which are not serializable
12
14
  * @see https://github.com/webgptorg/promptbook#prompt
13
15
  */
14
16
  export type Prompt = {
@@ -58,8 +60,9 @@ export type Prompt = {
58
60
  *
59
61
  * Note: This is redundant (same information is in pipelineUrl+content) but useful for logging and debugging
60
62
  */
61
- readonly parameters: Record<string_name, string>;
63
+ readonly parameters: Record<string_parameter_name, string_parameter_value>;
62
64
  };
63
65
  /**
64
66
  * TODO: [✔] Check ModelRequirements in runtime
67
+ * TODO: [🏳] Add options for translation - maybe create `TranslationPrompt`
65
68
  */
@@ -2,6 +2,6 @@ import type { FromtoItems } from '../../utils/FromtoItems';
2
2
  /**
3
3
  * Count the duration of working time
4
4
  *
5
- * @private within the package
5
+ * @private within the repository
6
6
  */
7
7
  export declare function countWorkingDuration(items: FromtoItems): number;
@@ -32,6 +32,12 @@ export type string_text_prompt = string_prompt;
32
32
  * For example `"How many hats does the cat wear?"`
33
33
  */
34
34
  export type string_chat_prompt = string_text_prompt;
35
+ /**
36
+ * Semantic helper
37
+ *
38
+ * For example `"You are an AI assistant. You are here to help me with my work."`
39
+ */
40
+ export type string_system_message = string_text_prompt;
35
41
  /**
36
42
  * Semantic helper
37
43
  *
@@ -73,6 +79,20 @@ export type string_char = string;
73
79
  * For example `"ainautes"`
74
80
  */
75
81
  export type string_name = string;
82
+ /**
83
+ * Semantic helper
84
+ * Unique identifier of anything
85
+ *
86
+ * For example `"eventName"`
87
+ */
88
+ export type string_parameter_name = string;
89
+ /**
90
+ * Semantic helper
91
+ * Unique identifier of anything
92
+ *
93
+ * For example `"DevConf 2024"`
94
+ */
95
+ export type string_parameter_value = string;
76
96
  /**
77
97
  * Semantic helper
78
98
  * Title of anything
@@ -462,9 +482,22 @@ export type number_negative = number;
462
482
  export type number_integer = number;
463
483
  /**
464
484
  * Semantic helper;
465
- * Percentage from 0 to 1 (100%)
485
+ * Percentage from 0 to 1 (100%) (and bellow and above)
466
486
  */
467
487
  export type number_percent = number;
488
+ /**
489
+ * Semantic helper;
490
+ * Model temperature
491
+ */
492
+ export type number_model_temperature = number_percent;
493
+ /**
494
+ * Semantic helper;
495
+ * Seed for random generator
496
+ *
497
+ * Percentage from 0 to 1 (100%)
498
+ * TODO: Is seed (in OpenAI) number from 0 to 1?
499
+ */
500
+ export type number_seed = number_percent;
468
501
  /**
469
502
  * Likeness of the wallpaper
470
503
  *
@@ -491,4 +524,5 @@ export type number_terabytes = number_positive;
491
524
  * TODO: !!! Change "For example" to @example
492
525
  * TODO: !! Cleanup
493
526
  * TODO: !! Change to branded types
527
+ * TODO: [📂] Export all this file through `@promptbook/types`
494
528
  */
@@ -5,7 +5,7 @@ import type { string_char_emoji } from '../types/typeAliasEmoji';
5
5
  *
6
6
  * @see https://getemoji.com/
7
7
  *
8
- * @private within the package
8
+ * @private within the repository
9
9
  * @deprecated Use /\p{Extended_Pictographic}/ instead
10
10
  */
11
11
  export declare const EMOJIS_IN_CATEGORIES: Record<string, Array<string_char_emoji>>;
@@ -13,7 +13,7 @@ export declare const EMOJIS_IN_CATEGORIES: Record<string, Array<string_char_emoj
13
13
  *
14
14
  * All possible emoji chars like "🍆", "🍡", "🍤"...
15
15
  *
16
- * @private within the package
16
+ * @private within the repository
17
17
  * @deprecated Use /\p{Extended_Pictographic}/ instead
18
18
  */
19
19
  export declare const EMOJIS: Set<string_char_emoji>;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Format either small or big number
3
3
  *
4
- * @private within the package
4
+ * @private within the repository
5
5
  */
6
6
  export declare function formatNumber(value: number): string;
@@ -10,3 +10,6 @@ export declare const isRunningInNode: Function;
10
10
  * Detects if the code is running in a web worker
11
11
  */
12
12
  export declare const isRunningInWebWorker: Function;
13
+ /**
14
+ * TODO: [🔼] !!! Export via `@promptbook/utils`
15
+ */
@@ -3,7 +3,7 @@ import type { string_name } from '../../types/typeAliases';
3
3
  /**
4
4
  * Add or modify an auto-generated section in a markdown file
5
5
  *
6
- * @private within the package
6
+ * @private within the repository
7
7
  */
8
8
  export declare function addAutoGeneratedSection(content: string_markdown, options: {
9
9
  readonly sectionName: string_name;
@@ -28,7 +28,7 @@ type CreateMarkdownChartOptions = {
28
28
  /**
29
29
  * Function createMarkdownChart will draw a chart in markdown from ⬛+🟦 tiles
30
30
  *
31
- * @private within the package
31
+ * @private within the repository
32
32
  */
33
33
  export declare function createMarkdownChart(options: CreateMarkdownChartOptions): string_markdown;
34
34
  export {};
@@ -3,6 +3,6 @@ import type { string_markdown_text } from '../../types/typeAliases';
3
3
  /**
4
4
  * Create a markdown table from a 2D array of strings
5
5
  *
6
- * @private within the package
6
+ * @private within the repository
7
7
  */
8
8
  export declare function createMarkdownTable(table: Array<Array<string_markdown_text>>): string_markdown;
@@ -3,6 +3,10 @@ import type { string_markdown } from '../../types/typeAliases';
3
3
  * Single code block inside markdown.
4
4
  */
5
5
  export type CodeBlock = {
6
+ /**
7
+ * Which notation was used to open the code block
8
+ */
9
+ readonly blockNotation: '```' | '>';
6
10
  /**
7
11
  * Language of the code block OR null if the language is not specified in opening ```
8
12
  */
@@ -25,3 +29,6 @@ export type CodeBlock = {
25
29
  *
26
30
  */
27
31
  export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): Array<CodeBlock>;
32
+ /**
33
+ * TODO: Maybe name for `blockNotation` instead of '```' and '>'
34
+ */
@@ -15,5 +15,5 @@ import type { CodeBlock } from './extractAllBlocksFromMarkdown';
15
15
  */
16
16
  export declare function extractOneBlockFromMarkdown(markdown: string_markdown): CodeBlock;
17
17
  /***
18
- * TODO: [🍓][🌻] !!! Decide of this is internal util, external util OR validator/postprocessor
18
+ * TODO: [🍓][🌻] Decide of this is internal util, external util OR validator/postprocessor
19
19
  */
@@ -1,4 +1,6 @@
1
1
  /**
2
2
  * Organizational helper to better mark the place where the type is missing
3
+ *
4
+ * @private within the repository
3
5
  */
4
6
  export type TODO = any;
@@ -7,5 +7,6 @@ import type { really_any } from './really_any';
7
7
  *
8
8
  * @param value any values
9
9
  * @returns void
10
+ * @private within the repository
10
11
  */
11
12
  export declare function TODO_USE(...value: Array<really_any>): void;
@@ -1,4 +1,6 @@
1
1
  /**
2
2
  * Formatting helper to put void to keep longer version of prettier
3
+ *
4
+ * @private within the repository
3
5
  */
4
6
  export type ___ = never;
@@ -6,5 +6,6 @@
6
6
  *
7
7
  * @param value any values
8
8
  * @returns the same values
9
+ * @private within the repository
9
10
  */
10
11
  export declare function just<T>(value?: T): T;
@@ -0,0 +1,12 @@
1
+ import type { really_any } from './really_any';
2
+ /**
3
+ * Just says that the variable is not used but should be kept
4
+ * No side effects.
5
+ *
6
+ * Note: It can be usefull suppressing eager optimization of unused imports
7
+ *
8
+ * @param value any values
9
+ * @returns void
10
+ * @private within the repository
11
+ */
12
+ export declare function keepImported(...value: Array<really_any>): void;
@@ -0,0 +1,12 @@
1
+ import type { really_any } from './really_any';
2
+ /**
3
+ * Just says that the variable is not used
4
+ * No side effects.
5
+ *
6
+ * Note: It can be usefull suppressing eslint errors of unused variables in the tests
7
+ *
8
+ * @param value any values
9
+ * @returns void
10
+ * @private within the repository
11
+ */
12
+ export declare function notUsing(...value: Array<really_any>): void;
@@ -1,4 +1,6 @@
1
1
  /**
2
2
  * Organizational helper to mark a place where to really use any
3
+ *
4
+ * @private within the repository
3
5
  */
4
6
  export type really_any = any;
@@ -0,0 +1,7 @@
1
+ import type { number_seed } from '../../types/typeAliases';
2
+ /**
3
+ * Generates random seed
4
+ *
5
+ * Warning: This function is not cryptographically secure (it uses Math.random internally)
6
+ */
7
+ export declare function $randomSeed(): number_seed;
@@ -4,3 +4,6 @@ import type { string_semantic_version } from './types/typeAliases';
4
4
  */
5
5
  export declare const PROMPTBOOK_VERSION: string_promptbook_version;
6
6
  export type string_promptbook_version = string_semantic_version;
7
+ /**
8
+ * TODO: [🔼] !!! Export via `@promptbook/code`
9
+ */
@@ -1,7 +0,0 @@
1
- /**
2
- * Just testing imports and compatibility
3
- */
4
- export declare function justTestFsImport(): Promise<void>;
5
- /**
6
- * TODO: !!! Remove this file
7
- */
@@ -1,7 +0,0 @@
1
- import type { LlmExecutionTools } from '../../../../execution/LlmExecutionTools';
2
- /**
3
- * Returns LLM tools for testing purposes
4
- *
5
- * @private within the package - JUST FOR TESTS
6
- */
7
- export declare function getLlmToolsForTests(): LlmExecutionTools;
@@ -1,7 +0,0 @@
1
- /**
2
- * Just testing imports and compatibility
3
- */
4
- export declare function justTestFsImport(): Promise<void>;
5
- /**
6
- * TODO: !!! Remove this file
7
- */
@@ -1,7 +0,0 @@
1
- import type { LlmExecutionTools } from '../../../../execution/LlmExecutionTools';
2
- /**
3
- * Returns LLM tools for testing purposes
4
- *
5
- * @private within the package - JUST FOR TESTS
6
- */
7
- export declare function getLlmToolsForTests(): LlmExecutionTools;