koishi-plugin-chatluna-google-gemini-adapter 1.1.0-alpha.2 → 1.1.0-alpha.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/lib/index.cjs +8 -1
- package/lib/index.mjs +8 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -381,7 +381,14 @@ var GeminiRequester = class extends import_api.ModelRequester {
|
|
|
381
381
|
signal: params.signal
|
|
382
382
|
}
|
|
383
383
|
);
|
|
384
|
-
const
|
|
384
|
+
const rawResponse = await response.text();
|
|
385
|
+
let parsedResponse;
|
|
386
|
+
try {
|
|
387
|
+
parsedResponse = JSON.parse(rawResponse);
|
|
388
|
+
} catch (e) {
|
|
389
|
+
logger.error("error with parse json", e, rawResponse);
|
|
390
|
+
throw new import_error.ChatLunaError(import_error.ChatLunaErrorCode.API_REQUEST_FAILED, e);
|
|
391
|
+
}
|
|
385
392
|
let groundingContent = "";
|
|
386
393
|
let currentGroudingIndex = 0;
|
|
387
394
|
let reasoningContent = "";
|
package/lib/index.mjs
CHANGED
|
@@ -375,7 +375,14 @@ var GeminiRequester = class extends ModelRequester {
|
|
|
375
375
|
signal: params.signal
|
|
376
376
|
}
|
|
377
377
|
);
|
|
378
|
-
const
|
|
378
|
+
const rawResponse = await response.text();
|
|
379
|
+
let parsedResponse;
|
|
380
|
+
try {
|
|
381
|
+
parsedResponse = JSON.parse(rawResponse);
|
|
382
|
+
} catch (e) {
|
|
383
|
+
logger.error("error with parse json", e, rawResponse);
|
|
384
|
+
throw new ChatLunaError(ChatLunaErrorCode.API_REQUEST_FAILED, e);
|
|
385
|
+
}
|
|
379
386
|
let groundingContent = "";
|
|
380
387
|
let currentGroudingIndex = 0;
|
|
381
388
|
let reasoningContent = "";
|
package/package.json
CHANGED