@promptbook/core 0.72.0-1 → 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/esm/index.es.js CHANGED
@@ -11,7 +11,7 @@ import moment from 'moment';
11
11
  /**
12
12
  * The version of the Promptbook library
13
13
  */
14
- var PROMPTBOOK_VERSION = '0.72.0-0';
14
+ var PROMPTBOOK_VERSION = '0.72.0-2';
15
15
  // TODO:[main] !!!! List here all the versions and annotate + put into script
16
16
 
17
17
  /*! *****************************************************************************
@@ -8819,13 +8819,14 @@ var _AnthropicClaudeMetadataRegistration = $llmToolsMetadataRegister.register({
8819
8819
  };
8820
8820
  },
8821
8821
  createConfigurationFromEnv: function (env) {
8822
+ // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
8822
8823
  if (typeof env.ANTHROPIC_CLAUDE_API_KEY === 'string') {
8823
8824
  return {
8824
8825
  title: 'Claude (from env)',
8825
8826
  packageName: '@promptbook/anthropic-claude',
8826
8827
  className: 'AnthropicClaudeExecutionTools',
8827
8828
  options: {
8828
- apiKey: process.env.ANTHROPIC_CLAUDE_API_KEY,
8829
+ apiKey: env.ANTHROPIC_CLAUDE_API_KEY,
8829
8830
  },
8830
8831
  };
8831
8832
  }
@@ -8856,6 +8857,7 @@ var _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
8856
8857
  };
8857
8858
  },
8858
8859
  createConfigurationFromEnv: function (env) {
8860
+ // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
8859
8861
  if (typeof env.AZUREOPENAI_RESOURCE_NAME === 'string' &&
8860
8862
  typeof env.AZUREOPENAI_DEPLOYMENT_NAME === 'string' &&
8861
8863
  typeof env.AZUREOPENAI_API_KEY === 'string') {
@@ -8873,7 +8875,7 @@ var _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
8873
8875
  else if (typeof env.AZUREOPENAI_RESOURCE_NAME === 'string' ||
8874
8876
  typeof env.AZUREOPENAI_DEPLOYMENT_NAME === 'string' ||
8875
8877
  typeof env.AZUREOPENAI_API_KEY === 'string') {
8876
- throw new Error(spaceTrim("\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 ")));
8878
+ throw new Error(spaceTrim("\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 ")));
8877
8879
  }
8878
8880
  return null;
8879
8881
  },
@@ -8902,13 +8904,14 @@ var _OpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
8902
8904
  };
8903
8905
  },
8904
8906
  createConfigurationFromEnv: function (env) {
8907
+ // Note: Note using `process.env` BUT `env` to pass in the environment variables dynamically
8905
8908
  if (typeof env.OPENAI_API_KEY === 'string') {
8906
8909
  return {
8907
8910
  title: 'Open AI (from env)',
8908
8911
  packageName: '@promptbook/openai',
8909
8912
  className: 'OpenAiExecutionTools',
8910
8913
  options: {
8911
- apiKey: process.env.OPENAI_API_KEY,
8914
+ apiKey: env.OPENAI_API_KEY,
8912
8915
  },
8913
8916
  };
8914
8917
  }
@@ -8934,21 +8937,29 @@ var _OpenAiAssistantMetadataRegistration = $llmToolsMetadataRegister.register({
8934
8937
  className: 'OpenAiAssistantExecutionTools',
8935
8938
  options: {
8936
8939
  apiKey: 'sk-',
8940
+ assistantId: 'asst_',
8937
8941
  },
8938
8942
  };
8939
8943
  },
8940
8944
  createConfigurationFromEnv: function (env) {
8941
- if (typeof env.OPENAI_API_KEY === 'string') {
8945
+ // TODO: Maybe auto-configure (multiple) assistants from env variables
8946
+ keepUnused(env);
8947
+ return null;
8948
+ /*
8949
+ if (typeof env.OPENAI_API_KEY === 'string' || typeof env.OPENAI_XXX === 'string') {
8942
8950
  return {
8943
8951
  title: 'Open AI Assistant (from env)',
8944
8952
  packageName: '@promptbook/openai',
8945
8953
  className: 'OpenAiAssistantExecutionTools',
8946
8954
  options: {
8947
- apiKey: process.env.OPENAI_API_KEY,
8955
+ apiKey: env.OPENAI_API_KEY!,
8956
+ assistantId: env.OPENAI_XXX!
8948
8957
  },
8949
8958
  };
8950
8959
  }
8960
+
8951
8961
  return null;
8962
+ */
8952
8963
  },
8953
8964
  });
8954
8965