@promptbook/node 0.77.0-3 → 0.77.0-4

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 CHANGED
@@ -26,7 +26,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
26
26
  *
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- var PROMPTBOOK_ENGINE_VERSION = '0.77.0-2';
29
+ var PROMPTBOOK_ENGINE_VERSION = '0.77.0-3';
30
30
  /**
31
31
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
32
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -8921,6 +8921,7 @@ var $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
8921
8921
  * It looks for environment variables:
8922
8922
  * - `process.env.OPENAI_API_KEY`
8923
8923
  * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
8924
+ * - ...
8924
8925
  *
8925
8926
  * @returns @@@
8926
8927
  * @public exported from `@promptbook/node`
@@ -8974,16 +8975,16 @@ function $registeredLlmToolsMessage() {
8974
8975
  * Mixes registered LLM tools from $llmToolsMetadataRegister and $llmToolsRegister
8975
8976
  */
8976
8977
  var all = [];
8977
- var _loop_1 = function (packageName, className) {
8978
+ var _loop_1 = function (packageName, className, envVariables) {
8978
8979
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
8979
8980
  return "continue";
8980
8981
  }
8981
- all.push({ packageName: packageName, className: className });
8982
+ all.push({ packageName: packageName, className: className, envVariables: envVariables });
8982
8983
  };
8983
8984
  try {
8984
8985
  for (var _c = __values($llmToolsMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
8985
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
8986
- _loop_1(packageName, className);
8986
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, envVariables = _e.envVariables;
8987
+ _loop_1(packageName, className, envVariables);
8987
8988
  }
8988
8989
  }
8989
8990
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -9032,7 +9033,7 @@ function $registeredLlmToolsMessage() {
9032
9033
  }
9033
9034
  return spaceTrim$1(function (block) { return "\n Available LLM providers are:\n ".concat(block(metadata
9034
9035
  .map(function (_a, i) {
9035
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
9036
+ var packageName = _a.packageName, className = _a.className, envVariables = _a.envVariables, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
9036
9037
  var more;
9037
9038
  if (just(false)) {
9038
9039
  more = '';
@@ -9054,7 +9055,12 @@ function $registeredLlmToolsMessage() {
9054
9055
  else {
9055
9056
  more = "(unknown state, looks like a unexpected behavior)";
9056
9057
  }
9057
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
9058
+ var envVariablesMessage = '';
9059
+ if (envVariables) {
9060
+ envVariablesMessage = 'Configured by ' + envVariables.join(' + ');
9061
+ }
9062
+ return spaceTrim$1("\n ".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "`\n ").concat(more, "\n ").concat(envVariablesMessage, "\n "));
9063
+ // <- TODO: !!!!!! Is this indented correctly?
9058
9064
  })
9059
9065
  .join('\n')), "\n "); });
9060
9066
  }
@@ -9107,6 +9113,7 @@ function createLlmToolsFromConfiguration(configuration, options) {
9107
9113
  * It looks for environment variables:
9108
9114
  * - `process.env.OPENAI_API_KEY`
9109
9115
  * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
9116
+ * - ...
9110
9117
  *
9111
9118
  * @returns @@@
9112
9119
  * @public exported from `@promptbook/node`