koishi-plugin-chatluna-google-gemini-adapter 1.2.3 → 1.2.5

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
@@ -425,6 +425,9 @@ var GeminiRequester = class extends import_api.ModelRequester {
425
425
  });
426
426
  const transformToChatPartStream = new TransformStream({
427
427
  async transform(chunk, controller) {
428
+ if (chunk === "undefined") {
429
+ return;
430
+ }
428
431
  const parsedValue = JSON.parse(chunk);
429
432
  const transformValue = parsedValue;
430
433
  if (!transformValue.candidates) {
@@ -476,7 +479,7 @@ var GeminiRequester = class extends import_api.ModelRequester {
476
479
  }
477
480
  const deltaFunctionCall = chatFunctionCallingPart?.functionCall;
478
481
  if (deltaFunctionCall) {
479
- let args = deltaFunctionCall.args?.input ?? deltaFunctionCall.args;
482
+ let args = deltaFunctionCall.args;
480
483
  try {
481
484
  let parsedArgs = JSON.parse(args);
482
485
  if (typeof parsedArgs !== "string") {
package/lib/index.mjs CHANGED
@@ -408,6 +408,9 @@ var GeminiRequester = class extends ModelRequester {
408
408
  });
409
409
  const transformToChatPartStream = new TransformStream({
410
410
  async transform(chunk, controller) {
411
+ if (chunk === "undefined") {
412
+ return;
413
+ }
411
414
  const parsedValue = JSON.parse(chunk);
412
415
  const transformValue = parsedValue;
413
416
  if (!transformValue.candidates) {
@@ -459,7 +462,7 @@ var GeminiRequester = class extends ModelRequester {
459
462
  }
460
463
  const deltaFunctionCall = chatFunctionCallingPart?.functionCall;
461
464
  if (deltaFunctionCall) {
462
- let args = deltaFunctionCall.args?.input ?? deltaFunctionCall.args;
465
+ let args = deltaFunctionCall.args;
463
466
  try {
464
467
  let parsedArgs = JSON.parse(args);
465
468
  if (typeof parsedArgs !== "string") {
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.3",
4
+ "version": "1.2.5",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "peerDependencies": {
74
74
  "koishi": "^4.18.7",
75
- "koishi-plugin-chatluna": "^1.3.0-alpha.2"
75
+ "koishi-plugin-chatluna": "^1.3.0-alpha.4"
76
76
  },
77
77
  "koishi": {
78
78
  "description": {