@promptbook/google 0.92.0-3 → 0.92.0-30

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 (171) hide show
  1. package/esm/index.es.js +211 -45
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +22 -6
  5. package/esm/typings/src/_packages/deepseek.index.d.ts +2 -0
  6. package/esm/typings/src/_packages/google.index.d.ts +2 -0
  7. package/esm/typings/src/_packages/types.index.d.ts +4 -2
  8. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  9. package/esm/typings/src/cli/common/$provideLlmToolsForCli.d.ts +1 -1
  10. package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
  11. package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
  12. package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
  13. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
  14. package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
  15. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
  16. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
  17. package/esm/typings/src/config.d.ts +41 -11
  18. package/esm/typings/src/constants.d.ts +43 -2
  19. package/esm/typings/src/conversion/archive/loadArchive.d.ts +2 -2
  20. package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
  21. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
  22. package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
  23. package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
  24. package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
  25. package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
  26. package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
  27. package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
  28. package/esm/typings/src/execution/CommonToolsOptions.d.ts +5 -1
  29. package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
  30. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +4 -2
  31. package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
  32. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +12 -9
  33. package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +11 -8
  34. package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -3
  35. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +20 -14
  36. package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
  37. package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
  38. package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
  39. package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
  40. package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +21 -5
  41. package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +19 -5
  42. package/esm/typings/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +9 -0
  43. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
  44. package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
  45. package/esm/typings/src/execution/utils/uncertainNumber.d.ts +3 -2
  46. package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +8 -6
  47. package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +66 -0
  48. package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
  49. package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
  50. package/esm/typings/src/formats/csv/utils/csvParse.d.ts +12 -0
  51. package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
  52. package/esm/typings/src/formats/index.d.ts +2 -2
  53. package/esm/typings/src/formats/json/{JsonFormatDefinition.d.ts → JsonFormatParser.d.ts} +6 -6
  54. package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
  55. package/esm/typings/src/formats/json/utils/jsonParse.d.ts +8 -0
  56. package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
  57. package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
  58. package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
  59. package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
  60. package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +16 -7
  61. package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -1
  62. package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
  63. package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
  64. package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +29 -0
  65. package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
  66. package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
  67. package/esm/typings/src/formfactors/index.d.ts +33 -8
  68. package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +4 -2
  69. package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
  70. package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +3 -2
  71. package/esm/typings/src/high-level-abstractions/index.d.ts +2 -2
  72. package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
  73. package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
  74. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
  75. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +4 -3
  76. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +17 -4
  77. package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +11 -4
  78. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +27 -5
  79. package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +9 -2
  80. package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +12 -3
  81. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +10 -5
  82. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +5 -3
  83. package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
  84. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
  85. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  86. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +4 -0
  87. package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +23 -0
  88. package/esm/typings/src/llm-providers/google/google-models.d.ts +23 -0
  89. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
  90. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  91. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
  92. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
  93. package/esm/typings/src/migrations/migratePipeline.d.ts +9 -0
  94. package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
  95. package/esm/typings/src/personas/preparePersona.d.ts +1 -1
  96. package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
  97. package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
  98. package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
  99. package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
  100. package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
  101. package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +9 -6
  102. package/esm/typings/src/pipeline/PipelineJson/PersonaJson.d.ts +4 -2
  103. package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +3 -2
  104. package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
  105. package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
  106. package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +1 -1
  107. package/esm/typings/src/prepare/prepareTasks.d.ts +7 -4
  108. package/esm/typings/src/remote-server/openapi-types.d.ts +348 -6
  109. package/esm/typings/src/remote-server/openapi.d.ts +398 -4
  110. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +2 -1
  111. package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
  112. package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
  113. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
  114. package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
  115. package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
  116. package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
  117. package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
  118. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
  119. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
  120. package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
  121. package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
  122. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
  123. package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
  124. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
  125. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
  126. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
  127. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
  128. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
  129. package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
  130. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
  131. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
  132. package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
  133. package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
  134. package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
  135. package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
  136. package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +10 -0
  137. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +7 -0
  138. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
  139. package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
  140. package/esm/typings/src/types/ModelVariant.d.ts +5 -5
  141. package/esm/typings/src/types/typeAliases.d.ts +17 -13
  142. package/esm/typings/src/utils/$Register.d.ts +8 -7
  143. package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
  144. package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
  145. package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
  146. package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
  147. package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
  148. package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
  149. package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
  150. package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
  151. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
  152. package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
  153. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
  154. package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
  155. package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
  156. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
  157. package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
  158. package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
  159. package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
  160. package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
  161. package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
  162. package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
  163. package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
  164. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
  165. package/esm/typings/src/version.d.ts +2 -1
  166. package/package.json +2 -2
  167. package/umd/index.umd.js +211 -44
  168. package/umd/index.umd.js.map +1 -1
  169. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +0 -31
  170. package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
  171. package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
