@promptbook/node 0.92.0-27 → 0.92.0-28
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/esm/index.es.js +35 -23
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +4 -4
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
- package/esm/typings/src/constants.d.ts +35 -0
- 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/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/LlmExecutionToolsConstructor.d.ts +2 -1
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +20 -14
- 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 +8 -11
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +1 -1
- 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 +3 -3
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +4 -37
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- 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/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/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +35 -23
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -30,7 +30,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
30
30
|
* @generated
|
|
31
31
|
* @see https://github.com/webgptorg/promptbook
|
|
32
32
|
*/
|
|
33
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
33
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-28';
|
|
34
34
|
/**
|
|
35
35
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
36
36
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2534,7 +2534,7 @@ function union(...sets) {
|
|
|
2534
2534
|
}
|
|
2535
2535
|
|
|
2536
2536
|
/**
|
|
2537
|
-
*
|
|
2537
|
+
* Contains configuration options for parsing and generating CSV files, such as delimiters and quoting rules.
|
|
2538
2538
|
*
|
|
2539
2539
|
* @public exported from `@promptbook/core`
|
|
2540
2540
|
*/
|
|
@@ -3721,8 +3721,12 @@ function checkExpectations(expectations, value) {
|
|
|
3721
3721
|
*/
|
|
3722
3722
|
|
|
3723
3723
|
/**
|
|
3724
|
-
*
|
|
3724
|
+
* Executes a pipeline task with multiple attempts, including joker and retry logic. Handles different task types
|
|
3725
|
+
* (prompt, script, dialog, etc.), applies postprocessing, checks expectations, and updates the execution report.
|
|
3726
|
+
* Throws errors if execution fails after all attempts.
|
|
3725
3727
|
*
|
|
3728
|
+
* @param options - The options for execution, including task, parameters, pipeline, and configuration.
|
|
3729
|
+
* @returns The result string of the executed task.
|
|
3726
3730
|
* @private internal utility of `createPipelineExecutor`
|
|
3727
3731
|
*/
|
|
3728
3732
|
async function executeAttempts(options) {
|
|
@@ -4180,8 +4184,12 @@ async function executeFormatSubvalues(options) {
|
|
|
4180
4184
|
}
|
|
4181
4185
|
|
|
4182
4186
|
/**
|
|
4183
|
-
*
|
|
4187
|
+
* Returns the context for a given task, typically used to provide additional information or variables
|
|
4188
|
+
* required for the execution of the task within a pipeline. The context is returned as a string value
|
|
4189
|
+
* that may include markdown formatting.
|
|
4184
4190
|
*
|
|
4191
|
+
* @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
|
|
4192
|
+
* @returns The context as a string, formatted as markdown and parameter value.
|
|
4185
4193
|
* @private internal utility of `createPipelineExecutor`
|
|
4186
4194
|
*/
|
|
4187
4195
|
async function getContextForTask(task) {
|
|
@@ -4189,7 +4197,7 @@ async function getContextForTask(task) {
|
|
|
4189
4197
|
}
|
|
4190
4198
|
|
|
4191
4199
|
/**
|
|
4192
|
-
*
|
|
4200
|
+
* Retrieves example values or templates for a given task, used to guide or validate pipeline execution.
|
|
4193
4201
|
*
|
|
4194
4202
|
* @private internal utility of `createPipelineExecutor`
|
|
4195
4203
|
*/
|
|
@@ -4236,9 +4244,8 @@ function knowledgePiecesToString(knowledgePieces) {
|
|
|
4236
4244
|
}
|
|
4237
4245
|
|
|
4238
4246
|
/**
|
|
4239
|
-
*
|
|
4240
|
-
*
|
|
4241
|
-
* Here is the place where RAG (retrieval-augmented generation) happens
|
|
4247
|
+
* Retrieves the most relevant knowledge pieces for a given task using embedding-based similarity search.
|
|
4248
|
+
* This is where retrieval-augmented generation (RAG) is performed to enhance the task with external knowledge.
|
|
4242
4249
|
*
|
|
4243
4250
|
* @private internal utility of `createPipelineExecutor`
|
|
4244
4251
|
*/
|
|
@@ -4457,7 +4464,8 @@ async function executeTask(options) {
|
|
|
4457
4464
|
*/
|
|
4458
4465
|
|
|
4459
4466
|
/**
|
|
4460
|
-
*
|
|
4467
|
+
* Filters and returns only the output parameters from the provided pipeline execution options.
|
|
4468
|
+
* Adds warnings for any expected output parameters that are missing.
|
|
4461
4469
|
*
|
|
4462
4470
|
* @private internal utility of `createPipelineExecutor`
|
|
4463
4471
|
*/
|
|
@@ -6761,8 +6769,6 @@ function validateParameterName(parameterName) {
|
|
|
6761
6769
|
/**
|
|
6762
6770
|
* Parses the foreach command
|
|
6763
6771
|
*
|
|
6764
|
-
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book` file
|
|
6765
|
-
*
|
|
6766
6772
|
* @see `documentationUrl` for more details
|
|
6767
6773
|
* @public exported from `@promptbook/editable`
|
|
6768
6774
|
*/
|
|
@@ -7003,14 +7009,14 @@ const formatCommandParser = {
|
|
|
7003
7009
|
};
|
|
7004
7010
|
|
|
7005
7011
|
/**
|
|
7006
|
-
*
|
|
7012
|
+
* Chatbot form factor definition for conversational interfaces that interact with users in a chat-like manner.
|
|
7007
7013
|
*
|
|
7008
7014
|
* @public exported from `@promptbook/core`
|
|
7009
7015
|
*/
|
|
7010
7016
|
const ChatbotFormfactorDefinition = {
|
|
7011
7017
|
name: 'CHATBOT',
|
|
7012
7018
|
aliasNames: ['CHAT'],
|
|
7013
|
-
description:
|
|
7019
|
+
description: `A chatbot form factor for conversational user interfaces.`,
|
|
7014
7020
|
documentationUrl: `https://github.com/webgptorg/promptbook/discussions/174`,
|
|
7015
7021
|
pipelineInterface: {
|
|
7016
7022
|
inputParameters: [
|
|
@@ -7043,7 +7049,7 @@ const ChatbotFormfactorDefinition = {
|
|
|
7043
7049
|
*/
|
|
7044
7050
|
const CompletionFormfactorDefinition = {
|
|
7045
7051
|
name: 'COMPLETION',
|
|
7046
|
-
description:
|
|
7052
|
+
description: `Completion is formfactor that emulates completion models`,
|
|
7047
7053
|
documentationUrl: `https://github.com/webgptorg/promptbook/discussions/@@`,
|
|
7048
7054
|
// <- TODO: https://github.com/webgptorg/promptbook/discussions/new?category=concepts
|
|
7049
7055
|
// "🔠 Completion Formfactor"
|
|
@@ -7074,7 +7080,8 @@ const CompletionFormfactorDefinition = {
|
|
|
7074
7080
|
};
|
|
7075
7081
|
|
|
7076
7082
|
/**
|
|
7077
|
-
* Generator
|
|
7083
|
+
* Generator form factor represents an application that generates content or data based on user input or predefined rules.
|
|
7084
|
+
* This form factor is used for apps that produce outputs, such as text, images, or other media, based on provided input.
|
|
7078
7085
|
*
|
|
7079
7086
|
* @public exported from `@promptbook/core`
|
|
7080
7087
|
*/
|
|
@@ -7118,13 +7125,13 @@ const GENERIC_PIPELINE_INTERFACE = {
|
|
|
7118
7125
|
*/
|
|
7119
7126
|
|
|
7120
7127
|
/**
|
|
7121
|
-
*
|
|
7128
|
+
* A generic pipeline
|
|
7122
7129
|
*
|
|
7123
7130
|
* @public exported from `@promptbook/core`
|
|
7124
7131
|
*/
|
|
7125
7132
|
const GenericFormfactorDefinition = {
|
|
7126
7133
|
name: 'GENERIC',
|
|
7127
|
-
description:
|
|
7134
|
+
description: `A generic pipeline`,
|
|
7128
7135
|
documentationUrl: `https://github.com/webgptorg/promptbook/discussions/173`,
|
|
7129
7136
|
pipelineInterface: GENERIC_PIPELINE_INTERFACE,
|
|
7130
7137
|
};
|
|
@@ -9590,7 +9597,8 @@ function $execCommand(options) {
|
|
|
9590
9597
|
*/
|
|
9591
9598
|
|
|
9592
9599
|
/**
|
|
9593
|
-
*
|
|
9600
|
+
* Attempts to locate the specified application on a Linux system using the 'which' command.
|
|
9601
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
9594
9602
|
*
|
|
9595
9603
|
* @private within the repository
|
|
9596
9604
|
*/
|
|
@@ -9657,7 +9665,8 @@ async function isExecutable(path, fs) {
|
|
|
9657
9665
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
9658
9666
|
const userhome = require('userhome');
|
|
9659
9667
|
/**
|
|
9660
|
-
*
|
|
9668
|
+
* Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
|
|
9669
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
9661
9670
|
*
|
|
9662
9671
|
* @private within the repository
|
|
9663
9672
|
*/
|
|
@@ -9689,7 +9698,8 @@ async function locateAppOnMacOs({ macOsName, }) {
|
|
|
9689
9698
|
*/
|
|
9690
9699
|
|
|
9691
9700
|
/**
|
|
9692
|
-
*
|
|
9701
|
+
* Attempts to locate the specified application on a Windows system by searching common installation directories.
|
|
9702
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
9693
9703
|
*
|
|
9694
9704
|
* @private within the repository
|
|
9695
9705
|
*/
|
|
@@ -9760,7 +9770,8 @@ function locateApp(options) {
|
|
|
9760
9770
|
*/
|
|
9761
9771
|
|
|
9762
9772
|
/**
|
|
9763
|
-
*
|
|
9773
|
+
* Locates the LibreOffice executable on the current system by searching platform-specific paths.
|
|
9774
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
9764
9775
|
*
|
|
9765
9776
|
* @private within the repository
|
|
9766
9777
|
*/
|
|
@@ -9778,7 +9789,8 @@ function locateLibreoffice() {
|
|
|
9778
9789
|
*/
|
|
9779
9790
|
|
|
9780
9791
|
/**
|
|
9781
|
-
*
|
|
9792
|
+
* Locates the Pandoc executable on the current system by searching platform-specific paths.
|
|
9793
|
+
* Returns the path to the executable if found, or null otherwise.
|
|
9782
9794
|
*
|
|
9783
9795
|
* @private within the repository
|
|
9784
9796
|
*/
|
|
@@ -9796,7 +9808,7 @@ function locatePandoc() {
|
|
|
9796
9808
|
*/
|
|
9797
9809
|
|
|
9798
9810
|
/**
|
|
9799
|
-
*
|
|
9811
|
+
* Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
|
|
9800
9812
|
*
|
|
9801
9813
|
* @public exported from `@promptbook/node`
|
|
9802
9814
|
*/
|