@promptbook/google 0.92.0-9 → 0.93.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.
- package/README.md +140 -88
- package/esm/index.es.js +41 -30
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +26 -14
- package/esm/typings/src/_packages/types.index.d.ts +6 -2
- package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
- package/esm/typings/src/config.d.ts +41 -11
- package/esm/typings/src/constants.d.ts +43 -2
- package/esm/typings/src/conversion/parsePipeline.d.ts +2 -2
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
- package/esm/typings/src/errors/CollectionError.d.ts +1 -1
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
- package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
- package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
- package/esm/typings/src/executables/locateApp.d.ts +2 -2
- package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
- package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
- package/esm/typings/src/execution/CommonToolsOptions.d.ts +3 -3
- package/esm/typings/src/execution/ExecutionTask.d.ts +19 -1
- package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +4 -2
- package/esm/typings/src/execution/PromptbookFetch.d.ts +1 -1
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +13 -10
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -3
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +21 -15
- package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
- package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +18 -5
- package/esm/typings/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +9 -0
- package/esm/typings/src/execution/execution-report/ExecutionReportJson.d.ts +1 -1
- package/esm/typings/src/execution/execution-report/ExecutionReportString.d.ts +1 -1
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +3 -3
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +3 -2
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +1 -1
- package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +8 -6
- package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +66 -0
- package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
- package/esm/typings/src/formats/csv/utils/csvParse.d.ts +12 -0
- package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
- package/esm/typings/src/formats/index.d.ts +2 -2
- package/esm/typings/src/formats/json/JsonFormatParser.d.ts +19 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
- package/esm/typings/src/formats/json/utils/jsonParse.d.ts +0 -3
- package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
- package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
- package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +16 -7
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -1
- package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +29 -0
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/index.d.ts +33 -8
- package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +4 -2
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/high-level-abstractions/index.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +4 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +18 -5
- package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +11 -4
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +21 -42
- package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +9 -2
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +13 -4
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +10 -5
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +11 -3
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +6 -0
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +4 -4
- package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
- package/esm/typings/src/migrations/migratePipeline.d.ts +9 -0
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +10 -7
- package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +3 -2
- package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
- package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +1 -1
- package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +2 -2
- package/esm/typings/src/prepare/prepareTasks.d.ts +8 -5
- package/esm/typings/src/remote-server/openapi.d.ts +1 -1
- package/esm/typings/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +1 -1
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -1
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +7 -6
- package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
- package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
- package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -1
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +11 -0
- package/esm/typings/src/storage/local-storage/utils/IndexedDbStorageOptions.d.ts +14 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +8 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
- package/esm/typings/src/types/ModelRequirements.d.ts +2 -2
- package/esm/typings/src/types/ModelVariant.d.ts +5 -5
- package/esm/typings/src/types/typeAliases.d.ts +22 -19
- package/esm/typings/src/utils/$Register.d.ts +8 -7
- package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
- package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
- package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -2
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
- package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
- package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
- package/esm/typings/src/utils/organization/just.d.ts +1 -1
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
- package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
- package/esm/typings/src/utils/removeQuotes.d.ts +2 -2
- package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
- package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
- package/esm/typings/src/utils/trimCodeBlock.d.ts +1 -1
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +1 -1
- package/esm/typings/src/utils/unwrapResult.d.ts +2 -2
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +1 -1
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +1 -1
- package/esm/typings/src/version.d.ts +2 -1
- package/esm/typings/src/wizzard/wizzard.d.ts +1 -1
- package/package.json +15 -3
- package/umd/index.umd.js +41 -30
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +0 -31
- package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +0 -19
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/MultipleLlmExecutionTools.d.ts +0 -0
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/joinLlmExecutionTools.d.ts +0 -0
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/playground/playground.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
|
|
2
2
|
|
|
3
|
-
# ✨ Promptbook
|
|
3
|
+
# ✨ Promptbook: AI apps in plain Language
|
|
4
|
+
|
|
5
|
+
Write AI applications using plain human language across multiple models and platforms.
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
|
|
@@ -8,24 +10,20 @@
|
|
|
8
10
|
[ Promptbook](https://badge.fury.io/js/promptbook.svg)](https://www.npmjs.com/package/promptbook)
|
|
9
11
|
[ Promptbook](https://packagequality.com/shield/promptbook.svg)](https://packagequality.com/#?package=promptbook)
|
|
10
12
|
[](https://snyk.io/test/github/webgptorg/promptbook)
|
|
13
|
+
[](https://github.com/webgptorg/promptbook/actions)
|
|
14
|
+
[](https://coveralls.io/github/webgptorg/promptbook?branch=main)
|
|
11
15
|
[](https://github.com/webgptorg/promptbook/issues)
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
19
|
## 🌟 New Features
|
|
18
20
|
|
|
19
|
-
-
|
|
20
|
-
- 🐳
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
21
|
+
- 💡 VS Code support for `.book` files with syntax highlighting and IntelliSense
|
|
22
|
+
- 🐳 Official Docker image (`hejny/promptbook`) for seamless containerized usage
|
|
23
|
+
- 🔥 Native support for OpenAI `o3-mini`, GPT-4 and other leading LLMs
|
|
24
|
+
- 🔍 DeepSeek integration for advanced knowledge search
|
|
24
25
|
|
|
25
26
|
|
|
26
|
-
<blockquote style="color: #ff8811">
|
|
27
|
-
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
28
|
-
</blockquote>
|
|
29
27
|
|
|
30
28
|
## 📦 Package `@promptbook/google`
|
|
31
29
|
|
|
@@ -320,65 +318,92 @@ Hello world examples:
|
|
|
320
318
|
- [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
321
319
|
- [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
322
320
|
|
|
321
|
+
### 🌐 Community & Social Media
|
|
323
322
|
|
|
323
|
+
Join our growing community of developers and users:
|
|
324
324
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
325
|
+
<table>
|
|
326
|
+
<thead>
|
|
327
|
+
<tr>
|
|
328
|
+
<th>Platform</th>
|
|
329
|
+
<th>Description</th>
|
|
330
|
+
</tr>
|
|
331
|
+
</thead>
|
|
332
|
+
<tbody>
|
|
333
|
+
<tr>
|
|
334
|
+
<td><a href="https://discord.gg/x3QWNaa89N">💬 Discord</a></td>
|
|
335
|
+
<td>Join our active developer community for discussions and support</td>
|
|
336
|
+
</tr>
|
|
337
|
+
<tr>
|
|
338
|
+
<td><a href="https://github.com/webgptorg/promptbook/discussions">🗣️ GitHub Discussions</a></td>
|
|
339
|
+
<td>Technical discussions, feature requests, and community Q&A</td>
|
|
340
|
+
</tr>
|
|
341
|
+
<tr>
|
|
342
|
+
<td><a href="https://linkedin.com/company/promptbook">👔 LinkedIn</a></td>
|
|
343
|
+
<td>Professional updates and industry insights</td>
|
|
344
|
+
</tr>
|
|
345
|
+
<tr>
|
|
346
|
+
<td><a href="https://www.facebook.com/61560776453536">📱 Facebook</a></td>
|
|
347
|
+
<td>General announcements and community engagement</td>
|
|
348
|
+
</tr>
|
|
349
|
+
<tr>
|
|
350
|
+
<td><a href="https://ptbk.io">🔗 ptbk.io</a></td>
|
|
351
|
+
<td>Official landing page with project information</td>
|
|
352
|
+
</tr>
|
|
353
|
+
</tbody>
|
|
354
|
+
</table>
|
|
344
355
|
|
|
356
|
+
### 🖼️ Product & Brand Channels
|
|
345
357
|
|
|
346
|
-
|
|
347
|
-
- [Facebook `Promptujeme`](https://www.facebook.com/promptujeme/)
|
|
358
|
+
#### Promptbook.studio
|
|
348
359
|
|
|
349
|
-
|
|
360
|
+
<table>
|
|
361
|
+
<tbody>
|
|
362
|
+
<tr>
|
|
363
|
+
<td><a href="https://www.instagram.com/promptbook.studio/">📸 Instagram @promptbook.studio</a></td>
|
|
364
|
+
<td>Visual updates, UI showcases, and design inspiration</td>
|
|
365
|
+
</tr>
|
|
366
|
+
|
|
367
|
+
</tbody>
|
|
368
|
+
</table>
|
|
350
369
|
|
|
351
|
-
_/Sub-brand for images and graphics generated via Promptbook prompting/_
|
|
352
370
|
|
|
353
|
-
- [Instagram `@promptbook.city`](https://www.instagram.com/promptbook.city/)
|
|
354
|
-
- [Facebook `Promptbook City`](https://www.facebook.com/61565718625569)
|
|
355
371
|
|
|
356
372
|
|
|
357
373
|
|
|
358
374
|
|
|
375
|
+
## 📘 Book Language Blueprint
|
|
359
376
|
|
|
377
|
+
_A concise, Markdown-based DSL for crafting AI workflows and automations._
|
|
360
378
|
|
|
361
|
-
|
|
379
|
+
---
|
|
362
380
|
|
|
381
|
+
### 📑 Table of Contents
|
|
363
382
|
|
|
383
|
+
- [Introduction](#introduction)
|
|
384
|
+
- [Example](#example)
|
|
385
|
+
- [1. What: Workflows, Tasks & Parameters](#1-what-workflows-tasks--parameters)
|
|
386
|
+
- [2. Who: Personas](#2-who-personas)
|
|
387
|
+
- [3. How: Knowledge, Instruments & Actions](#3-how-knowledge-instruments-and-actions)
|
|
388
|
+
- [General Principles](#general-principles)
|
|
364
389
|
|
|
365
|
-
|
|
390
|
+
### Introduction
|
|
366
391
|
|
|
367
|
-
Book is a language that
|
|
392
|
+
Book is a Markdown-based language that simplifies the creation of AI applications, workflows, and automations. With human-readable commands, you can define inputs, outputs, personas, knowledge sources, and actions—without needing model-specific details.
|
|
368
393
|
|
|
369
394
|
### Example
|
|
370
395
|
|
|
371
|
-
```
|
|
372
|
-
# 🌟 My
|
|
396
|
+
```book
|
|
397
|
+
# 🌟 My First Book
|
|
373
398
|
|
|
374
399
|
- BOOK VERSION 1.0.0
|
|
375
400
|
- URL https://promptbook.studio/hello.book
|
|
376
401
|
- INPUT PARAMETER {topic}
|
|
377
402
|
- OUTPUT PARAMETER {article}
|
|
378
403
|
|
|
379
|
-
# Write an
|
|
404
|
+
# Write an Article
|
|
380
405
|
|
|
381
|
-
- PERSONA Jane, marketing specialist with prior experience in
|
|
406
|
+
- PERSONA Jane, marketing specialist with prior experience in tech and AI writing
|
|
382
407
|
- KNOWLEDGE https://wikipedia.org/
|
|
383
408
|
- KNOWLEDGE ./journalist-ethics.pdf
|
|
384
409
|
- EXPECT MIN 1 Sentence
|
|
@@ -386,20 +411,20 @@ Book is a language that can be used to write AI applications, agents, workflows,
|
|
|
386
411
|
|
|
387
412
|
> Write an article about {topic}
|
|
388
413
|
|
|
389
|
-
|
|
414
|
+
→ {article}
|
|
390
415
|
```
|
|
391
416
|
|
|
392
417
|
Each part of the book defines one of 3 circles:
|
|
393
418
|
|
|
394
|
-
### **What:** Workflows, Tasks and Parameters
|
|
419
|
+
### **1. What:** Workflows, Tasks and Parameters
|
|
395
420
|
|
|
396
|
-
What work needs to be done. Each book defines a [workflow
|
|
421
|
+
What work needs to be done. Each book defines a [workflow _(scenario or pipeline)_](https://github.com/webgptorg/promptbook/discussions/88), which is one or more tasks. Each workflow has a fixed input and output. For example, you have a book that generates an article from a topic. Once it generates an article about AI, once about marketing, once about cooking. The workflow (= your AI program) is the same, only the input and output change.
|
|
397
422
|
|
|
398
423
|
**Related commands:**
|
|
399
424
|
|
|
400
425
|
- [PARAMETER](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PARAMETER.md)
|
|
401
426
|
|
|
402
|
-
### **Who:** Personas
|
|
427
|
+
### **2. Who:** Personas
|
|
403
428
|
|
|
404
429
|
Who does the work. Each task is performed by a persona. A persona is a description of your virtual employee. It is a higher abstraction than the model, tokens, temperature, top-k, top-p and other model parameters.
|
|
405
430
|
|
|
@@ -413,7 +438,7 @@ Personas can have access to different knowledge, tools and actions. They can als
|
|
|
413
438
|
|
|
414
439
|
|
|
415
440
|
|
|
416
|
-
### **How:** Knowledge, Instruments and Actions
|
|
441
|
+
### **3. How:** Knowledge, Instruments and Actions
|
|
417
442
|
|
|
418
443
|
The resources used by the personas are used to do the work.
|
|
419
444
|
|
|
@@ -423,7 +448,7 @@ The resources used by the personas are used to do the work.
|
|
|
423
448
|
- [INSTRUMENT](https://github.com/webgptorg/promptbook/blob/main/documents/commands/INSTRUMENT.md) for real-time data like time, location, weather, stock prices, searching the internet, calculations, etc.
|
|
424
449
|
- [ACTION](https://github.com/webgptorg/promptbook/blob/main/documents/commands/ACTION.md) for actions like sending emails, creating files, ending a workflow, etc.
|
|
425
450
|
|
|
426
|
-
### General
|
|
451
|
+
### General Principles
|
|
427
452
|
|
|
428
453
|
Book language is based on markdown. It is subset of markdown. It is designed to be easy to read and write. It is designed to be understandable by both humans and machines and without specific knowledge of the language.
|
|
429
454
|
|
|
@@ -437,6 +462,10 @@ But unlike programming languages, it is designed to be understandable by non-pro
|
|
|
437
462
|
|
|
438
463
|
|
|
439
464
|
|
|
465
|
+
## 📚 Documentation
|
|
466
|
+
|
|
467
|
+
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
468
|
+
|
|
440
469
|
## 🔒 Security
|
|
441
470
|
|
|
442
471
|
For information on reporting security vulnerabilities, see our [Security Policy](./SECURITY.md).
|
|
@@ -480,7 +509,7 @@ Or you can install them separately:
|
|
|
480
509
|
- **[@promptbook/legacy-documents](https://www.npmjs.com/package/@promptbook/legacy-documents)** - Read knowledge from legacy documents like `.doc`, `.rtf`,…
|
|
481
510
|
- **[@promptbook/website-crawler](https://www.npmjs.com/package/@promptbook/website-crawler)** - Crawl knowledge from the web
|
|
482
511
|
- **[@promptbook/editable](https://www.npmjs.com/package/@promptbook/editable)** - Editable book as native javascript object with imperative object API
|
|
483
|
-
- **[@promptbook/templates](https://www.npmjs.com/package/@promptbook/templates)** -
|
|
512
|
+
- **[@promptbook/templates](https://www.npmjs.com/package/@promptbook/templates)** - Useful templates and examples of books which can be used as a starting point
|
|
484
513
|
- **[@promptbook/types](https://www.npmjs.com/package/@promptbook/types)** - Just typescript types used in the library
|
|
485
514
|
- ⭐ **[@promptbook/cli](https://www.npmjs.com/package/@promptbook/cli)** - Command line interface utilities for promptbooks
|
|
486
515
|
- 🐋 **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** - Promptbook server
|
|
@@ -517,25 +546,56 @@ _Note: This section is not complete dictionary, more list of general AI / LLM te
|
|
|
517
546
|
- [🤼 Personas](https://github.com/webgptorg/promptbook/discussions/22)
|
|
518
547
|
- [⭕ Parameters](https://github.com/webgptorg/promptbook/discussions/83)
|
|
519
548
|
- [🚀 Pipeline execution](https://github.com/webgptorg/promptbook/discussions/84)
|
|
520
|
-
- [🧪 Expectations](https://github.com/webgptorg/promptbook/discussions/30)
|
|
521
|
-
- [✂️ Postprocessing](https://github.com/webgptorg/promptbook/discussions/31)
|
|
522
|
-
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29)
|
|
523
|
-
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32)
|
|
549
|
+
- [🧪 Expectations](https://github.com/webgptorg/promptbook/discussions/30) - Define what outputs should look like and how they're validated
|
|
550
|
+
- [✂️ Postprocessing](https://github.com/webgptorg/promptbook/discussions/31) - How outputs are refined after generation
|
|
551
|
+
- [🔣 Words not tokens](https://github.com/webgptorg/promptbook/discussions/29) - The human-friendly way to think about text generation
|
|
552
|
+
- [☯ Separation of concerns](https://github.com/webgptorg/promptbook/discussions/32) - How Book language organizes different aspects of AI workflows
|
|
524
553
|
|
|
525
|
-
|
|
554
|
+
### Advanced concepts
|
|
555
|
+
|
|
556
|
+
<table>
|
|
557
|
+
<tr>
|
|
558
|
+
<th>Data & Knowledge Management</th>
|
|
559
|
+
<th>Pipeline Control</th>
|
|
560
|
+
</tr>
|
|
561
|
+
<tr>
|
|
562
|
+
<td>
|
|
563
|
+
<ul>
|
|
564
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/41">📚 Knowledge (RAG)</a> - Retrieve and use external information</li>
|
|
565
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/54">📽 Media handling</a> - Working with images, audio, video, spreadsheets</li>
|
|
566
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/40">🔴 Anomaly detection</a> - Identifying unusual patterns or outputs</li>
|
|
567
|
+
</ul>
|
|
568
|
+
</td>
|
|
569
|
+
<td>
|
|
570
|
+
<ul>
|
|
571
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/89">🌏 Remote server</a> - Executing workflows on remote infrastructure</li>
|
|
572
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/66">🃏 Jokers (conditions)</a> - Adding conditional logic to workflows</li>
|
|
573
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/35">🔳 Metaprompting</a> - Creating prompts that generate other prompts</li>
|
|
574
|
+
</ul>
|
|
575
|
+
</td>
|
|
576
|
+
</tr>
|
|
577
|
+
<tr>
|
|
578
|
+
<th>Language & Output Control</th>
|
|
579
|
+
<th>Advanced Generation</th>
|
|
580
|
+
</tr>
|
|
581
|
+
<tr>
|
|
582
|
+
<td>
|
|
583
|
+
<ul>
|
|
584
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/53">🌏 Linguistically typed languages</a> - Type systems for natural language</li>
|
|
585
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/42">🌍 Auto-Translations</a> - Automatic multilingual support</li>
|
|
586
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/39">👮 Agent adversary expectations</a> - Safety and control mechanisms</li>
|
|
587
|
+
</ul>
|
|
588
|
+
</td>
|
|
589
|
+
<td>
|
|
590
|
+
<ul>
|
|
591
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/37">🔙 Expectation-aware generation</a> - Outputs that meet defined criteria</li>
|
|
592
|
+
<li><a href="https://github.com/webgptorg/promptbook/discussions/33">⏳ Just-in-time fine-tuning</a> - Dynamic model adaptation</li>
|
|
593
|
+
</ul>
|
|
594
|
+
</td>
|
|
595
|
+
</tr>
|
|
596
|
+
</table>
|
|
526
597
|
|
|
527
|
-
|
|
528
|
-
- [🌏 Remote server](https://github.com/webgptorg/promptbook/discussions/89)
|
|
529
|
-
- [🃏 Jokers (conditions)](https://github.com/webgptorg/promptbook/discussions/66)
|
|
530
|
-
- [🔳 Metaprompting](https://github.com/webgptorg/promptbook/discussions/35)
|
|
531
|
-
- [🌏 Linguistically typed languages](https://github.com/webgptorg/promptbook/discussions/53)
|
|
532
|
-
- [🌍 Auto-Translations](https://github.com/webgptorg/promptbook/discussions/42)
|
|
533
|
-
- [📽 Images, audio, video, spreadsheets](https://github.com/webgptorg/promptbook/discussions/54)
|
|
534
|
-
- [🔙 Expectation-aware generation](https://github.com/webgptorg/promptbook/discussions/37)
|
|
535
|
-
- [⏳ Just-in-time fine-tuning](https://github.com/webgptorg/promptbook/discussions/33)
|
|
536
|
-
- [🔴 Anomaly detection](https://github.com/webgptorg/promptbook/discussions/40)
|
|
537
|
-
- [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
|
|
538
|
-
- [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
|
|
598
|
+
<p align="center"><a href="https://github.com/webgptorg/promptbook/discussions/categories/concepts">🔍 View more concepts</a></p>
|
|
539
599
|
|
|
540
600
|
|
|
541
601
|
|
|
@@ -590,36 +650,28 @@ If you have a question [start a discussion](https://github.com/webgptorg/promptb
|
|
|
590
650
|
- [❔ Is Promptbook using RAG _(Retrieval-Augmented Generation)_?](https://github.com/webgptorg/promptbook/discussions/123)
|
|
591
651
|
- [❔ Is Promptbook using function calling?](https://github.com/webgptorg/promptbook/discussions/124)
|
|
592
652
|
|
|
593
|
-
##
|
|
653
|
+
## 📅 Changelog
|
|
594
654
|
|
|
595
655
|
See [CHANGELOG.md](./CHANGELOG.md)
|
|
596
656
|
|
|
597
657
|
## 📜 License
|
|
598
658
|
|
|
599
|
-
|
|
659
|
+
This project is licensed under [BUSL 1.1](./LICENSE.md).
|
|
600
660
|
|
|
601
|
-
##
|
|
661
|
+
## 🤝 Contributing
|
|
602
662
|
|
|
603
|
-
See [
|
|
663
|
+
We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
604
664
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
<div style="display: flex; align-items: center; gap: 20px;">
|
|
608
|
-
|
|
609
|
-
<a href="https://promptbook.studio/">
|
|
610
|
-
<img src="./design/promptbook-studio-logo.png" alt="Partner 3" height="70">
|
|
611
|
-
</a>
|
|
612
|
-
|
|
613
|
-
<a href="https://technologickainkubace.org/en/about-technology-incubation/about-the-project/">
|
|
614
|
-
<img src="./other/partners/CI-Technology-Incubation.png" alt="Technology Incubation" height="70">
|
|
615
|
-
</a>
|
|
616
|
-
|
|
617
|
-
</div>
|
|
665
|
+
You can also ⭐ star the project, [follow us on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).We are open to [pull requests, feedback, and suggestions](./CONTRIBUTING.md).
|
|
618
666
|
|
|
619
|
-
##
|
|
667
|
+
## 🆘 Support & Community
|
|
620
668
|
|
|
621
|
-
|
|
669
|
+
Need help with Book language? We're here for you!
|
|
622
670
|
|
|
623
|
-
|
|
671
|
+
- 💬 [Join our Discord community](https://discord.gg/x3QWNaa89N) for real-time support
|
|
672
|
+
- 📝 [Browse our GitHub discussions](https://github.com/webgptorg/promptbook/discussions) for FAQs and community knowledge
|
|
673
|
+
- 🐛 [Report issues](https://github.com/webgptorg/book/issues) for bugs or feature requests
|
|
674
|
+
- 📚 Visit [ptbk.io](https://ptbk.io) for more resources and documentation
|
|
675
|
+
- 📧 Contact us directly through the channels listed in our [signpost](./SIGNPOST.md)
|
|
624
676
|
|
|
625
|
-
|
|
677
|
+
We welcome contributions and feedback to make Book language better for everyone!
|
package/esm/index.es.js
CHANGED
|
@@ -16,7 +16,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
16
16
|
* @generated
|
|
17
17
|
* @see https://github.com/webgptorg/promptbook
|
|
18
18
|
*/
|
|
19
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
19
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.93.0';
|
|
20
20
|
/**
|
|
21
21
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
22
22
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -66,7 +66,7 @@ class PipelineExecutionError extends Error {
|
|
|
66
66
|
super(message);
|
|
67
67
|
this.name = 'PipelineExecutionError';
|
|
68
68
|
// TODO: [🐙] DRY - Maybe $randomId
|
|
69
|
-
this.id = `error-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid
|
|
69
|
+
this.id = `error-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid similar char conflicts */)}`;
|
|
70
70
|
Object.setPrototypeOf(this, PipelineExecutionError.prototype);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -417,10 +417,10 @@ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
|
|
|
417
417
|
*/
|
|
418
418
|
|
|
419
419
|
/**
|
|
420
|
-
*
|
|
420
|
+
* Removes diacritic marks (accents) from characters in a string.
|
|
421
421
|
*
|
|
422
|
-
* @param input
|
|
423
|
-
* @returns
|
|
422
|
+
* @param input The string containing diacritics to be normalized.
|
|
423
|
+
* @returns The string with diacritics removed or normalized.
|
|
424
424
|
* @public exported from `@promptbook/utils`
|
|
425
425
|
*/
|
|
426
426
|
function removeDiacritics(input) {
|
|
@@ -566,14 +566,18 @@ $deepFreeze({
|
|
|
566
566
|
/**
|
|
567
567
|
* Make UncertainNumber
|
|
568
568
|
*
|
|
569
|
-
* @param value
|
|
569
|
+
* @param value value of the uncertain number, if `NaN` or `undefined`, it will be set to 0 and `isUncertain=true`
|
|
570
|
+
* @param isUncertain if `true`, the value is uncertain, otherwise depends on the value
|
|
570
571
|
*
|
|
571
572
|
* @private utility for initializating UncertainNumber
|
|
572
573
|
*/
|
|
573
|
-
function uncertainNumber(value) {
|
|
574
|
+
function uncertainNumber(value, isUncertain) {
|
|
574
575
|
if (value === null || value === undefined || Number.isNaN(value)) {
|
|
575
576
|
return UNCERTAIN_ZERO_VALUE;
|
|
576
577
|
}
|
|
578
|
+
if (isUncertain === true) {
|
|
579
|
+
return { value, isUncertain };
|
|
580
|
+
}
|
|
577
581
|
return { value };
|
|
578
582
|
}
|
|
579
583
|
|
|
@@ -639,7 +643,7 @@ const VALUE_STRINGS = {
|
|
|
639
643
|
const SMALL_NUMBER = 0.001;
|
|
640
644
|
// <- TODO: [🧜♂️]
|
|
641
645
|
/**
|
|
642
|
-
*
|
|
646
|
+
* Default settings for parsing and generating CSV files in Promptbook.
|
|
643
647
|
*
|
|
644
648
|
* @public exported from `@promptbook/core`
|
|
645
649
|
*/
|
|
@@ -724,7 +728,7 @@ class UnexpectedError extends Error {
|
|
|
724
728
|
${block(message)}
|
|
725
729
|
|
|
726
730
|
Note: This error should not happen.
|
|
727
|
-
It's
|
|
731
|
+
It's probably a bug in the pipeline collection
|
|
728
732
|
|
|
729
733
|
Please report issue:
|
|
730
734
|
${block(getErrorReportUrl(new Error(message)).href)}
|
|
@@ -924,8 +928,12 @@ function checkSerializableAsJson(options) {
|
|
|
924
928
|
*/
|
|
925
929
|
|
|
926
930
|
/**
|
|
927
|
-
*
|
|
931
|
+
* Creates a deep clone of the given object
|
|
932
|
+
*
|
|
933
|
+
* Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
|
|
928
934
|
*
|
|
935
|
+
* @param objectValue The object to clone.
|
|
936
|
+
* @returns A deep, writable clone of the input object.
|
|
929
937
|
* @public exported from `@promptbook/utils`
|
|
930
938
|
*/
|
|
931
939
|
function deepClone(objectValue) {
|
|
@@ -987,13 +995,13 @@ function exportJson(options) {
|
|
|
987
995
|
*/
|
|
988
996
|
const REPLACING_NONCE = 'ptbkauk42kV2dzao34faw7FudQUHYPtW';
|
|
989
997
|
/**
|
|
990
|
-
*
|
|
998
|
+
* Placeholder value indicating a parameter is missing its value.
|
|
991
999
|
*
|
|
992
1000
|
* @private within the repository
|
|
993
1001
|
*/
|
|
994
1002
|
const RESERVED_PARAMETER_MISSING_VALUE = 'MISSING-' + REPLACING_NONCE;
|
|
995
1003
|
/**
|
|
996
|
-
*
|
|
1004
|
+
* Placeholder value indicating a parameter is restricted and cannot be used directly.
|
|
997
1005
|
*
|
|
998
1006
|
* @private within the repository
|
|
999
1007
|
*/
|
|
@@ -1231,12 +1239,14 @@ function createExecutionToolsFromVercelProvider(options) {
|
|
|
1231
1239
|
const { vercelProvider, availableModels, userId, additionalChatSettings = {} } = options;
|
|
1232
1240
|
if (!/Vercel/i.test(title)) {
|
|
1233
1241
|
title = `${title} (through Vercel)`;
|
|
1242
|
+
// <- TODO: [🧈] Maybe standartize the suffix
|
|
1234
1243
|
} /* not else */
|
|
1235
1244
|
if (description === undefined) {
|
|
1236
1245
|
description = `Implementation of ${title} through Vercel`;
|
|
1237
1246
|
} /* not else */
|
|
1238
1247
|
if (!/Vercel/i.test(description)) {
|
|
1239
1248
|
description = `${description} (through Vercel)`;
|
|
1249
|
+
// <- TODO: [🧈] Maybe standartize the suffix
|
|
1240
1250
|
} /* not else */
|
|
1241
1251
|
return {
|
|
1242
1252
|
title,
|
|
@@ -1364,7 +1374,7 @@ function computeUsage(value) {
|
|
|
1364
1374
|
/**
|
|
1365
1375
|
* List of available Google models with descriptions
|
|
1366
1376
|
*
|
|
1367
|
-
* Note: Done at 2025-
|
|
1377
|
+
* Note: Done at 2025-05-06
|
|
1368
1378
|
*
|
|
1369
1379
|
* @see https://ai.google.dev/models/gemini
|
|
1370
1380
|
* @public exported from `@promptbook/google`
|
|
@@ -1378,8 +1388,8 @@ const GOOGLE_MODELS = exportJson({
|
|
|
1378
1388
|
modelName: 'gemini-2.5-pro-preview-03-25',
|
|
1379
1389
|
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.',
|
|
1380
1390
|
pricing: {
|
|
1381
|
-
prompt: computeUsage(`$
|
|
1382
|
-
output: computeUsage(`$
|
|
1391
|
+
prompt: computeUsage(`$8.00 / 1M tokens`),
|
|
1392
|
+
output: computeUsage(`$24.00 / 1M tokens`),
|
|
1383
1393
|
},
|
|
1384
1394
|
},
|
|
1385
1395
|
{
|
|
@@ -1418,8 +1428,8 @@ const GOOGLE_MODELS = exportJson({
|
|
|
1418
1428
|
modelName: 'gemini-1.5-flash',
|
|
1419
1429
|
modelDescription: 'Efficient model balancing speed and quality for general-purpose applications. 1M token context window with good multimodal capabilities and quick response times.',
|
|
1420
1430
|
pricing: {
|
|
1421
|
-
prompt: computeUsage(`$0.
|
|
1422
|
-
output: computeUsage(`$
|
|
1431
|
+
prompt: computeUsage(`$0.25 / 1M tokens`),
|
|
1432
|
+
output: computeUsage(`$0.75 / 1M tokens`),
|
|
1423
1433
|
},
|
|
1424
1434
|
},
|
|
1425
1435
|
{
|
|
@@ -1486,8 +1496,8 @@ const GOOGLE_MODELS = exportJson({
|
|
|
1486
1496
|
modelName: 'gemini-1.5-pro',
|
|
1487
1497
|
modelDescription: 'Flagship multimodal model with strong performance across text, code, vision, and audio tasks. 1M token context window with excellent reasoning capabilities.',
|
|
1488
1498
|
pricing: {
|
|
1489
|
-
prompt: computeUsage(`$
|
|
1490
|
-
output: computeUsage(`$
|
|
1499
|
+
prompt: computeUsage(`$6.00 / 1M tokens`),
|
|
1500
|
+
output: computeUsage(`$18.00 / 1M tokens`),
|
|
1491
1501
|
},
|
|
1492
1502
|
},
|
|
1493
1503
|
{
|
|
@@ -1584,7 +1594,8 @@ class NotYetImplementedError extends Error {
|
|
|
1584
1594
|
}
|
|
1585
1595
|
|
|
1586
1596
|
/**
|
|
1587
|
-
*
|
|
1597
|
+
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
1598
|
+
* regardless of the JavaScript environment in which the code is running
|
|
1588
1599
|
*
|
|
1589
1600
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
1590
1601
|
*
|
|
@@ -1595,10 +1606,10 @@ function $getGlobalScope() {
|
|
|
1595
1606
|
}
|
|
1596
1607
|
|
|
1597
1608
|
/**
|
|
1598
|
-
*
|
|
1609
|
+
* Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
|
|
1599
1610
|
*
|
|
1600
|
-
* @param text
|
|
1601
|
-
* @returns
|
|
1611
|
+
* @param text The text string to be converted to SCREAMING_CASE format.
|
|
1612
|
+
* @returns The normalized text in SCREAMING_CASE format.
|
|
1602
1613
|
* @example 'HELLO_WORLD'
|
|
1603
1614
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
1604
1615
|
* @public exported from `@promptbook/utils`
|
|
@@ -1650,10 +1661,10 @@ function normalizeTo_SCREAMING_CASE(text) {
|
|
|
1650
1661
|
*/
|
|
1651
1662
|
|
|
1652
1663
|
/**
|
|
1653
|
-
*
|
|
1664
|
+
* Normalizes a text string to snake_case format.
|
|
1654
1665
|
*
|
|
1655
|
-
* @param text
|
|
1656
|
-
* @returns
|
|
1666
|
+
* @param text The text string to be converted to snake_case format.
|
|
1667
|
+
* @returns The normalized text in snake_case format.
|
|
1657
1668
|
* @example 'hello_world'
|
|
1658
1669
|
* @example 'i_love_promptbook'
|
|
1659
1670
|
* @public exported from `@promptbook/utils`
|
|
@@ -1663,11 +1674,11 @@ function normalizeTo_snake_case(text) {
|
|
|
1663
1674
|
}
|
|
1664
1675
|
|
|
1665
1676
|
/**
|
|
1666
|
-
*
|
|
1677
|
+
* Global registry for storing and managing registered entities of a given type.
|
|
1667
1678
|
*
|
|
1668
1679
|
* Note: `$` is used to indicate that this function is not a pure function - it accesses and adds variables in global scope.
|
|
1669
1680
|
*
|
|
1670
|
-
* @private internal utility, exported are only
|
|
1681
|
+
* @private internal utility, exported are only singleton instances of this class
|
|
1671
1682
|
*/
|
|
1672
1683
|
class $Register {
|
|
1673
1684
|
constructor(registerName) {
|
|
@@ -1711,10 +1722,10 @@ class $Register {
|
|
|
1711
1722
|
}
|
|
1712
1723
|
|
|
1713
1724
|
/**
|
|
1714
|
-
*
|
|
1725
|
+
* Register for LLM tools.
|
|
1715
1726
|
*
|
|
1716
1727
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
1717
|
-
* @singleton Only one instance of each register is created per build, but
|
|
1728
|
+
* @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
|
|
1718
1729
|
* @public exported from `@promptbook/core`
|
|
1719
1730
|
*/
|
|
1720
1731
|
const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
|