@@ -2,8 +2,8 @@
2
2
  * Organizational helper to better mark the place where to really use empty object `{}`
3
3
  *
4
4
  * Note: There are 2 similar types>
5
- * - `empty_object` @@@
6
- * - `just_empty_object` @@@
5
+ * - `empty_object` Type used for empty data objects allowing for potential future extensions
6
+ * - `just_empty_object` Type used when an object must remain permanently empty
7
7
  *
8
8
  * @private within the repository
9
9
  */
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Organizational helper to better @@@@
2
+ * Organizational helper to better distinguish different empty object use cases.
3
3
  *
4
- * Note: There are 2 similar types>
5
- * - `empty_object` @@@
6
- * - `just_empty_object` @@@
4
+ * Note: There are 2 similar types:
5
+ * - `empty_object` Type used for empty data objects with potential extensions
6
+ * - `just_empty_object` Type used specifically for objects that must remain empty
7
7
  *
8
8
  * Note: In most cases, you should use `empty_object`
9
9
  *
@@ -1,26 +1,26 @@
1
1
  import type { string_parameter_name } from '../../types/typeAliases';
2
2
  import type { string_parameter_value } from '../../types/typeAliases';
3
3
  /**
4
- * @@@
4
+ * Options for mapping available parameters to expected parameters in a pipeline task.
5
5
  */
6
6
  type MakeapAvailableToExpectedParametersOptions = {
7
7
  /**
8
- * @@@
8
+ * The set of expected parameter names (keys) for the task, all values are null.
9
9
  */
10
10
  readonly expectedParameters: Readonly<Record<string_parameter_name, null>>;
11
11
  /**
12
- * @@@
12
+ * The set of available parameters (name-value pairs) to map to the expected parameters.
13
13
  */
14
14
  readonly availableParameters: Readonly<Record<string_parameter_name, string_parameter_value>>;
15
15
  };
16
16
  /**
17
- * Maps available parameters to expected parameters
17
+ * Maps available parameters to expected parameters for a pipeline task.
18
18
  *
19
19
  * The strategy is:
20
- * 1) @@@
21
- * 2) @@@
20
+ * 1) First, match parameters by name where both available and expected.
21
+ * 2) Then, if there are unmatched expected and available parameters, map them by order.
22
22
  *
23
- * @throws {PipelineExecutionError} @@@
23
+ * @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
24
24
  * @private within the repository used in `createPipelineExecutor`
25
25
  */
26
26
  export declare function mapAvailableToExpectedParameters(options: MakeapAvailableToExpectedParametersOptions): Readonly<Record<string_parameter_name, string_parameter_value>>;
@@ -1,10 +1,11 @@
1
1
  import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
2
2
  /**
3
- * @@@
3
+ * Creates a deep clone of a PipelineJson object, copying all properties explicitly.
4
4
  *
5
- * Note: It is usefull @@@
5
+ * Note: It is useful for ensuring that modifications to the returned pipeline do not affect the original.
6
6
  *
7
- * @param pipeline
7
+ * @param pipeline The pipeline to clone.
8
+ * @returns A new PipelineJson object with the same properties as the input.
8
9
  * @public exported from `@promptbook/utils`
9
10
  */
10
11
  export declare function clonePipeline(pipeline: PipelineJson): PipelineJson;
@@ -1,7 +1,11 @@
1
1
  import type { WritableDeep } from 'type-fest';
2
2
  /**
3
- * @@@
3
+ * Creates a deep clone of the given object
4
4
  *
5
+ * Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
6
+ *
7
+ * @param objectValue The object to clone.
8
+ * @returns A deep, writable clone of the input object.
5
9
  * @public exported from `@promptbook/utils`
6
10
  */
