koishi-plugin-chatluna-google-gemini-adapter 1.2.4 → 1.2.6

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
@@ -397,7 +397,7 @@ var GeminiRequester = class extends import_api.ModelRequester {
397
397
  "gemini-2.0-flash-exp"
398
398
  ) && this._pluginConfig.imageGeneration ? ["TEXT", "IMAGE"] : void 0,
399
399
  thinkingConfig: enabledThinking != null || this._pluginConfig.includeThoughts ? {
400
- thinkingBudget: enabledThinking ? this._pluginConfig.thinkingBudget ?? -1 : 0,
400
+ thinkingBudget: enabledThinking ? this._pluginConfig.thinkingBudget ?? -1 : -1,
401
401
  includeThoughts: this._pluginConfig.includeThoughts
402
402
  } : void 0
403
403
  },
@@ -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) {
@@ -708,7 +711,7 @@ var GeminiClient = class extends import_client.PlatformModelAndEmbeddingsClient
708
711
  functionCall: !model.name.includes("vision"),
709
712
  supportMode: ["all"]
710
713
  };
711
- if (model.name.includes("gemini-2.5")) {
714
+ if (model.name.includes("gemini-2.5") && !model.name.includes("pro")) {
712
715
  if (!model.name.includes("-thinking")) {
713
716
  models.push(
714
717
  { ...info, name: model.name + "-no-thinking" },
@@ -811,7 +814,7 @@ var Config3 = import_koishi.Schema.intersect([
811
814
  googleSearch: import_koishi.Schema.boolean().default(false),
812
815
  codeExecution: import_koishi.Schema.boolean().default(false),
813
816
  urlContext: import_koishi.Schema.boolean().default(false),
814
- thinkingBudget: import_koishi.Schema.number().min(-1).max(24576).step(16).default(-1),
817
+ thinkingBudget: import_koishi.Schema.number().min(128).max(24576).step(16).default(128),
815
818
  includeThoughts: import_koishi.Schema.boolean().default(false),
816
819
  imageGeneration: import_koishi.Schema.boolean().default(false),
817
820
  groundingContentDisplay: import_koishi.Schema.boolean().default(false),
package/lib/index.mjs CHANGED
@@ -380,7 +380,7 @@ var GeminiRequester = class extends ModelRequester {
380
380
  "gemini-2.0-flash-exp"
381
381
  ) && this._pluginConfig.imageGeneration ? ["TEXT", "IMAGE"] : void 0,
382
382
  thinkingConfig: enabledThinking != null || this._pluginConfig.includeThoughts ? {
383
- thinkingBudget: enabledThinking ? this._pluginConfig.thinkingBudget ?? -1 : 0,
383
+ thinkingBudget: enabledThinking ? this._pluginConfig.thinkingBudget ?? -1 : -1,
384
384
  includeThoughts: this._pluginConfig.includeThoughts
385
385
  } : void 0
386
386
  },
@@ -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) {
@@ -691,7 +694,7 @@ var GeminiClient = class extends PlatformModelAndEmbeddingsClient {
691
694
  functionCall: !model.name.includes("vision"),
692
695
  supportMode: ["all"]
693
696
  };
694
- if (model.name.includes("gemini-2.5")) {
697
+ if (model.name.includes("gemini-2.5") && !model.name.includes("pro")) {
695
698
  if (!model.name.includes("-thinking")) {
696
699
  models.push(
697
700
  { ...info, name: model.name + "-no-thinking" },
@@ -794,7 +797,7 @@ var Config3 = Schema.intersect([
794
797
  googleSearch: Schema.boolean().default(false),
795
798
  codeExecution: Schema.boolean().default(false),
796
799
  urlContext: Schema.boolean().default(false),
797
- thinkingBudget: Schema.number().min(-1).max(24576).step(16).default(-1),
800
+ thinkingBudget: Schema.number().min(128).max(24576).step(16).default(128),
798
801
  includeThoughts: Schema.boolean().default(false),
799
802
  imageGeneration: Schema.boolean().default(false),
800
803
  groundingContentDisplay: Schema.boolean().default(false),
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.4",
4
+ "version": "1.2.6",
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.3"
75
+ "koishi-plugin-chatluna": "^1.3.0-alpha.4"
76
76
  },
77
77
  "koishi": {
78
78
  "description": {