backend-manager 3.2.73 → 3.2.74
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
|
@@ -2,6 +2,7 @@ const fetch = require('wonderful-fetch');
|
|
|
2
2
|
const jetpack = require('fs-jetpack');
|
|
3
3
|
const powertools = require('node-powertools');
|
|
4
4
|
const _ = require('lodash');
|
|
5
|
+
const JSON5 = require('json5');
|
|
5
6
|
|
|
6
7
|
const TOKEN_COST_TABLE = {
|
|
7
8
|
// Nov 6th, 2023
|
|
@@ -234,7 +235,7 @@ OpenAI.prototype.request = function (options) {
|
|
|
234
235
|
await _request('chatgpt', options)
|
|
235
236
|
.then((r) => {
|
|
236
237
|
try {
|
|
237
|
-
const content = options.response === 'json' ?
|
|
238
|
+
const content = options.response === 'json' ? JSON5.parse(r) : r;
|
|
238
239
|
|
|
239
240
|
return resolve({
|
|
240
241
|
content: content,
|