7
11
  export declare function deepClone<TObject>(objectValue: TObject): WritableDeep<TObject>;
@@ -1,10 +1,10 @@
1
1
  import type { string_javascript_name } from '../../../types/typeAliases';
2
2
  import type { really_unknown } from '../../organization/really_unknown';
3
3
  /**
4
- * @@@
4
+ * Checks if the given value is a valid JavaScript identifier name.
5
5
  *
6
- * @param javascriptName @@@
7
- * @returns @@@
6
+ * @param javascriptName The value to check for JavaScript identifier validity.
7
+ * @returns `true` if the value is a valid JavaScript name, false otherwise.
8
8
  * @public exported from `@promptbook/utils`
9
9
  */
10
10
  export declare function isValidJavascriptName(javascriptName: really_unknown): javascriptName is string_javascript_name;
@@ -1,10 +1,11 @@
1
1
  import type { string_parameter_name } from '../../../types/typeAliases';
2
2
  /**
3
- * Function `validateParameterName` will @@@
3
+ * Function `validateParameterName` will normalize and validate a parameter name for use in pipelines.
4
+ * It removes diacritics, emojis, and quotes, normalizes to camelCase, and checks for reserved names and invalid characters.
4
5
  *
5
- * @param parameterName @@@
6
- * @returns @@@
7
- * @throws {ParseError} @@@
6
+ * @param parameterName The parameter name to validate and normalize.
7
+ * @returns The validated and normalized parameter name.
8
+ * @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
8
9
  * @private within the repository
9
10
  */
10
11
  export declare function validateParameterName(parameterName: string): string_parameter_name;
@@ -14,7 +14,8 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
14
14
  */
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
- * @@@
17
+ * Represents the version string of the Promptbook engine.
18
+ * It follows semantic versioning (e.g., `0.92.0-29`).
18
19
  *
19
20
  * @generated
20
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/google",
3
- "version": "0.92.0-3",
3
+ "version": "0.92.0-30",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -51,7 +51,7 @@
51
51
  "module": "./esm/index.es.js",
52
52
  "typings": "./esm/typings/src/_packages/google.index.d.ts",
53
53
  "peerDependencies": {
54
- "@promptbook/core": "0.92.0-3"
54
+ "@promptbook/core": "0.92.0-30"
55
55
  },
