@promptbook/core 0.72.0-2 → 0.72.0-3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/core",
3
- "version": "0.72.0-2",
3
+ "version": "0.72.0-3",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -16,7 +16,7 @@
16
16
  /**
17
17
  * The version of the Promptbook library
18
18
  */
19
- var PROMPTBOOK_VERSION = '0.72.0-1';
19
+ var PROMPTBOOK_VERSION = '0.72.0-2';
20
20
  // TODO:[main] !!!! List here all the versions and annotate + put into script
21
21
 
22
22
  /*! *****************************************************************************
@@ -8824,13 +8824,14 @@
8824
8824
  };
8825
8825
  },
8826
8826
  createConfigurationFromEnv: function (env) {
8827
+ // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
8827
8828
  if (typeof env.ANTHROPIC_CLAUDE_API_KEY === 'string') {
8828
8829
  return {
8829
8830
  title: 'Claude (from env)',
8830
8831
  packageName: '@promptbook/anthropic-claude',
8831
8832
  className: 'AnthropicClaudeExecutionTools',
8832
8833
  options: {
8833
- apiKey: process.env.ANTHROPIC_CLAUDE_API_KEY,
8834
+ apiKey: env.ANTHROPIC_CLAUDE_API_KEY,
8834
8835
  },
8835
8836
  };
8836
8837
  }
@@ -8861,6 +8862,7 @@
8861
8862
  };
8862
8863
  },
8863
8864
  createConfigurationFromEnv: function (env) {
8865
+ // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
8864
8866
  if (typeof env.AZUREOPENAI_RESOURCE_NAME === 'string' &&
8865
8867
  typeof env.AZUREOPENAI_DEPLOYMENT_NAME === 'string' &&
8866
8868
  typeof env.AZUREOPENAI_API_KEY === 'string') {
@@ -8878,7 +8880,7 @@
8878
8880
  else if (typeof env.AZUREOPENAI_RESOURCE_NAME === 'string' ||
8879
8881
  typeof env.AZUREOPENAI_DEPLOYMENT_NAME === 'string' ||
8880
8882
  typeof env.AZUREOPENAI_API_KEY === 'string') {
8881
- throw new Error(spaceTrim__default["default"]("\n You must provide all of the following environment variables:\n \n - AZUREOPENAI_RESOURCE_NAME (".concat(typeof env.AZUREOPENAI_RESOURCE_NAME === 'string' ? 'defined' : 'not defined', ")\n - AZUREOPENAI_DEPLOYMENT_NAME (").concat(typeof env.AZUREOPENAI_DEPLOYMENT_NAME === 'string' ? 'defined' : 'not defined', ")\n - AZUREOPENAI_API_KEY (").concat(typeof env.AZUREOPENAI_API_KEY === 'string' ? 'defined' : 'not defined', ") \n ")));
8883
+ throw new Error(spaceTrim__default["default"]("\n You must provide all of the following environment variables:\n\n - AZUREOPENAI_RESOURCE_NAME (".concat(typeof env.AZUREOPENAI_RESOURCE_NAME === 'string' ? 'defined' : 'not defined', ")\n - AZUREOPENAI_DEPLOYMENT_NAME (").concat(typeof env.AZUREOPENAI_DEPLOYMENT_NAME === 'string' ? 'defined' : 'not defined', ")\n - AZUREOPENAI_API_KEY (").concat(typeof env.AZUREOPENAI_API_KEY === 'string' ? 'defined' : 'not defined', ")\n ")));
8882
8884
  }
8883
8885
  return null;
8884
8886
  },
@@ -8907,13 +8909,14 @@
8907
8909
  };
8908
8910
  },
8909
8911
  createConfigurationFromEnv: function (env) {
8912
+ // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
8910
8913
  if (typeof env.OPENAI_API_KEY === 'string') {
8911
8914
  return {
8912
8915
  title: 'Open AI (from env)',
8913
8916
  packageName: '@promptbook/openai',
8914
8917
  className: 'OpenAiExecutionTools',
8915
8918
  options: {
8916
- apiKey: process.env.OPENAI_API_KEY,
8919
+ apiKey: env.OPENAI_API_KEY,
8917
8920
  },
8918
8921
  };
8919
8922
  }
@@ -8939,21 +8942,29 @@
8939
8942
  className: 'OpenAiAssistantExecutionTools',
8940
8943
  options: {
8941
8944
  apiKey: 'sk-',
8945
+ assistantId: 'asst_',
8942
8946
  },
8943
8947
  };
8944
8948
  },
8945
8949
  createConfigurationFromEnv: function (env) {
8946
- if (typeof env.OPENAI_API_KEY === 'string') {
8950
+ // TODO: Maybe auto-configure (multiple) assistants from env variables
8951
+ keepUnused(env);
8952
+ return null;
8953
+ /*
8954
+ if (typeof env.OPENAI_API_KEY === 'string' || typeof env.OPENAI_XXX === 'string') {
8947
8955
  return {
8948
8956
  title: 'Open AI Assistant (from env)',
8949
8957
  packageName: '@promptbook/openai',
8950
8958
  className: 'OpenAiAssistantExecutionTools',
8951
8959
  options: {
8952
- apiKey: process.env.OPENAI_API_KEY,
8960
+ apiKey: env.OPENAI_API_KEY!,
8961
+ assistantId: env.OPENAI_XXX!
8953
8962
  },
8954
8963
  };
8955
8964
  }
8965
+
8956
8966
  return null;
8967
+ */
8957
8968
  },
8958
8969
  });
8959
8970