backend-manager 3.2.164 → 3.2.165

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": "backend-manager",
3
- "version": "3.2.164",
3
+ "version": "3.2.165",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -77,4 +77,4 @@
77
77
  "wonderful-log": "^1.0.5",
78
78
  "yargs": "^17.7.2"
79
79
  }
80
- }
80
+ }
@@ -114,7 +114,7 @@ function OpenAI(assistant, key) {
114
114
  self.assistant = assistant;
115
115
  self.Manager = assistant.Manager;
116
116
  self.user = assistant.user;
117
- self.key = key;
117
+ self.key = key || self.Manager.config?.openai?.key;
118
118
 
119
119
  self.tokens = {
120
120
  total: {
@@ -256,7 +256,7 @@ OpenAI.prototype.request = function (options) {
256
256
  tries: 1,
257
257
  timeout: options.timeout,
258
258
  headers: {
259
- 'Authorization': `Bearer ${Manager.config.openai.key}`,
259
+ 'Authorization': `Bearer ${self.key}`,
260
260
  },
261
261
  body: {},
262
262
  }