@promptbook/node 0.72.0-33 → 0.72.0-34

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 CHANGED
@@ -56,15 +56,15 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
56
56
 
57
57
 
58
58
 
59
- If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
59
+ If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 3, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
60
60
 
61
- But often you will struggle with the limitations of LLMs, such as hallucinations, off-topic responses, poor quality output, language drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses. When this happens, you generally have three options:
61
+ But often you will struggle with the **limitations of LLMs**, such as **hallucinations, off-topic responses, poor quality output, language and prompt drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses**. When this happens, you generally have three options:
62
62
 
63
63
  1. **Fine-tune** the model to your specifications or even train your own.
64
64
  2. **Prompt-engineer** the prompt to the best shape you can achieve.
65
65
  3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
66
66
 
67
- In all of these situations, but especially in 3., the Promptbook library can make your life easier.
67
+ In all of these situations, but especially in 3., the **✨ Promptbook can make your life waaaaaaaaaay easier**.
68
68
 
69
69
  - [**Separates concerns**](https://github.com/webgptorg/promptbook/discussions/32) between prompt-engineer and programmer, between code files and prompt files, and between prompts and their execution logic.
70
70
  - Establishes a [**common format `.ptbk.md`**](https://github.com/webgptorg/promptbook/discussions/85) that can be used to describe your prompt business logic without having to write code or deal with the technicalities of LLMs.
package/esm/index.es.js CHANGED
@@ -18,7 +18,7 @@ import sha256 from 'crypto-js/sha256';
18
18
  /**
19
19
  * The version of the Promptbook library
20
20
  */
21
- var PROMPTBOOK_VERSION = '0.72.0-32';
21
+ var PROMPTBOOK_VERSION = '0.72.0-33';
22
22
  // TODO: [main] !!!! List here all the versions and annotate + put into script
23
23
 
24
24
  /*! *****************************************************************************
@@ -8218,16 +8218,25 @@ var exec$1 = promisify(exec$2);
8218
8218
  function locateAppOnLinux(_a) {
8219
8219
  var appName = _a.appName, linuxWhich = _a.linuxWhich;
8220
8220
  return __awaiter(this, void 0, void 0, function () {
8221
- var _b, stderr, stdout;
8221
+ var _b, stderr, stdout, error_1;
8222
8222
  return __generator(this, function (_c) {
8223
8223
  switch (_c.label) {
8224
- case 0: return [4 /*yield*/, exec$1("which ".concat(linuxWhich))];
8224
+ case 0:
8225
+ _c.trys.push([0, 2, , 3]);
8226
+ return [4 /*yield*/, exec$1("which ".concat(linuxWhich))];
8225
8227
  case 1:
8226
8228
  _b = _c.sent(), stderr = _b.stderr, stdout = _b.stdout;
8227
8229
  if (!stderr && stdout) {
8228
8230
  return [2 /*return*/, stdout.trim()];
8229
8231
  }
8230
8232
  throw new Error("Can not locate app ".concat(appName, " on Linux.\n ").concat(stderr));
8233
+ case 2:
8234
+ error_1 = _c.sent();
8235
+ if (!(error_1 instanceof Error)) {
8236
+ throw error_1;
8237
+ }
8238
+ return [2 /*return*/, null];
8239
+ case 3: return [2 /*return*/];
8231
8240
  }
8232
8241
  });
8233
8242
  });
@@ -8303,10 +8312,11 @@ var exec = promisify(exec$2);
8303
8312
  function locateAppOnMacOs(_a) {
8304
8313
  var appName = _a.appName, macOsName = _a.macOsName;
8305
8314
  return __awaiter(this, void 0, void 0, function () {
8306
- var toExec, regPath, altPath, _b, stderr, stdout;
8315
+ var toExec, regPath, altPath, _b, stderr, stdout, error_1;
8307
8316
  return __generator(this, function (_c) {
8308
8317
  switch (_c.label) {
8309
8318
  case 0:
8319
+ _c.trys.push([0, 6, , 7]);
8310
8320
  toExec = "/Contents/MacOS/".concat(macOsName);
8311
8321
  regPath = "/Applications/".concat(macOsName, ".app") + toExec;
8312
8322
  altPath = userhome(regPath.slice(1));
@@ -8327,6 +8337,13 @@ function locateAppOnMacOs(_a) {
8327
8337
  return [2 /*return*/, stdout.trim() + toExec];
8328
8338
  }
8329
8339
  throw new Error("Can not locate app ".concat(appName, " on macOS.\n ").concat(stderr));
8340
+ case 6:
8341
+ error_1 = _c.sent();
8342
+ if (!(error_1 instanceof Error)) {
8343
+ throw error_1;
8344
+ }
8345
+ return [2 /*return*/, null];
8346
+ case 7: return [2 /*return*/];
8330
8347
  }
8331
8348
  });
8332
8349
  });
@@ -8344,11 +8361,12 @@ function locateAppOnMacOs(_a) {
8344
8361
  function locateAppOnWindows(_a) {
8345
8362
  var appName = _a.appName, windowsSuffix = _a.windowsSuffix;
8346
8363
  return __awaiter(this, void 0, void 0, function () {
8347
- var prefixes, prefixes_1, prefixes_1_1, prefix, path, e_1_1;
8364
+ var prefixes, prefixes_1, prefixes_1_1, prefix, path, e_1_1, error_1;
8348
8365
  var e_1, _b;
8349
8366
  return __generator(this, function (_c) {
8350
8367
  switch (_c.label) {
8351
8368
  case 0:
8369
+ _c.trys.push([0, 9, , 10]);
8352
8370
  prefixes = [
8353
8371
  process.env.LOCALAPPDATA,
8354
8372
  join(process.env.LOCALAPPDATA || '', 'Programs'),
@@ -8385,6 +8403,13 @@ function locateAppOnWindows(_a) {
8385
8403
  finally { if (e_1) throw e_1.error; }
8386
8404
  return [7 /*endfinally*/];
8387
8405
  case 8: throw new Error("Can not locate app ".concat(appName, " on Windows."));
8406
+ case 9:
8407
+ error_1 = _c.sent();
8408
+ if (!(error_1 instanceof Error)) {
8409
+ throw error_1;
8410
+ }
8411
+ return [2 /*return*/, null];
8412
+ case 10: return [2 /*return*/];
8388
8413
  }
8389
8414
  });
8390
8415
  });
@@ -8491,9 +8516,9 @@ function $provideExecutablesForNode(options) {
8491
8516
  _d = {};
8492
8517
  return [4 /*yield*/, locatePandoc()];
8493
8518
  case 1:
8494
- _d.pandocPath = _e.sent();
8519
+ _d.pandocPath = (_e.sent()) || undefined;
8495
8520
  return [4 /*yield*/, locateLibreoffice()];
8496
- case 2: return [2 /*return*/, (_d.libreOfficePath = _e.sent(),
8521
+ case 2: return [2 /*return*/, (_d.libreOfficePath = (_e.sent()) || undefined,
8497
8522
  _d)];
8498
8523
  }
8499
8524
  });