@promptbook/cli 0.86.6 → 0.86.8
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 +7 -4
- package/esm/index.es.js.map +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +7 -4
- package/umd/index.umd.js.map +1 -1
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
* @generated
|
|
55
55
|
* @see https://github.com/webgptorg/promptbook
|
|
56
56
|
*/
|
|
57
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.86.
|
|
57
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.86.8';
|
|
58
58
|
/**
|
|
59
59
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
60
60
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1516,9 +1516,11 @@
|
|
|
1516
1516
|
FileCacheStorage.prototype.getFilenameForKey = function (key) {
|
|
1517
1517
|
// TODO: [👬] DRY
|
|
1518
1518
|
var name = titleToName(key);
|
|
1519
|
+
var nameStart = name.split('-', 2)[0] || 'unnamed';
|
|
1519
1520
|
var hash = sha256__default["default"](hexEncoder__default["default"].parse(name)).toString( /* hex */);
|
|
1520
1521
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
1521
|
-
return path.join.apply(void 0, __spreadArray(__spreadArray([this.options.rootFolderPath
|
|
1522
|
+
return path.join.apply(void 0, __spreadArray(__spreadArray([this.options.rootFolderPath,
|
|
1523
|
+
nameStart], __read(nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */)), false), ["".concat(name.substring(0, MAX_FILENAME_LENGTH), ".json")], false));
|
|
1522
1524
|
};
|
|
1523
1525
|
/**
|
|
1524
1526
|
* @@@ Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
|
|
@@ -1704,13 +1706,14 @@
|
|
|
1704
1706
|
return /* not await */ llmTools.listModels();
|
|
1705
1707
|
} });
|
|
1706
1708
|
var callCommonModel = function (prompt) { return __awaiter(_this, void 0, void 0, function () {
|
|
1707
|
-
var key, cacheItem, _a, promptResult, _b;
|
|
1709
|
+
var parameters, content, modelRequirements, key, cacheItem, _a, promptResult, _b;
|
|
1708
1710
|
return __generator(this, function (_c) {
|
|
1709
1711
|
switch (_c.label) {
|
|
1710
1712
|
case 0:
|
|
1713
|
+
parameters = prompt.parameters, content = prompt.content, modelRequirements = prompt.modelRequirements;
|
|
1711
1714
|
key = titleToName(prompt.title.substring(0, MAX_FILENAME_LENGTH - 10) +
|
|
1712
1715
|
'-' +
|
|
1713
|
-
sha256__default["default"](hexEncoder__default["default"].parse(JSON.stringify(
|
|
1716
|
+
sha256__default["default"](hexEncoder__default["default"].parse(JSON.stringify({ parameters: parameters, content: content, modelRequirements: modelRequirements }))).toString( /* hex */));
|
|
1714
1717
|
if (!!isCacheReloaded) return [3 /*break*/, 2];
|
|
1715
1718
|
return [4 /*yield*/, storage.getItem(key)];
|
|
1716
1719
|
case 1:
|