@promptbook/core 0.53.0 → 0.54.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/esm/index.es.js +77 -77
- package/esm/index.es.js.map +1 -1
- package/esm/typings/_packages/core.index.d.ts +10 -0
- package/esm/typings/_packages/types.index.d.ts +0 -1
- package/package.json +1 -1
- package/umd/index.umd.js +85 -76
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/_packages/core.index.d.ts +10 -0
- package/umd/typings/_packages/types.index.d.ts +0 -1
package/esm/index.es.js
CHANGED
|
@@ -448,7 +448,7 @@ function union() {
|
|
|
448
448
|
/**
|
|
449
449
|
* The version of the Promptbook library
|
|
450
450
|
*/
|
|
451
|
-
var PROMPTBOOK_VERSION = '0.
|
|
451
|
+
var PROMPTBOOK_VERSION = '0.53.0';
|
|
452
452
|
|
|
453
453
|
/**
|
|
454
454
|
* Parses the template and returns the list of all parameter names
|
|
@@ -2176,6 +2176,23 @@ function validatePromptbookJson(promptbook) {
|
|
|
2176
2176
|
* > ex port function validatePromptbookJson(promptbook: unknown): asserts promptbook is PromptbookJson {
|
|
2177
2177
|
*/
|
|
2178
2178
|
|
|
2179
|
+
/**
|
|
2180
|
+
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
2181
|
+
*
|
|
2182
|
+
* @private Always catched and rethrown as `PromptbookExecutionError`
|
|
2183
|
+
* Note: This is a kindof subtype of PromptbookExecutionError
|
|
2184
|
+
*/
|
|
2185
|
+
var ExpectError = /** @class */ (function (_super) {
|
|
2186
|
+
__extends(ExpectError, _super);
|
|
2187
|
+
function ExpectError(message) {
|
|
2188
|
+
var _this = _super.call(this, message) || this;
|
|
2189
|
+
_this.name = 'ExpectError';
|
|
2190
|
+
Object.setPrototypeOf(_this, ExpectError.prototype);
|
|
2191
|
+
return _this;
|
|
2192
|
+
}
|
|
2193
|
+
return ExpectError;
|
|
2194
|
+
}(Error));
|
|
2195
|
+
|
|
2179
2196
|
/**
|
|
2180
2197
|
* This error indicates errors during the execution of the promptbook
|
|
2181
2198
|
*/
|
|
@@ -2190,6 +2207,64 @@ var PromptbookExecutionError = /** @class */ (function (_super) {
|
|
|
2190
2207
|
return PromptbookExecutionError;
|
|
2191
2208
|
}(Error));
|
|
2192
2209
|
|
|
2210
|
+
/**
|
|
2211
|
+
* This error indicates that the promptbook library cannot be propperly loaded
|
|
2212
|
+
*/
|
|
2213
|
+
var PromptbookLibraryError = /** @class */ (function (_super) {
|
|
2214
|
+
__extends(PromptbookLibraryError, _super);
|
|
2215
|
+
function PromptbookLibraryError(message) {
|
|
2216
|
+
var _this = _super.call(this, message) || this;
|
|
2217
|
+
_this.name = 'PromptbookLibraryError';
|
|
2218
|
+
Object.setPrototypeOf(_this, PromptbookLibraryError.prototype);
|
|
2219
|
+
return _this;
|
|
2220
|
+
}
|
|
2221
|
+
return PromptbookLibraryError;
|
|
2222
|
+
}(Error));
|
|
2223
|
+
|
|
2224
|
+
/**
|
|
2225
|
+
* This error indicates that promptbook not found in the library
|
|
2226
|
+
*/
|
|
2227
|
+
var PromptbookNotFoundError = /** @class */ (function (_super) {
|
|
2228
|
+
__extends(PromptbookNotFoundError, _super);
|
|
2229
|
+
function PromptbookNotFoundError(message) {
|
|
2230
|
+
var _this = _super.call(this, message) || this;
|
|
2231
|
+
_this.name = 'PromptbookNotFoundError';
|
|
2232
|
+
Object.setPrototypeOf(_this, PromptbookNotFoundError.prototype);
|
|
2233
|
+
return _this;
|
|
2234
|
+
}
|
|
2235
|
+
return PromptbookNotFoundError;
|
|
2236
|
+
}(Error));
|
|
2237
|
+
|
|
2238
|
+
/**
|
|
2239
|
+
* This error indicates errors in referencing promptbooks between each other
|
|
2240
|
+
*/
|
|
2241
|
+
var PromptbookReferenceError = /** @class */ (function (_super) {
|
|
2242
|
+
__extends(PromptbookReferenceError, _super);
|
|
2243
|
+
function PromptbookReferenceError(message) {
|
|
2244
|
+
var _this = _super.call(this, message) || this;
|
|
2245
|
+
_this.name = 'PromptbookReferenceError';
|
|
2246
|
+
Object.setPrototypeOf(_this, PromptbookReferenceError.prototype);
|
|
2247
|
+
return _this;
|
|
2248
|
+
}
|
|
2249
|
+
return PromptbookReferenceError;
|
|
2250
|
+
}(Error));
|
|
2251
|
+
|
|
2252
|
+
/**
|
|
2253
|
+
* This error occurs during the parameter replacement in the template
|
|
2254
|
+
*
|
|
2255
|
+
* Note: This is a kindof subtype of PromptbookExecutionError because it occurs during the execution of the pipeline
|
|
2256
|
+
*/
|
|
2257
|
+
var TemplateError = /** @class */ (function (_super) {
|
|
2258
|
+
__extends(TemplateError, _super);
|
|
2259
|
+
function TemplateError(message) {
|
|
2260
|
+
var _this = _super.call(this, message) || this;
|
|
2261
|
+
_this.name = 'TemplateError';
|
|
2262
|
+
Object.setPrototypeOf(_this, TemplateError.prototype);
|
|
2263
|
+
return _this;
|
|
2264
|
+
}
|
|
2265
|
+
return TemplateError;
|
|
2266
|
+
}(Error));
|
|
2267
|
+
|
|
2193
2268
|
/**
|
|
2194
2269
|
* Asserts that the execution of a promptnook is successful
|
|
2195
2270
|
*
|
|
@@ -2215,23 +2290,6 @@ function assertsExecutionSuccessful(executionResult) {
|
|
|
2215
2290
|
* TODO: [🧠] Can this return type be better typed than void
|
|
2216
2291
|
*/
|
|
2217
2292
|
|
|
2218
|
-
/**
|
|
2219
|
-
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
2220
|
-
*
|
|
2221
|
-
* @private Always catched and rethrown as `PromptbookExecutionError`
|
|
2222
|
-
* Note: This is a kindof subtype of PromptbookExecutionError
|
|
2223
|
-
*/
|
|
2224
|
-
var ExpectError = /** @class */ (function (_super) {
|
|
2225
|
-
__extends(ExpectError, _super);
|
|
2226
|
-
function ExpectError(message) {
|
|
2227
|
-
var _this = _super.call(this, message) || this;
|
|
2228
|
-
_this.name = 'ExpectError';
|
|
2229
|
-
Object.setPrototypeOf(_this, ExpectError.prototype);
|
|
2230
|
-
return _this;
|
|
2231
|
-
}
|
|
2232
|
-
return ExpectError;
|
|
2233
|
-
}(Error));
|
|
2234
|
-
|
|
2235
2293
|
/**
|
|
2236
2294
|
* Function isValidJsonString will tell you if the string is valid JSON or not
|
|
2237
2295
|
*/
|
|
@@ -2382,22 +2440,6 @@ function isPassingExpectations(expectations, value) {
|
|
|
2382
2440
|
* TODO: [💝] Unite object for expecting amount and format
|
|
2383
2441
|
*/
|
|
2384
2442
|
|
|
2385
|
-
/**
|
|
2386
|
-
* This error occurs during the parameter replacement in the template
|
|
2387
|
-
*
|
|
2388
|
-
* Note: This is a kindof subtype of PromptbookExecutionError because it occurs during the execution of the pipeline
|
|
2389
|
-
*/
|
|
2390
|
-
var TemplateError = /** @class */ (function (_super) {
|
|
2391
|
-
__extends(TemplateError, _super);
|
|
2392
|
-
function TemplateError(message) {
|
|
2393
|
-
var _this = _super.call(this, message) || this;
|
|
2394
|
-
_this.name = 'TemplateError';
|
|
2395
|
-
Object.setPrototypeOf(_this, TemplateError.prototype);
|
|
2396
|
-
return _this;
|
|
2397
|
-
}
|
|
2398
|
-
return TemplateError;
|
|
2399
|
-
}(Error));
|
|
2400
|
-
|
|
2401
2443
|
/**
|
|
2402
2444
|
* Replaces parameters in template with values from parameters object
|
|
2403
2445
|
*
|
|
@@ -3169,20 +3211,6 @@ var SimplePromptInterfaceTools = /** @class */ (function () {
|
|
|
3169
3211
|
return SimplePromptInterfaceTools;
|
|
3170
3212
|
}());
|
|
3171
3213
|
|
|
3172
|
-
/**
|
|
3173
|
-
* This error indicates that the promptbook library cannot be propperly loaded
|
|
3174
|
-
*/
|
|
3175
|
-
var PromptbookLibraryError = /** @class */ (function (_super) {
|
|
3176
|
-
__extends(PromptbookLibraryError, _super);
|
|
3177
|
-
function PromptbookLibraryError(message) {
|
|
3178
|
-
var _this = _super.call(this, message) || this;
|
|
3179
|
-
_this.name = 'PromptbookLibraryError';
|
|
3180
|
-
Object.setPrototypeOf(_this, PromptbookLibraryError.prototype);
|
|
3181
|
-
return _this;
|
|
3182
|
-
}
|
|
3183
|
-
return PromptbookLibraryError;
|
|
3184
|
-
}(Error));
|
|
3185
|
-
|
|
3186
3214
|
/**
|
|
3187
3215
|
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
3188
3216
|
*/
|
|
@@ -3213,34 +3241,6 @@ function just(value) {
|
|
|
3213
3241
|
return value;
|
|
3214
3242
|
}
|
|
3215
3243
|
|
|
3216
|
-
/**
|
|
3217
|
-
* This error indicates that promptbook not found in the library
|
|
3218
|
-
*/
|
|
3219
|
-
var PromptbookNotFoundError = /** @class */ (function (_super) {
|
|
3220
|
-
__extends(PromptbookNotFoundError, _super);
|
|
3221
|
-
function PromptbookNotFoundError(message) {
|
|
3222
|
-
var _this = _super.call(this, message) || this;
|
|
3223
|
-
_this.name = 'PromptbookNotFoundError';
|
|
3224
|
-
Object.setPrototypeOf(_this, PromptbookNotFoundError.prototype);
|
|
3225
|
-
return _this;
|
|
3226
|
-
}
|
|
3227
|
-
return PromptbookNotFoundError;
|
|
3228
|
-
}(Error));
|
|
3229
|
-
|
|
3230
|
-
/**
|
|
3231
|
-
* This error indicates errors in referencing promptbooks between each other
|
|
3232
|
-
*/
|
|
3233
|
-
var PromptbookReferenceError = /** @class */ (function (_super) {
|
|
3234
|
-
__extends(PromptbookReferenceError, _super);
|
|
3235
|
-
function PromptbookReferenceError(message) {
|
|
3236
|
-
var _this = _super.call(this, message) || this;
|
|
3237
|
-
_this.name = 'PromptbookReferenceError';
|
|
3238
|
-
Object.setPrototypeOf(_this, PromptbookReferenceError.prototype);
|
|
3239
|
-
return _this;
|
|
3240
|
-
}
|
|
3241
|
-
return PromptbookReferenceError;
|
|
3242
|
-
}(Error));
|
|
3243
|
-
|
|
3244
3244
|
/**
|
|
3245
3245
|
* Library of promptbooks that groups together promptbooks for an application.
|
|
3246
3246
|
* This implementation is a very thin wrapper around the Array / Map of promptbooks.
|
|
@@ -4110,5 +4110,5 @@ function executionReportJsonToString(executionReportJson, options) {
|
|
|
4110
4110
|
* TODO: [🧠] Allow to filter out some parts of the report by options
|
|
4111
4111
|
*/
|
|
4112
4112
|
|
|
4113
|
-
export { CallbackInterfaceTools, ExecutionReportStringOptionsDefaults, ExecutionTypes, MultipleLlmExecutionTools, PROMPTBOOK_VERSION, SimplePromptInterfaceTools, SimplePromptbookLibrary, assertsExecutionSuccessful, checkExpectations, createPromptbookExecutor, createPromptbookLibraryFromDirectory, createPromptbookLibraryFromSources, createPromptbookLibraryFromUrl, createPromptbookSublibrary, executionReportJsonToString, isPassingExpectations, justTestFsImport, prettifyPromptbookString, promptbookJsonToString, promptbookStringToJson, validatePromptbookJson };
|
|
4113
|
+
export { CallbackInterfaceTools, ExecutionReportStringOptionsDefaults, ExecutionTypes, ExpectError, MultipleLlmExecutionTools, PROMPTBOOK_VERSION, PromptbookExecutionError, PromptbookLibraryError, PromptbookLogicError, PromptbookNotFoundError, PromptbookReferenceError, PromptbookSyntaxError, SimplePromptInterfaceTools, SimplePromptbookLibrary, TemplateError, UnexpectedError, assertsExecutionSuccessful, checkExpectations, createPromptbookExecutor, createPromptbookLibraryFromDirectory, createPromptbookLibraryFromSources, createPromptbookLibraryFromUrl, createPromptbookSublibrary, executionReportJsonToString, isPassingExpectations, justTestFsImport, prettifyPromptbookString, promptbookJsonToString, promptbookStringToJson, validatePromptbookJson };
|
|
4114
4114
|
//# sourceMappingURL=index.es.js.map
|