koishi-plugin-chatluna-google-gemini-adapter 1.2.18 → 1.2.19

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 CHANGED
@@ -421,11 +421,14 @@ var GeminiRequester = class extends import_api.ModelRequester {
421
421
  }
422
422
  for (const candidate of transformValue.candidates) {
423
423
  const parts = candidate.content?.parts;
424
- if ((parts == null || parts.length < 1) && candidate.finishReason !== "STOP") {
424
+ if ((parts == null || parts.length < 1) && candidate.finishReason !== "STOP" && candidate.content === null) {
425
425
  throw new Error(chunk);
426
426
  } else if (candidate.finishReason === "STOP" && parts == null) {
427
427
  continue;
428
428
  }
429
+ if (parts == null) {
430
+ continue;
431
+ }
429
432
  for (const part of parts) {
430
433
  controller.enqueue(part);
431
434
  }
package/lib/index.mjs CHANGED
@@ -414,11 +414,14 @@ var GeminiRequester = class extends ModelRequester {
414
414
  }
415
415
  for (const candidate of transformValue.candidates) {
416
416
  const parts = candidate.content?.parts;
417
- if ((parts == null || parts.length < 1) && candidate.finishReason !== "STOP") {
417
+ if ((parts == null || parts.length < 1) && candidate.finishReason !== "STOP" && candidate.content === null) {
418
418
  throw new Error(chunk);
419
419
  } else if (candidate.finishReason === "STOP" && parts == null) {
420
420
  continue;
421
421
  }
422
+ if (parts == null) {
423
+ continue;
424
+ }
422
425
  for (const part of parts) {
423
426
  controller.enqueue(part);
424
427
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna-google-gemini-adapter",
3
3
  "description": "google-gemini adapter for chatluna",
4
- "version": "1.2.18",
4
+ "version": "1.2.19",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "peerDependencies": {
75
75
  "koishi": "^4.18.7",
76
- "koishi-plugin-chatluna": "^1.3.0-alpha.11"
76
+ "koishi-plugin-chatluna": "^1.3.0-alpha.13"
77
77
  },
78
78
  "koishi": {
79
79
  "description": {