backend-manager 3.2.74 → 3.2.75

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.74",
3
+ "version": "3.2.75",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -226,6 +226,7 @@ OpenAI.prototype.request = function (options) {
226
226
  })
227
227
  .catch((e) => e);
228
228
 
229
+ // Check for moderation flag
229
230
  if (moderation.flagged) {
230
231
  return reject(assistant.errorify(`This request is inappropriate`, {code: 451}));
231
232
  }
@@ -235,8 +236,10 @@ OpenAI.prototype.request = function (options) {
235
236
  await _request('chatgpt', options)
236
237
  .then((r) => {
237
238
  try {
239
+ // Parse JSON response if needed
238
240
  const content = options.response === 'json' ? JSON5.parse(r) : r;
239
241
 
242
+ // Return
240
243
  return resolve({
241
244
  content: content,
242
245
  tokens: self.tokens,
@@ -245,6 +248,7 @@ OpenAI.prototype.request = function (options) {
245
248
  } catch (e) {
246
249
  assistant.warn('Error parsing response', r, e);
247
250
 
251
+ // Return
248
252
  return reject(e);
249
253
  }
250
254
  })