@promptbook/core 0.69.0-10 → 0.69.0-12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/esm/index.es.js +77 -65
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/config.d.ts +9 -2
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +7 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +9 -6
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +4 -3
- package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +3 -1
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +5 -0
- package/esm/typings/src/formats/index.d.ts +1 -1
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +3 -2
- package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +3 -1
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +3 -2
- package/esm/typings/src/utils/organization/{f.d.ts → empty_object.d.ts} +5 -1
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +12 -0
- package/package.json +1 -1
- package/umd/index.umd.js +77 -64
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts +0 -1
package/README.md
CHANGED
|
@@ -88,7 +88,6 @@ File `write-website-content.ptbk.md`:
|
|
|
88
88
|
> Instructions for creating web page content.
|
|
89
89
|
>
|
|
90
90
|
> - PIPELINE URL https://promptbook.studio/webgpt/write-website-content.ptbk.md
|
|
91
|
-
> - PROMPTBOOK VERSION 0.0.1
|
|
92
91
|
> - INPUT PARAM `{rawTitle}` Automatically suggested a site name or empty text
|
|
93
92
|
> - INPUT PARAM `{rawAssigment}` Automatically generated site entry from image recognition
|
|
94
93
|
> - OUTPUT PARAM `{websiteContent}` Web content
|
package/esm/index.es.js
CHANGED
|
@@ -11,7 +11,7 @@ import moment from 'moment';
|
|
|
11
11
|
/**
|
|
12
12
|
* The version of the Promptbook library
|
|
13
13
|
*/
|
|
14
|
-
var PROMPTBOOK_VERSION = '0.69.0-
|
|
14
|
+
var PROMPTBOOK_VERSION = '0.69.0-11';
|
|
15
15
|
// TODO: !!!! List here all the versions and annotate + put into script
|
|
16
16
|
|
|
17
17
|
/*! *****************************************************************************
|
|
@@ -748,6 +748,19 @@ var DEFAULT_REMOTE_URL = 'https://api.pavolhejny.com/';
|
|
|
748
748
|
*/
|
|
749
749
|
var DEFAULT_REMOTE_URL_PATH = '/promptbook/socket.io';
|
|
750
750
|
// <- TODO: [🧜♂️]
|
|
751
|
+
/**
|
|
752
|
+
* @@@
|
|
753
|
+
*
|
|
754
|
+
* @public exported from `@promptbook/core`
|
|
755
|
+
*/
|
|
756
|
+
var DEFAULT_CSV_SETTINGS = {
|
|
757
|
+
header: true,
|
|
758
|
+
delimiter: ',',
|
|
759
|
+
quoteChar: '"',
|
|
760
|
+
newline: '\n',
|
|
761
|
+
skipEmptyLines: true,
|
|
762
|
+
// encoding: 'utf8'
|
|
763
|
+
};
|
|
751
764
|
/**
|
|
752
765
|
* @@@
|
|
753
766
|
*
|
|
@@ -1819,7 +1832,7 @@ function forEachAsync(array, options, callbackfunction) {
|
|
|
1819
1832
|
});
|
|
1820
1833
|
}
|
|
1821
1834
|
|
|
1822
|
-
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.69.0-
|
|
1835
|
+
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.69.0-11",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelRequirements",format:"JSON",dependentParameterNames:["availableModelNames","personaDescription"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
|
|
1823
1836
|
|
|
1824
1837
|
var defaultDiacriticsRemovalMap = [
|
|
1825
1838
|
{
|
|
@@ -2939,57 +2952,61 @@ function TODO_USE() {
|
|
|
2939
2952
|
var CsvFormatDefinition = {
|
|
2940
2953
|
formatName: 'CSV',
|
|
2941
2954
|
aliases: ['SPREADSHEET', 'TABLE'],
|
|
2942
|
-
isValid: function (value, schema) {
|
|
2955
|
+
isValid: function (value, settings, schema) {
|
|
2956
|
+
// TODO: !!!!!! Implement CSV validation
|
|
2943
2957
|
TODO_USE(value /* <- TODO: Use value here */);
|
|
2958
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2944
2959
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2945
2960
|
return true;
|
|
2946
2961
|
},
|
|
2947
|
-
canBeValid: function (partialValue, schema) {
|
|
2962
|
+
canBeValid: function (partialValue, settings, schema) {
|
|
2948
2963
|
TODO_USE(partialValue /* <- TODO: Use partialValue here */);
|
|
2964
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2949
2965
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2950
2966
|
return true;
|
|
2951
2967
|
},
|
|
2952
|
-
heal: function (value, schema) {
|
|
2968
|
+
heal: function (value, settings, schema) {
|
|
2953
2969
|
TODO_USE(value /* <- TODO: Use partialValue here */);
|
|
2970
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
2954
2971
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
2955
2972
|
throw new Error('Not implemented');
|
|
2956
2973
|
},
|
|
2957
2974
|
subvalueDefinitions: [
|
|
2958
2975
|
{
|
|
2959
2976
|
subvalueName: 'ROW',
|
|
2960
|
-
mapValues: function (value, mapCallback) {
|
|
2977
|
+
mapValues: function (value, settings, mapCallback) {
|
|
2961
2978
|
return __awaiter(this, void 0, void 0, function () {
|
|
2962
2979
|
var csv, mappedData;
|
|
2980
|
+
var _this = this;
|
|
2963
2981
|
return __generator(this, function (_a) {
|
|
2964
2982
|
switch (_a.label) {
|
|
2965
2983
|
case 0:
|
|
2966
|
-
csv = parse(value,
|
|
2967
|
-
header: true,
|
|
2968
|
-
delimiter: ',',
|
|
2969
|
-
quoteChar: '"',
|
|
2970
|
-
newline: '\r\n',
|
|
2971
|
-
skipEmptyLines: true,
|
|
2972
|
-
// encoding: 'utf8',
|
|
2973
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
2974
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
2975
|
-
});
|
|
2984
|
+
csv = parse(value, settings);
|
|
2976
2985
|
if (csv.errors.length !== 0) {
|
|
2977
2986
|
throw new ParseError(// <- TODO: !!!!!! Split PipelineParseError and FormatParseError -> CsvParseError
|
|
2978
2987
|
spaceTrim(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
|
|
2979
2988
|
}
|
|
2980
|
-
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) {
|
|
2989
|
+
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
2990
|
+
var _a;
|
|
2991
|
+
var _b;
|
|
2992
|
+
return __generator(this, function (_c) {
|
|
2993
|
+
switch (_c.label) {
|
|
2994
|
+
case 0:
|
|
2995
|
+
_a = [__assign({}, row)];
|
|
2996
|
+
_b = {};
|
|
2997
|
+
// <- TODO: !!!!!! Dynamic new column name and position
|
|
2998
|
+
// <- TODO: !!!!!! Check name collisions
|
|
2999
|
+
return [4 /*yield*/, mapCallback(row, index)];
|
|
3000
|
+
case 1: return [2 /*return*/, (__assign.apply(void 0, _a.concat([(_b.newColumn =
|
|
3001
|
+
// <- TODO: !!!!!! Dynamic new column name and position
|
|
3002
|
+
// <- TODO: !!!!!! Check name collisions
|
|
3003
|
+
_c.sent(), _b)])))];
|
|
3004
|
+
}
|
|
3005
|
+
});
|
|
3006
|
+
}); }))];
|
|
2981
3007
|
case 1:
|
|
2982
3008
|
mappedData = _a.sent();
|
|
2983
|
-
return [2 /*return*/, unparse(mappedData,
|
|
2984
|
-
header: true,
|
|
2985
|
-
delimiter: ',',
|
|
2986
|
-
quoteChar: '"',
|
|
2987
|
-
newline: '\r\n',
|
|
2988
|
-
skipEmptyLines: true,
|
|
2989
|
-
// encoding: 'utf8',
|
|
2990
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
2991
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
2992
|
-
})];
|
|
3009
|
+
return [2 /*return*/, unparse(mappedData, settings)];
|
|
2993
3010
|
}
|
|
2994
3011
|
});
|
|
2995
3012
|
});
|
|
@@ -2997,23 +3014,14 @@ var CsvFormatDefinition = {
|
|
|
2997
3014
|
},
|
|
2998
3015
|
{
|
|
2999
3016
|
subvalueName: 'CELL',
|
|
3000
|
-
mapValues: function (value, mapCallback) {
|
|
3017
|
+
mapValues: function (value, settings, mapCallback) {
|
|
3001
3018
|
return __awaiter(this, void 0, void 0, function () {
|
|
3002
3019
|
var csv, mappedData;
|
|
3003
3020
|
var _this = this;
|
|
3004
3021
|
return __generator(this, function (_a) {
|
|
3005
3022
|
switch (_a.label) {
|
|
3006
3023
|
case 0:
|
|
3007
|
-
csv = parse(value,
|
|
3008
|
-
header: true,
|
|
3009
|
-
delimiter: ',',
|
|
3010
|
-
quoteChar: '"',
|
|
3011
|
-
newline: '\r\n',
|
|
3012
|
-
skipEmptyLines: true,
|
|
3013
|
-
// encoding: 'utf8',
|
|
3014
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
3015
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
3016
|
-
});
|
|
3024
|
+
csv = parse(value, settings);
|
|
3017
3025
|
if (csv.errors.length !== 0) {
|
|
3018
3026
|
throw new ParseError(// <- TODO: !!!!!! Split PipelineParseError and FormatParseError -> CsvParseError
|
|
3019
3027
|
spaceTrim(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
|
|
@@ -3036,16 +3044,7 @@ var CsvFormatDefinition = {
|
|
|
3036
3044
|
}); }))];
|
|
3037
3045
|
case 1:
|
|
3038
3046
|
mappedData = _a.sent();
|
|
3039
|
-
return [2 /*return*/, unparse(mappedData,
|
|
3040
|
-
header: true,
|
|
3041
|
-
delimiter: ',',
|
|
3042
|
-
quoteChar: '"',
|
|
3043
|
-
newline: '\r\n',
|
|
3044
|
-
skipEmptyLines: true,
|
|
3045
|
-
// encoding: 'utf8',
|
|
3046
|
-
// <- TODO: !!!!!! DEFAULT_CSV_OPTIONS
|
|
3047
|
-
// <- TODO: [🧠] How to define parsing options for formats, its different concept than schema
|
|
3048
|
-
})];
|
|
3047
|
+
return [2 /*return*/, unparse(mappedData, settings)];
|
|
3049
3048
|
}
|
|
3050
3049
|
});
|
|
3051
3050
|
});
|
|
@@ -3090,17 +3089,20 @@ function isValidJsonString(value /* <- [👨⚖️] */) {
|
|
|
3090
3089
|
var JsonFormatDefinition = {
|
|
3091
3090
|
formatName: 'JSON',
|
|
3092
3091
|
mimeType: 'application/json',
|
|
3093
|
-
isValid: function (value, schema) {
|
|
3092
|
+
isValid: function (value, settings, schema) {
|
|
3094
3093
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
3094
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
3095
3095
|
return isValidJsonString(value);
|
|
3096
3096
|
},
|
|
3097
|
-
canBeValid: function (partialValue, schema) {
|
|
3097
|
+
canBeValid: function (partialValue, settings, schema) {
|
|
3098
3098
|
TODO_USE(partialValue /* <- TODO: Use partialValue here */);
|
|
3099
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
3099
3100
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
3100
3101
|
return true;
|
|
3101
3102
|
},
|
|
3102
|
-
heal: function (value, schema) {
|
|
3103
|
+
heal: function (value, settings, schema) {
|
|
3103
3104
|
TODO_USE(value /* <- TODO: Use partialValue here */);
|
|
3105
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
3104
3106
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
3105
3107
|
throw new Error('Not implemented');
|
|
3106
3108
|
},
|
|
@@ -3109,7 +3111,7 @@ var JsonFormatDefinition = {
|
|
|
3109
3111
|
/**
|
|
3110
3112
|
* TODO: [🧠] Maybe propper instance of object
|
|
3111
3113
|
* TODO: [0] Make string_serialized_json
|
|
3112
|
-
* TODO: [1] Make type for JSON Schema
|
|
3114
|
+
* TODO: [1] Make type for JSON Settings and Schema
|
|
3113
3115
|
* TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
|
|
3114
3116
|
* TODO: [🍓] In `JsonFormatDefinition` implement simple `isValid`
|
|
3115
3117
|
* TODO: [🍓] In `JsonFormatDefinition` implement partial `canBeValid`
|
|
@@ -3139,7 +3141,7 @@ var TextFormatDefinition = {
|
|
|
3139
3141
|
subvalueDefinitions: [
|
|
3140
3142
|
{
|
|
3141
3143
|
subvalueName: 'LINE',
|
|
3142
|
-
mapValues: function (value, mapCallback) {
|
|
3144
|
+
mapValues: function (value, settings, mapCallback) {
|
|
3143
3145
|
return __awaiter(this, void 0, void 0, function () {
|
|
3144
3146
|
var lines, mappedLines;
|
|
3145
3147
|
return __generator(this, function (_a) {
|
|
@@ -3165,6 +3167,7 @@ var TextFormatDefinition = {
|
|
|
3165
3167
|
],
|
|
3166
3168
|
};
|
|
3167
3169
|
/**
|
|
3170
|
+
* TODO: [1] Make type for XML Text and Schema
|
|
3168
3171
|
* TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages aviable as subvalues
|
|
3169
3172
|
* TODO: [🍓] In `TextFormatDefinition` implement simple `isValid`
|
|
3170
3173
|
* TODO: [🍓] In `TextFormatDefinition` implement partial `canBeValid`
|
|
@@ -3181,18 +3184,21 @@ var TextFormatDefinition = {
|
|
|
3181
3184
|
var XmlFormatDefinition = {
|
|
3182
3185
|
formatName: 'XML',
|
|
3183
3186
|
mimeType: 'application/xml',
|
|
3184
|
-
isValid: function (value, schema) {
|
|
3187
|
+
isValid: function (value, settings, schema) {
|
|
3185
3188
|
TODO_USE(value /* <- TODO: Use value here */);
|
|
3189
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
3186
3190
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
3187
3191
|
return true;
|
|
3188
3192
|
},
|
|
3189
|
-
canBeValid: function (partialValue, schema) {
|
|
3193
|
+
canBeValid: function (partialValue, settings, schema) {
|
|
3190
3194
|
TODO_USE(partialValue /* <- TODO: Use partialValue here */);
|
|
3195
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
3191
3196
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
3192
3197
|
return true;
|
|
3193
3198
|
},
|
|
3194
|
-
heal: function (value, schema) {
|
|
3199
|
+
heal: function (value, settings, schema) {
|
|
3195
3200
|
TODO_USE(value /* <- TODO: Use partialValue here */);
|
|
3201
|
+
TODO_USE(settings /* <- TODO: Use settings here */);
|
|
3196
3202
|
TODO_USE(schema /* <- TODO: Use schema here */);
|
|
3197
3203
|
throw new Error('Not implemented');
|
|
3198
3204
|
},
|
|
@@ -3201,7 +3207,7 @@ var XmlFormatDefinition = {
|
|
|
3201
3207
|
/**
|
|
3202
3208
|
* TODO: [🧠] Maybe propper instance of object
|
|
3203
3209
|
* TODO: [0] Make string_serialized_xml
|
|
3204
|
-
* TODO: [1] Make type for XML Schema
|
|
3210
|
+
* TODO: [1] Make type for XML Settings and Schema
|
|
3205
3211
|
* TODO: [🧠] What to use for validating XMLs - XSD,...
|
|
3206
3212
|
* TODO: [🍓] In `XmlFormatDefinition` implement simple `isValid`
|
|
3207
3213
|
* TODO: [🍓] In `XmlFormatDefinition` implement partial `canBeValid`
|
|
@@ -4041,12 +4047,12 @@ function executeAttempts(options) {
|
|
|
4041
4047
|
*/
|
|
4042
4048
|
function executeFormatCells(options) {
|
|
4043
4049
|
return __awaiter(this, void 0, void 0, function () {
|
|
4044
|
-
var template, jokerParameterNames, parameters, priority, pipelineIdentification, parameterValue, formatDefinition, subvalueDefinition, resultString;
|
|
4050
|
+
var template, jokerParameterNames, parameters, priority, pipelineIdentification, settings, parameterValue, formatDefinition, subvalueDefinition, formatSettings, resultString;
|
|
4045
4051
|
var _this = this;
|
|
4046
4052
|
return __generator(this, function (_a) {
|
|
4047
4053
|
switch (_a.label) {
|
|
4048
4054
|
case 0:
|
|
4049
|
-
template = options.template, jokerParameterNames = options.jokerParameterNames, parameters = options.parameters, priority = options.priority, pipelineIdentification = options.pipelineIdentification;
|
|
4055
|
+
template = options.template, jokerParameterNames = options.jokerParameterNames, parameters = options.parameters, priority = options.priority, pipelineIdentification = options.pipelineIdentification, settings = options.settings;
|
|
4050
4056
|
if (template.foreach === undefined) {
|
|
4051
4057
|
return [2 /*return*/, /* not await */ executeAttempts(options)];
|
|
4052
4058
|
}
|
|
@@ -4075,7 +4081,11 @@ function executeFormatCells(options) {
|
|
|
4075
4081
|
.map(function (subvalueName) { return "- ".concat(subvalueName); })
|
|
4076
4082
|
.join('\n')), "\n\n [\u26F7] This should never happen because cell name should be validated during parsing\n\n ").concat(block(pipelineIdentification), "\n "); }));
|
|
4077
4083
|
}
|
|
4078
|
-
|
|
4084
|
+
if (formatDefinition.formatName === 'CSV') {
|
|
4085
|
+
formatSettings = settings.csvSettings;
|
|
4086
|
+
// <- TODO: !!!!!! More universal, make simmilar pattern for other formats for example \n vs \r\n in text
|
|
4087
|
+
}
|
|
4088
|
+
return [4 /*yield*/, subvalueDefinition.mapValues(parameterValue, formatSettings, function (subparameters, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
4079
4089
|
var mappedParameters, allSubparameters, subresultString;
|
|
4080
4090
|
return __generator(this, function (_a) {
|
|
4081
4091
|
switch (_a.label) {
|
|
@@ -4710,7 +4720,7 @@ function executePipeline(options) {
|
|
|
4710
4720
|
function createPipelineExecutor(options) {
|
|
4711
4721
|
var _this = this;
|
|
4712
4722
|
var pipeline = options.pipeline, tools = options.tools, _a = options.settings, settings = _a === void 0 ? {} : _a;
|
|
4713
|
-
var _b = settings.maxExecutionAttempts, maxExecutionAttempts = _b === void 0 ? MAX_EXECUTION_ATTEMPTS : _b, _c = settings.maxParallelCount, maxParallelCount = _c === void 0 ? MAX_PARALLEL_COUNT : _c, _d = settings.
|
|
4723
|
+
var _b = settings.maxExecutionAttempts, maxExecutionAttempts = _b === void 0 ? MAX_EXECUTION_ATTEMPTS : _b, _c = settings.maxParallelCount, maxParallelCount = _c === void 0 ? MAX_PARALLEL_COUNT : _c, _d = settings.csvSettings, csvSettings = _d === void 0 ? DEFAULT_CSV_SETTINGS : _d, _e = settings.isVerbose, isVerbose = _e === void 0 ? IS_VERBOSE : _e, _f = settings.isNotPreparedWarningSupressed, isNotPreparedWarningSupressed = _f === void 0 ? false : _f;
|
|
4714
4724
|
validatePipeline(pipeline);
|
|
4715
4725
|
var pipelineIdentification = (function () {
|
|
4716
4726
|
// Note: This is a 😐 implementation of [🚞]
|
|
@@ -4745,6 +4755,7 @@ function createPipelineExecutor(options) {
|
|
|
4745
4755
|
settings: {
|
|
4746
4756
|
maxExecutionAttempts: maxExecutionAttempts,
|
|
4747
4757
|
maxParallelCount: maxParallelCount,
|
|
4758
|
+
csvSettings: csvSettings,
|
|
4748
4759
|
isVerbose: isVerbose,
|
|
4749
4760
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
4750
4761
|
},
|
|
@@ -7475,7 +7486,7 @@ function extractAllListItemsFromMarkdown(markdown) {
|
|
|
7475
7486
|
function extractOneBlockFromMarkdown(markdown) {
|
|
7476
7487
|
var codeBlocks = extractAllBlocksFromMarkdown(markdown);
|
|
7477
7488
|
if (codeBlocks.length !== 1) {
|
|
7478
|
-
throw new ParseError(spaceTrim(function (block) { return "\n There should be exactly 1 code block, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
|
|
7489
|
+
throw new ParseError(spaceTrim(function (block) { return "\n There should be exactly 1 code block in template, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
|
|
7479
7490
|
}
|
|
7480
7491
|
return codeBlocks[0];
|
|
7481
7492
|
}
|
|
@@ -8239,7 +8250,7 @@ function usageToHuman(usage) {
|
|
|
8239
8250
|
var value = _a.value, isUncertain = _a.isUncertain;
|
|
8240
8251
|
return "".concat(isUncertain ? 'approximately ' : '').concat(Math.round(value * 100) / 100);
|
|
8241
8252
|
};
|
|
8242
|
-
if (usage.price.value > 0.
|
|
8253
|
+
if (usage.price.value > 0.01
|
|
8243
8254
|
// <- TODO: [🍓][🧞♂️][👩🏽🤝🧑🏻] Configure negligible value - default value to config + value to `UsageToHumanSettings`
|
|
8244
8255
|
) {
|
|
8245
8256
|
reportItems.push("Cost ".concat(uncertainNumberToHuman(usage.price), " USD"));
|
|
@@ -8248,7 +8259,8 @@ function usageToHuman(usage) {
|
|
|
8248
8259
|
reportItems.push("Negligible cost");
|
|
8249
8260
|
}
|
|
8250
8261
|
var worktime = usageToWorktime(usage);
|
|
8251
|
-
if (worktime.value >
|
|
8262
|
+
if (worktime.value >
|
|
8263
|
+
1 / 60
|
|
8252
8264
|
// <- TODO: [🍓][🧞♂️][👩🏽🤝🧑🏻]
|
|
8253
8265
|
) {
|
|
8254
8266
|
reportItems.push("Saved ".concat(uncertainNumberToHuman(usageToWorktime(usage)), " hours of human time"));
|
|
@@ -9206,5 +9218,5 @@ function executionReportJsonToString(executionReportJson, options) {
|
|
|
9206
9218
|
* TODO: [🧠] Should be in generated file GENERATOR_WARNING
|
|
9207
9219
|
*/
|
|
9208
9220
|
|
|
9209
|
-
export { $llmToolsMetadataRegister, $llmToolsRegister, CLAIM, CallbackInterfaceTools, CollectionError, CsvFormatDefinition, DEFAULT_REMOTE_URL, DEFAULT_REMOTE_URL_PATH, ERRORS, EXECUTIONS_CACHE_DIRNAME, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, IS_VERBOSE, LimitReachedError, MAX_EXECUTION_ATTEMPTS, MAX_FILENAME_LENGTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, MAX_PARALLEL_COUNT, MODEL_VARIANTS, MemoryStorage, NotFoundError, NotYetImplementedError, PIPELINE_COLLECTION_BASE_FILENAME, PROMPTBOOK_VERSION, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, RESERVED_PARAMETER_NAMES, TemplateTypes, TextFormatDefinition, UnexpectedError, ZERO_USAGE, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _OpenAiMetadataRegistration, addUsage, assertsExecutionSuccessful, cacheLlmTools, collectionToJson, countTotalUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, isPipelinePrepared, joinLlmExecutionTools, limitTotalUsage, pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, prepareKnowledgeFromMarkdown, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTemplates, prettifyPipelineString, stringifyPipelineJson, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline };
|
|
9221
|
+
export { $llmToolsMetadataRegister, $llmToolsRegister, CLAIM, CallbackInterfaceTools, CollectionError, CsvFormatDefinition, DEFAULT_CSV_SETTINGS, DEFAULT_REMOTE_URL, DEFAULT_REMOTE_URL_PATH, ERRORS, EXECUTIONS_CACHE_DIRNAME, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, IS_VERBOSE, LimitReachedError, MAX_EXECUTION_ATTEMPTS, MAX_FILENAME_LENGTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, MAX_PARALLEL_COUNT, MODEL_VARIANTS, MemoryStorage, NotFoundError, NotYetImplementedError, PIPELINE_COLLECTION_BASE_FILENAME, PROMPTBOOK_VERSION, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, RESERVED_PARAMETER_NAMES, TemplateTypes, TextFormatDefinition, UnexpectedError, ZERO_USAGE, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _OpenAiMetadataRegistration, addUsage, assertsExecutionSuccessful, cacheLlmTools, collectionToJson, countTotalUsage, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createLlmToolsFromConfiguration, createPipelineExecutor, createSubcollection, embeddingVectorToString, executionReportJsonToString, isPassingExpectations, isPipelinePrepared, joinLlmExecutionTools, limitTotalUsage, pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, prepareKnowledgeFromMarkdown, prepareKnowledgePieces, preparePersona, preparePipeline, prepareTemplates, prettifyPipelineString, stringifyPipelineJson, unpreparePipeline, usageToHuman, usageToWorktime, validatePipeline };
|
|
9210
9222
|
//# sourceMappingURL=index.es.js.map
|