56
56
  "dependencies": {
57
57
  "@ai-sdk/google": "1.0.5",
package/umd/index.umd.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-3';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-30';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -424,10 +424,10 @@
424
424
  */
425
425
 
426
426
  /**
427
- * @@@
427
+ * Removes diacritic marks (accents) from characters in a string.
428
428
  *
429
- * @param input @@@
430
- * @returns @@@
429
+ * @param input The string containing diacritics to be normalized.
430
+ * @returns The string with diacritics removed or normalized.
431
431
  * @public exported from `@promptbook/utils`
432
432
  */
433
433
  function removeDiacritics(input) {
@@ -573,14 +573,18 @@
573
573
  /**
574
574
  * Make UncertainNumber
575
575
  *
576
- * @param value
576
+ * @param value value of the uncertain number, if `NaN` or `undefined`, it will be set to 0 and `isUncertain=true`
577
+ * @param isUncertain if `true`, the value is uncertain, otherwise depends on the value
577
578
  *
578
579
  * @private utility for initializating UncertainNumber
579
580
  */
580
- function uncertainNumber(value) {
581
+ function uncertainNumber(value, isUncertain) {
581
582
  if (value === null || value === undefined || Number.isNaN(value)) {
582
583
  return UNCERTAIN_ZERO_VALUE;
583
584
  }
585
+ if (isUncertain === true) {
586
+ return { value, isUncertain };
587
+ }
584
588
  return { value };
585
589
  }
586
590
 
@@ -646,7 +650,7 @@
646
650
  const SMALL_NUMBER = 0.001;
647
651
  // <- TODO: [🧜‍♂️]
648
652
  /**
649
- * @@@
653
+ * Default settings for parsing and generating CSV files in Promptbook.
650
654
  *
651
655
  * @public exported from `@promptbook/core`
652
656
  */
@@ -931,8 +935,12 @@
931
935
  */
932
936
 
933
937
  /**
934
- * @@@
938
+ * Creates a deep clone of the given object
939
+ *
940
+ * Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
935
941
  *
942
+ * @param objectValue The object to clone.
943
+ * @returns A deep, writable clone of the input object.
936
944
  * @public exported from `@promptbook/utils`
937
945
  */
938
946
  function deepClone(objectValue) {
@@ -994,13 +1002,13 @@
994
1002
  */
995
1003
  const REPLACING_NONCE = 'ptbkauk42kV2dzao34faw7FudQUHYPtW';
996
1004
  /**
997
- * @@@
1005
+ * Placeholder value indicating a parameter is missing its value.
998
1006
  *
999
1007
  * @private within the repository
1000
1008
  */
1001
1009
  const RESERVED_PARAMETER_MISSING_VALUE = 'MISSING-' + REPLACING_NONCE;
1002
1010
  /**
1003
- * @@@
1011
+ * Placeholder value indicating a parameter is restricted and cannot be used directly.
1004
1012
  *
1005
1013
  * @private within the repository
1006
1014
  */
@@ -1163,10 +1171,12 @@
1163
1171
  throw new PipelineExecutionError('Parameter is already opened or not closed');
1164
1172
  }
1165
1173
  if (parameters[parameterName] === undefined) {
1174
+ console.log('!!! templateParameters 1', { parameterName, template, parameters });
1166
1175
  throw new PipelineExecutionError(`Parameter \`{${parameterName}}\` is not defined`);
1167
1176
  }
1168
1177
  let parameterValue = parameters[parameterName];
1169
1178
  if (parameterValue === undefined) {
1179
+ console.log('!!! templateParameters 2', { parameterName, template, parameters });
1170
1180
  throw new PipelineExecutionError(`Parameter \`{${parameterName}}\` is not defined`);
1171
1181
  }
1172
1182
  parameterValue = valueToString(parameterValue);
@@ -1358,6 +1368,183 @@
1358
1368
  };
1359
1369
  }
1360
1370
 
1371
+ /**
1372
+ * Function computeUsage will create price per one token based on the string value found on openai page
1373
+ *
1374
+ * @private within the repository, used only as internal helper for `OPENAI_MODELS`
1375
+ */
1376
+ function computeUsage(value) {
1377
+ const [price, tokens] = value.split(' / ');
1378
+ return parseFloat(price.replace('$', '')) / parseFloat(tokens.replace('M tokens', '')) / 1000000;
1379
+ }
1380
+
1381
+ /**
1382
+ * List of available Google models with descriptions
1383
+ *
1384
+ * Note: Done at 2025-05-06
1385
+ *
1386
+ * @see https://ai.google.dev/models/gemini
1387
+ * @public exported from `@promptbook/google`
1388
+ */
1389
+ const GOOGLE_MODELS = exportJson({
1390
+ name: 'GOOGLE_MODELS',
1391
+ value: [
1392
+ {
1393
+ modelVariant: 'CHAT',
1394
+ modelTitle: 'Gemini 2.5 Pro',
1395
+ modelName: 'gemini-2.5-pro-preview-03-25',
1396
+ modelDescription: 'Latest advanced multimodal model with exceptional reasoning, tool use, and instruction following. 1M token context window with improved vision capabilities for complex visual tasks.',
1397
+ pricing: {
1398
+ prompt: computeUsage(`$8.00 / 1M tokens`),
1399
+ output: computeUsage(`$24.00 / 1M tokens`),
1400
+ },
1401
+ },
1402
+ {
1403
+ modelVariant: 'CHAT',
1404
+ modelTitle: 'Gemini 2.0 Flash',
1405
+ modelName: 'gemini-2.0-flash',
1406
+ modelDescription: 'Fast, efficient model optimized for rapid response times. Good balance between performance and cost, with strong capabilities across text, code, and reasoning tasks. 128K context window.',
1407
+ pricing: {
1408
+ prompt: computeUsage(`$0.35 / 1M tokens`),
1409
+ output: computeUsage(`$1.05 / 1M tokens`),
1410
+ },
1411
+ },
1412
+ {
1413
+ modelVariant: 'CHAT',
1414
+ modelTitle: 'Gemini 2.0 Flash Lite',
1415
+ modelName: 'gemini-2.0-flash-lite',
1416
+ modelDescription: 'Streamlined version of Gemini 2.0 Flash, designed for extremely low-latency applications and edge deployments. Optimized for efficiency while maintaining core capabilities.',
1417
+ pricing: {
1418
+ prompt: computeUsage(`$0.20 / 1M tokens`),
1419
+ output: computeUsage(`$0.60 / 1M tokens`),
1420
+ },
1421
+ },
1422
+ {
1423
+ modelVariant: 'CHAT',
1424
+ modelTitle: 'Gemini 2.0 Flash Thinking',
1425
+ modelName: 'gemini-2.0-flash-thinking-exp-01-21',
1426
+ modelDescription: 'Experimental model focused on enhanced reasoning with explicit chain-of-thought processes. Designed for tasks requiring structured thinking and problem-solving approaches.',
1427
+ pricing: {
1428
+ prompt: computeUsage(`$0.35 / 1M tokens`),
1429
+ output: computeUsage(`$1.05 / 1M tokens`),
1430
+ },
1431
+ },
1432
+ {
1433
+ modelVariant: 'CHAT',
1434
+ modelTitle: 'Gemini 1.5 Flash',
1435
+ modelName: 'gemini-1.5-flash',
1436
+ modelDescription: 'Efficient model balancing speed and quality for general-purpose applications. 1M token context window with good multimodal capabilities and quick response times.',
1437
+ pricing: {
1438
+ prompt: computeUsage(`$0.25 / 1M tokens`),
1439
+ output: computeUsage(`$0.75 / 1M tokens`),
1440
+ },
1441
+ },
1442
+ {
1443
+ modelVariant: 'CHAT',
1444
+ modelTitle: 'Gemini 1.5 Flash Latest',
1445
+ modelName: 'gemini-1.5-flash-latest',
1446
+ modelDescription: 'Points to the latest version of Gemini 1.5 Flash, ensuring access to the most recent improvements and bug fixes while maintaining stable interfaces.',
1447
+ },
1448
+ {
1449
+ modelVariant: 'CHAT',
1450
+ modelTitle: 'Gemini 1.5 Flash 001',
1451
+ modelName: 'gemini-1.5-flash-001',
1452
+ modelDescription: 'First stable release of Gemini 1.5 Flash model with reliable performance characteristics for production applications. 1M token context window.',
1453
+ },
1454
+ {
1455
+ modelVariant: 'CHAT',
1456
+ modelTitle: 'Gemini 1.5 Flash 002',
1457
+ modelName: 'gemini-1.5-flash-002',
1458
+ modelDescription: 'Improved version of Gemini 1.5 Flash with enhanced instruction following and more consistent outputs. Refined for better application integration.',
1459
+ },
1460
+ {
1461
+ modelVariant: 'CHAT',
1462
+ modelTitle: 'Gemini 1.5 Flash Exp',
1463
+ modelName: 'gemini-1.5-flash-exp-0827',
1464
+ modelDescription: 'Experimental version of Gemini 1.5 Flash with new capabilities being tested. May offer improved performance but with potential behavior differences from stable releases.',
1465
+ },
1466
+ {
1467
+ modelVariant: 'CHAT',
1468
+ modelTitle: 'Gemini 1.5 Flash 8B',
1469
+ modelName: 'gemini-1.5-flash-8b',
1470
+ modelDescription: 'Compact 8B parameter model optimized for efficiency and deployment in resource-constrained environments. Good performance despite smaller size.',
1471
+ },
1472
+ {
1473
+ modelVariant: 'CHAT',
1474
+ modelTitle: 'Gemini 1.5 Flash 8B Latest',
1475
+ modelName: 'gemini-1.5-flash-8b-latest',
1476
+ modelDescription: 'Points to the most recent version of the compact 8B parameter model, providing latest improvements while maintaining a small footprint.',
1477
+ },
1478
+ {
1479
+ modelVariant: 'CHAT',
1480
+ modelTitle: 'Gemini 1.5 Flash 8B Exp',
1481
+ modelName: 'gemini-1.5-flash-8b-exp-0924',
1482
+ modelDescription: 'Experimental version of the 8B parameter model with new capabilities and optimizations being evaluated for future stable releases.',
1483
+ },
1484
+ {
1485
+ modelVariant: 'CHAT',
1486
+ modelTitle: 'Gemini 1.5 Flash 8B Exp',
1487
+ modelName: 'gemini-1.5-flash-8b-exp-0827',
1488
+ modelDescription: 'August experimental release of the efficient 8B parameter model with specific improvements to reasoning capabilities and response quality.',
1489
+ },
1490
+ {
1491
+ modelVariant: 'CHAT',
1492
+ modelTitle: 'Gemini 1.5 Pro Latest',
1493
+ modelName: 'gemini-1.5-pro-latest',
1494
+ modelDescription: 'Points to the most recent version of the flagship Gemini 1.5 Pro model, ensuring access to the latest capabilities and improvements.',
1495
+ pricing: {
1496
+ prompt: computeUsage(`$7.00 / 1M tokens`),
1497
+ output: computeUsage(`$21.00 / 1M tokens`),
1498
+ },
1499
+ },
1500
+ {
1501
+ modelVariant: 'CHAT',
1502
+ modelTitle: 'Gemini 1.5 Pro',
1503
+ modelName: 'gemini-1.5-pro',
1504
+ modelDescription: 'Flagship multimodal model with strong performance across text, code, vision, and audio tasks. 1M token context window with excellent reasoning capabilities.',
1505
+ pricing: {
1506
+ prompt: computeUsage(`$6.00 / 1M tokens`),
1507
+ output: computeUsage(`$18.00 / 1M tokens`),
1508
+ },
1509
+ },
1510
+ {
1511
+ modelVariant: 'CHAT',
1512
+ modelTitle: 'Gemini 1.5 Pro 001',
1513
+ modelName: 'gemini-1.5-pro-001',
1514
+ modelDescription: 'First stable release of Gemini 1.5 Pro with consistent performance characteristics and reliable behavior for production applications.',
1515
+ },
1516
+ {
1517
+ modelVariant: 'CHAT',
1518
+ modelTitle: 'Gemini 1.5 Pro 002',
1519
+ modelName: 'gemini-1.5-pro-002',
1520
+ modelDescription: 'Refined version of Gemini 1.5 Pro with improved instruction following, better multimodal understanding, and more consistent outputs.',
1521
+ },
1522
+ {
1523
+ modelVariant: 'CHAT',
1524
+ modelTitle: 'Gemini 1.5 Pro Exp',
1525
+ modelName: 'gemini-1.5-pro-exp-0827',
1526
+ modelDescription: 'Experimental version of Gemini 1.5 Pro with new capabilities and optimizations being tested before wider release. May offer improved performance.',
1527
+ },
1528
+ {
1529
+ modelVariant: 'CHAT',
1530
+ modelTitle: 'Gemini 1.0 Pro',
1531
+ modelName: 'gemini-1.0-pro',
1532
+ modelDescription: 'Original Gemini series foundation model with solid multimodal capabilities. 32K context window with good performance on text, code, and basic vision tasks.',
1533
+ pricing: {
1534
+ prompt: computeUsage(`$0.35 / 1M tokens`),
1535
+ output: computeUsage(`$1.05 / 1M tokens`),
1536
+ },
1537
+ },
1538
+ // <- [🕕]
1539
+ ],
1540
+ });
1541
+ /**
1542
+ * TODO: [🧠] Add information about context window sizes, capabilities, and relative performance characteristics
1543
+ * TODO: [🎰] Some mechanism to auto-update available models
1544
+ * TODO: [🧠] Verify pricing information is current with Google's official documentation
1545
+ * Note: [💞] Ignore a discrepancy between file name and entity name
1546
+ */
1547
+
1361
1548
  /**
1362
1549
  * Execution Tools for calling Google Gemini API.
1363
1550
  *
@@ -1379,29 +1566,7 @@
1379
1566
  title: 'Google',
1380
1567
  description: 'Implementation of Google models',
1381
1568
  vercelProvider: googleGeminiVercelProvider,
1382
- availableModels: [
1383
- // TODO: [🕘] Maybe list models in same way as in other providers - in separate file with metadata
1384
- 'gemini-2.5-pro-preview-03-25',
1385
- 'gemini-2.0-flash',
1386
- 'gemini-2.0-flash-lite',
1387
- 'gemini-2.0-flash-thinking-exp-01-21',
1388
- 'gemini-1.5-flash',
1389
- 'gemini-1.5-flash-latest',
1390
- 'gemini-1.5-flash-001',
1391
- 'gemini-1.5-flash-002',
1392
- 'gemini-1.5-flash-exp-0827',
1393
- 'gemini-1.5-flash-8b',
1394
- 'gemini-1.5-flash-8b-latest',
1395
- 'gemini-1.5-flash-8b-exp-0924',
1396
- 'gemini-1.5-flash-8b-exp-0827',
1397
- 'gemini-1.5-pro-latest',
1398
- 'gemini-1.5-pro',
1399
- 'gemini-1.5-pro-001',
1400
- 'gemini-1.5-pro-002',
1401
- 'gemini-1.5-pro-exp-0827',
1402
- 'gemini-1.0-pro',
1403
- // <- [🕕]
1404
- ].map((modelName) => ({ modelName, modelVariant: 'CHAT' })),
1569
+ availableModels: GOOGLE_MODELS,
1405
1570
  ...options,
1406
1571
  });
1407
1572
  }, {
@@ -1436,7 +1601,8 @@
1436
1601
  }
1437
1602
 
1438
1603
  /**
1439
- * @@@
1604
+ * Safely retrieves the global scope object (window in browser, global in Node.js)
1605
+ * regardless of the JavaScript environment in which the code is running
1440
1606
  *
1441
1607
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
1442
1608
  *
@@ -1447,10 +1613,10 @@
1447
1613
  }
1448
1614
 
1449
1615
  /**
1450
- * @@@
1616
+ * Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
1451
1617
  *
1452
- * @param text @@@
1453
- * @returns @@@
1618
+ * @param text The text string to be converted to SCREAMING_CASE format.
1619
+ * @returns The normalized text in SCREAMING_CASE format.
1454
1620
  * @example 'HELLO_WORLD'
1455
1621
  * @example 'I_LOVE_PROMPTBOOK'
1456
1622
  * @public exported from `@promptbook/utils`
@@ -1502,10 +1668,10 @@
1502
1668
  */
1503
1669
 
1504
1670
  /**
1505
- * @@@
1671
+ * Normalizes a text string to snake_case format.
1506
1672
  *
1507
- * @param text @@@
1508
- * @returns @@@
1673
+ * @param text The text string to be converted to snake_case format.
1674
+ * @returns The normalized text in snake_case format.
1509
1675
  * @example 'hello_world'
1510
1676
  * @example 'i_love_promptbook'
1511
1677
  * @public exported from `@promptbook/utils`
@@ -1515,11 +1681,11 @@
1515
1681
  }
1516
1682
 
1517
1683
  /**
1518
- * Register is @@@
1684
+ * Global registry for storing and managing registered entities of a given type.
1519
1685
  *
1520
1686
  * Note: `$` is used to indicate that this function is not a pure function - it accesses and adds variables in global scope.
1521
1687
  *
1522
- * @private internal utility, exported are only signleton instances of this class
1688
+ * @private internal utility, exported are only singleton instances of this class
1523
1689
  */
1524
1690
  class $Register {
1525
1691
  constructor(registerName) {
@@ -1563,10 +1729,10 @@
1563
1729
  }
1564
1730
 
1565
1731
  /**
1566
- * @@@
1732
+ * Register for LLM tools.
1567
1733
  *
1568
1734
  * Note: `$` is used to indicate that this interacts with the global scope
1569
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
1735
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
1570
1736
  * @public exported from `@promptbook/core`
1571
1737
  */
1572
1738
  const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
@@ -1590,6 +1756,7 @@
1590
1756
  */
1591
1757
 
1592
1758
  exports.BOOK_LANGUAGE_VERSION = BOOK_LANGUAGE_VERSION;
1759
+ exports.GOOGLE_MODELS = GOOGLE_MODELS;
1593
1760
  exports.PROMPTBOOK_ENGINE_VERSION = PROMPTBOOK_ENGINE_VERSION;
1594
1761
  exports._GoogleRegistration = _GoogleRegistration;
1595
1762
  exports.createGoogleExecutionTools = createGoogleExecutionTools;