@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/umd/index.umd.js
CHANGED
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
/**
|
|
455
455
|
* The version of the Promptbook library
|
|
456
456
|
*/
|
|
457
|
-
var PROMPTBOOK_VERSION = '0.
|
|
457
|
+
var PROMPTBOOK_VERSION = '0.53.0';
|
|
458
458
|
|
|
459
459
|
/**
|
|
460
460
|
* Parses the template and returns the list of all parameter names
|
|
@@ -2182,6 +2182,23 @@
|
|
|
2182
2182
|
* > ex port function validatePromptbookJson(promptbook: unknown): asserts promptbook is PromptbookJson {
|
|
2183
2183
|
*/
|
|
2184
2184
|
|
|
2185
|
+
/**
|
|
2186
|
+
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
2187
|
+
*
|
|
2188
|
+
* @private Always catched and rethrown as `PromptbookExecutionError`
|
|
2189
|
+
* Note: This is a kindof subtype of PromptbookExecutionError
|
|
2190
|
+
*/
|
|
2191
|
+
var ExpectError = /** @class */ (function (_super) {
|
|
2192
|
+
__extends(ExpectError, _super);
|
|
2193
|
+
function ExpectError(message) {
|
|
2194
|
+
var _this = _super.call(this, message) || this;
|
|
2195
|
+
_this.name = 'ExpectError';
|
|
2196
|
+
Object.setPrototypeOf(_this, ExpectError.prototype);
|
|
2197
|
+
return _this;
|
|
2198
|
+
}
|
|
2199
|
+
return ExpectError;
|
|
2200
|
+
}(Error));
|
|
2201
|
+
|
|
2185
2202
|
/**
|
|
2186
2203
|
* This error indicates errors during the execution of the promptbook
|
|
2187
2204
|
*/
|
|
@@ -2196,6 +2213,64 @@
|
|
|
2196
2213
|
return PromptbookExecutionError;
|
|
2197
2214
|
}(Error));
|
|
2198
2215
|
|
|
2216
|
+
/**
|
|
2217
|
+
* This error indicates that the promptbook library cannot be propperly loaded
|
|
2218
|
+
*/
|
|
2219
|
+
var PromptbookLibraryError = /** @class */ (function (_super) {
|
|
2220
|
+
__extends(PromptbookLibraryError, _super);
|
|
2221
|
+
function PromptbookLibraryError(message) {
|
|
2222
|
+
var _this = _super.call(this, message) || this;
|
|
2223
|
+
_this.name = 'PromptbookLibraryError';
|
|
2224
|
+
Object.setPrototypeOf(_this, PromptbookLibraryError.prototype);
|
|
2225
|
+
return _this;
|
|
2226
|
+
}
|
|
2227
|
+
return PromptbookLibraryError;
|
|
2228
|
+
}(Error));
|
|
2229
|
+
|
|
2230
|
+
/**
|
|
2231
|
+
* This error indicates that promptbook not found in the library
|
|
2232
|
+
*/
|
|
2233
|
+
var PromptbookNotFoundError = /** @class */ (function (_super) {
|
|
2234
|
+
__extends(PromptbookNotFoundError, _super);
|
|
2235
|
+
function PromptbookNotFoundError(message) {
|
|
2236
|
+
var _this = _super.call(this, message) || this;
|
|
2237
|
+
_this.name = 'PromptbookNotFoundError';
|
|
2238
|
+
Object.setPrototypeOf(_this, PromptbookNotFoundError.prototype);
|
|
2239
|
+
return _this;
|
|
2240
|
+
}
|
|
2241
|
+
return PromptbookNotFoundError;
|
|
2242
|
+
}(Error));
|
|
2243
|
+
|
|
2244
|
+
/**
|
|
2245
|
+
* This error indicates errors in referencing promptbooks between each other
|
|
2246
|
+
*/
|
|
2247
|
+
var PromptbookReferenceError = /** @class */ (function (_super) {
|
|
2248
|
+
__extends(PromptbookReferenceError, _super);
|
|
2249
|
+
function PromptbookReferenceError(message) {
|
|
2250
|
+
var _this = _super.call(this, message) || this;
|
|
2251
|
+
_this.name = 'PromptbookReferenceError';
|
|
2252
|
+
Object.setPrototypeOf(_this, PromptbookReferenceError.prototype);
|
|
2253
|
+
return _this;
|
|
2254
|
+
}
|
|
2255
|
+
return PromptbookReferenceError;
|
|
2256
|
+
}(Error));
|
|
2257
|
+
|
|
2258
|
+
/**
|
|
2259
|
+
* This error occurs during the parameter replacement in the template
|
|
2260
|
+
*
|
|
2261
|
+
* Note: This is a kindof subtype of PromptbookExecutionError because it occurs during the execution of the pipeline
|
|
2262
|
+
*/
|
|
2263
|
+
var TemplateError = /** @class */ (function (_super) {
|
|
2264
|
+
__extends(TemplateError, _super);
|
|
2265
|
+
function TemplateError(message) {
|
|
2266
|
+
var _this = _super.call(this, message) || this;
|
|
2267
|
+
_this.name = 'TemplateError';
|
|
2268
|
+
Object.setPrototypeOf(_this, TemplateError.prototype);
|
|
2269
|
+
return _this;
|
|
2270
|
+
}
|
|
2271
|
+
return TemplateError;
|
|
2272
|
+
}(Error));
|
|
2273
|
+
|
|
2199
2274
|
/**
|
|
2200
2275
|
* Asserts that the execution of a promptnook is successful
|
|
2201
2276
|
*
|
|
@@ -2221,23 +2296,6 @@
|
|
|
2221
2296
|
* TODO: [🧠] Can this return type be better typed than void
|
|
2222
2297
|
*/
|
|
2223
2298
|
|
|
2224
|
-
/**
|
|
2225
|
-
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
2226
|
-
*
|
|
2227
|
-
* @private Always catched and rethrown as `PromptbookExecutionError`
|
|
2228
|
-
* Note: This is a kindof subtype of PromptbookExecutionError
|
|
2229
|
-
*/
|
|
2230
|
-
var ExpectError = /** @class */ (function (_super) {
|
|
2231
|
-
__extends(ExpectError, _super);
|
|
2232
|
-
function ExpectError(message) {
|
|
2233
|
-
var _this = _super.call(this, message) || this;
|
|
2234
|
-
_this.name = 'ExpectError';
|
|
2235
|
-
Object.setPrototypeOf(_this, ExpectError.prototype);
|
|
2236
|
-
return _this;
|
|
2237
|
-
}
|
|
2238
|
-
return ExpectError;
|
|
2239
|
-
}(Error));
|
|
2240
|
-
|
|
2241
2299
|
/**
|
|
2242
2300
|
* Function isValidJsonString will tell you if the string is valid JSON or not
|
|
2243
2301
|
*/
|
|
@@ -2388,22 +2446,6 @@
|
|
|
2388
2446
|
* TODO: [💝] Unite object for expecting amount and format
|
|
2389
2447
|
*/
|
|
2390
2448
|
|
|
2391
|
-
/**
|
|
2392
|
-
* This error occurs during the parameter replacement in the template
|
|
2393
|
-
*
|
|
2394
|
-
* Note: This is a kindof subtype of PromptbookExecutionError because it occurs during the execution of the pipeline
|
|
2395
|
-
*/
|
|
2396
|
-
var TemplateError = /** @class */ (function (_super) {
|
|
2397
|
-
__extends(TemplateError, _super);
|
|
2398
|
-
function TemplateError(message) {
|
|
2399
|
-
var _this = _super.call(this, message) || this;
|
|
2400
|
-
_this.name = 'TemplateError';
|
|
2401
|
-
Object.setPrototypeOf(_this, TemplateError.prototype);
|
|
2402
|
-
return _this;
|
|
2403
|
-
}
|
|
2404
|
-
return TemplateError;
|
|
2405
|
-
}(Error));
|
|
2406
|
-
|
|
2407
2449
|
/**
|
|
2408
2450
|
* Replaces parameters in template with values from parameters object
|
|
2409
2451
|
*
|
|
@@ -3175,20 +3217,6 @@
|
|
|
3175
3217
|
return SimplePromptInterfaceTools;
|
|
3176
3218
|
}());
|
|
3177
3219
|
|
|
3178
|
-
/**
|
|
3179
|
-
* This error indicates that the promptbook library cannot be propperly loaded
|
|
3180
|
-
*/
|
|
3181
|
-
var PromptbookLibraryError = /** @class */ (function (_super) {
|
|
3182
|
-
__extends(PromptbookLibraryError, _super);
|
|
3183
|
-
function PromptbookLibraryError(message) {
|
|
3184
|
-
var _this = _super.call(this, message) || this;
|
|
3185
|
-
_this.name = 'PromptbookLibraryError';
|
|
3186
|
-
Object.setPrototypeOf(_this, PromptbookLibraryError.prototype);
|
|
3187
|
-
return _this;
|
|
3188
|
-
}
|
|
3189
|
-
return PromptbookLibraryError;
|
|
3190
|
-
}(Error));
|
|
3191
|
-
|
|
3192
3220
|
/**
|
|
3193
3221
|
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
3194
3222
|
*/
|
|
@@ -3219,34 +3247,6 @@
|
|
|
3219
3247
|
return value;
|
|
3220
3248
|
}
|
|
3221
3249
|
|
|
3222
|
-
/**
|
|
3223
|
-
* This error indicates that promptbook not found in the library
|
|
3224
|
-
*/
|
|
3225
|
-
var PromptbookNotFoundError = /** @class */ (function (_super) {
|
|
3226
|
-
__extends(PromptbookNotFoundError, _super);
|
|
3227
|
-
function PromptbookNotFoundError(message) {
|
|
3228
|
-
var _this = _super.call(this, message) || this;
|
|
3229
|
-
_this.name = 'PromptbookNotFoundError';
|
|
3230
|
-
Object.setPrototypeOf(_this, PromptbookNotFoundError.prototype);
|
|
3231
|
-
return _this;
|
|
3232
|
-
}
|
|
3233
|
-
return PromptbookNotFoundError;
|
|
3234
|
-
}(Error));
|
|
3235
|
-
|
|
3236
|
-
/**
|
|
3237
|
-
* This error indicates errors in referencing promptbooks between each other
|
|
3238
|
-
*/
|
|
3239
|
-
var PromptbookReferenceError = /** @class */ (function (_super) {
|
|
3240
|
-
__extends(PromptbookReferenceError, _super);
|
|
3241
|
-
function PromptbookReferenceError(message) {
|
|
3242
|
-
var _this = _super.call(this, message) || this;
|
|
3243
|
-
_this.name = 'PromptbookReferenceError';
|
|
3244
|
-
Object.setPrototypeOf(_this, PromptbookReferenceError.prototype);
|
|
3245
|
-
return _this;
|
|
3246
|
-
}
|
|
3247
|
-
return PromptbookReferenceError;
|
|
3248
|
-
}(Error));
|
|
3249
|
-
|
|
3250
3250
|
/**
|
|
3251
3251
|
* Library of promptbooks that groups together promptbooks for an application.
|
|
3252
3252
|
* This implementation is a very thin wrapper around the Array / Map of promptbooks.
|
|
@@ -4119,10 +4119,19 @@
|
|
|
4119
4119
|
exports.CallbackInterfaceTools = CallbackInterfaceTools;
|
|
4120
4120
|
exports.ExecutionReportStringOptionsDefaults = ExecutionReportStringOptionsDefaults;
|
|
4121
4121
|
exports.ExecutionTypes = ExecutionTypes;
|
|
4122
|
+
exports.ExpectError = ExpectError;
|
|
4122
4123
|
exports.MultipleLlmExecutionTools = MultipleLlmExecutionTools;
|
|
4123
4124
|
exports.PROMPTBOOK_VERSION = PROMPTBOOK_VERSION;
|
|
4125
|
+
exports.PromptbookExecutionError = PromptbookExecutionError;
|
|
4126
|
+
exports.PromptbookLibraryError = PromptbookLibraryError;
|
|
4127
|
+
exports.PromptbookLogicError = PromptbookLogicError;
|
|
4128
|
+
exports.PromptbookNotFoundError = PromptbookNotFoundError;
|
|
4129
|
+
exports.PromptbookReferenceError = PromptbookReferenceError;
|
|
4130
|
+
exports.PromptbookSyntaxError = PromptbookSyntaxError;
|
|
4124
4131
|
exports.SimplePromptInterfaceTools = SimplePromptInterfaceTools;
|
|
4125
4132
|
exports.SimplePromptbookLibrary = SimplePromptbookLibrary;
|
|
4133
|
+
exports.TemplateError = TemplateError;
|
|
4134
|
+
exports.UnexpectedError = UnexpectedError;
|
|
4126
4135
|
exports.assertsExecutionSuccessful = assertsExecutionSuccessful;
|
|
4127
4136
|
exports.checkExpectations = checkExpectations;
|
|
4128
4137
|
exports.createPromptbookExecutor = createPromptbookExecutor;
|