koishi-plugin-chatluna-google-gemini-adapter 1.3.12 → 1.3.14

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
@@ -350,13 +350,14 @@ function prepareModelConfig(params, pluginConfig) {
350
350
  thinkingBudget = void 0;
351
351
  const match = model.match(/-(low|medium|high|tiny)-thinking/);
352
352
  if (match && match[1]) {
353
- model = model.replace(`-${match[1]}-thinking`, "");
354
- }
355
- if (match && match[1] !== "tiny") {
356
- thinkingLevel = match[1];
357
- } else if (match[1] === "tiny") {
358
- thinkingLevel = void 0;
359
- thinkingBudget = 128;
353
+ const level = match[1];
354
+ model = model.replace(`-${level}-thinking`, "");
355
+ if (level === "tiny") {
356
+ thinkingLevel = void 0;
357
+ thinkingBudget = 128;
358
+ } else {
359
+ thinkingLevel = level;
360
+ }
360
361
  } else {
361
362
  thinkingLevel = "THINKING_LEVEL_UNSPECIFIED";
362
363
  }
@@ -371,6 +372,8 @@ function prepareModelConfig(params, pluginConfig) {
371
372
  let imageGeneration = pluginConfig.imageGeneration ?? false;
372
373
  if (imageGeneration) {
373
374
  imageGeneration = params.model.includes("gemini-2.0-flash-exp") || params.model.includes("image");
375
+ thinkingBudget = void 0;
376
+ thinkingLevel = void 0;
374
377
  }
375
378
  return {
376
379
  model,
package/lib/index.mjs CHANGED
@@ -347,13 +347,14 @@ function prepareModelConfig(params, pluginConfig) {
347
347
  thinkingBudget = void 0;
348
348
  const match = model.match(/-(low|medium|high|tiny)-thinking/);
349
349
  if (match && match[1]) {
350
- model = model.replace(`-${match[1]}-thinking`, "");
351
- }
352
- if (match && match[1] !== "tiny") {
353
- thinkingLevel = match[1];
354
- } else if (match[1] === "tiny") {
355
- thinkingLevel = void 0;
356
- thinkingBudget = 128;
350
+ const level = match[1];
351
+ model = model.replace(`-${level}-thinking`, "");
352
+ if (level === "tiny") {
353
+ thinkingLevel = void 0;
354
+ thinkingBudget = 128;
355
+ } else {
356
+ thinkingLevel = level;
357
+ }
357
358
  } else {
358
359
  thinkingLevel = "THINKING_LEVEL_UNSPECIFIED";
359
360
  }
@@ -368,6 +369,8 @@ function prepareModelConfig(params, pluginConfig) {
368
369
  let imageGeneration = pluginConfig.imageGeneration ?? false;
369
370
  if (imageGeneration) {
370
371
  imageGeneration = params.model.includes("gemini-2.0-flash-exp") || params.model.includes("image");
372
+ thinkingBudget = void 0;
373
+ thinkingLevel = void 0;
371
374
  }
372
375
  return {
373
376
  model,
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.3.12",
4
+ "version": "1.3.14",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",