koishi-plugin-chatluna-google-gemini-adapter 1.3.11 → 1.3.13

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
@@ -345,17 +345,22 @@ function prepareModelConfig(params, pluginConfig) {
345
345
  } else if (thinkingBudget >= 0 && thinkingBudget < 128) {
346
346
  thinkingBudget = 128;
347
347
  }
348
- if (model.includes("-thinking") && model.includes("gemini-3.0")) {
348
+ if (model.includes("gemini-3")) {
349
349
  enabledThinking = true;
350
- const match = model.match(/-(low|medium|high)-thinking/);
351
- if (match) {
352
- thinkingLevel = match[1];
353
- model = model.replace(`-${match[1]}-thinking`, "");
350
+ thinkingBudget = void 0;
351
+ const match = model.match(/-(low|medium|high|tiny)-thinking/);
352
+ if (match && match[1]) {
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
+ }
354
361
  } else {
355
362
  thinkingLevel = "THINKING_LEVEL_UNSPECIFIED";
356
- model = model.replace("-thinking", "");
357
363
  }
358
- thinkingBudget = void 0;
359
364
  } else {
360
365
  thinkingLevel = void 0;
361
366
  }
@@ -1020,6 +1025,9 @@ var GeminiClient = class extends import_client.PlatformModelAndEmbeddingsClient
1020
1025
  return logger;
1021
1026
  }
1022
1027
  async refreshModels(config) {
1028
+ const thinkingModel = ["gemini-2.5-pro", "gemini-2.5-flash"];
1029
+ const thinkingLevelModel = ["gemini-3-pro"];
1030
+ const imageResolutionModel = ["gemini-3-pro-image"];
1023
1031
  try {
1024
1032
  const rawModels = await this._requester.getModels(config);
1025
1033
  if (!rawModels.length) {
@@ -1040,9 +1048,6 @@ var GeminiClient = class extends import_client.PlatformModelAndEmbeddingsClient
1040
1048
  import_types2.ModelCapabilities.ToolCall
1041
1049
  ]
1042
1050
  };
1043
- const thinkingModel = ["gemini-2.5-pro", "gemini-2.5-flash"];
1044
- const thinkingLevelModel = ["gemini-3.0-pro"];
1045
- const imageResolutionModel = ["gemini-3.0-pro-image"];
1046
1051
  if (imageResolutionModel.some(
1047
1052
  (name2) => modelNameLower.includes(name2)
1048
1053
  )) {
@@ -1068,6 +1073,8 @@ var GeminiClient = class extends import_client.PlatformModelAndEmbeddingsClient
1068
1073
  )) {
1069
1074
  models.push(
1070
1075
  { ...info, name: model.name + "-low-thinking" },
1076
+ { ...info, name: model.name + "-high-thinking" },
1077
+ { ...info, name: model.name + "-tiny-thinking" },
1071
1078
  info
1072
1079
  );
1073
1080
  } else {
package/lib/index.mjs CHANGED
@@ -342,17 +342,22 @@ function prepareModelConfig(params, pluginConfig) {
342
342
  } else if (thinkingBudget >= 0 && thinkingBudget < 128) {
343
343
  thinkingBudget = 128;
344
344
  }
345
- if (model.includes("-thinking") && model.includes("gemini-3.0")) {
345
+ if (model.includes("gemini-3")) {
346
346
  enabledThinking = true;
347
- const match = model.match(/-(low|medium|high)-thinking/);
348
- if (match) {
349
- thinkingLevel = match[1];
350
- model = model.replace(`-${match[1]}-thinking`, "");
347
+ thinkingBudget = void 0;
348
+ const match = model.match(/-(low|medium|high|tiny)-thinking/);
349
+ if (match && match[1]) {
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
+ }
351
358
  } else {
352
359
  thinkingLevel = "THINKING_LEVEL_UNSPECIFIED";
353
- model = model.replace("-thinking", "");
354
360
  }
355
- thinkingBudget = void 0;
356
361
  } else {
357
362
  thinkingLevel = void 0;
358
363
  }
@@ -1017,6 +1022,9 @@ var GeminiClient = class extends PlatformModelAndEmbeddingsClient {
1017
1022
  return logger;
1018
1023
  }
1019
1024
  async refreshModels(config) {
1025
+ const thinkingModel = ["gemini-2.5-pro", "gemini-2.5-flash"];
1026
+ const thinkingLevelModel = ["gemini-3-pro"];
1027
+ const imageResolutionModel = ["gemini-3-pro-image"];
1020
1028
  try {
1021
1029
  const rawModels = await this._requester.getModels(config);
1022
1030
  if (!rawModels.length) {
@@ -1037,9 +1045,6 @@ var GeminiClient = class extends PlatformModelAndEmbeddingsClient {
1037
1045
  ModelCapabilities.ToolCall
1038
1046
  ]
1039
1047
  };
1040
- const thinkingModel = ["gemini-2.5-pro", "gemini-2.5-flash"];
1041
- const thinkingLevelModel = ["gemini-3.0-pro"];
1042
- const imageResolutionModel = ["gemini-3.0-pro-image"];
1043
1048
  if (imageResolutionModel.some(
1044
1049
  (name2) => modelNameLower.includes(name2)
1045
1050
  )) {
@@ -1065,6 +1070,8 @@ var GeminiClient = class extends PlatformModelAndEmbeddingsClient {
1065
1070
  )) {
1066
1071
  models.push(
1067
1072
  { ...info, name: model.name + "-low-thinking" },
1073
+ { ...info, name: model.name + "-high-thinking" },
1074
+ { ...info, name: model.name + "-tiny-thinking" },
1068
1075
  info
1069
1076
  );
1070
1077
  } else {
package/lib/utils.d.ts CHANGED
@@ -33,7 +33,7 @@ export declare function createGenerationConfig(params: ModelRequestParams, model
33
33
  imageConfig: {
34
34
  imageSize: string;
35
35
  };
36
- thinkingConfig: Record<"thinkingBudget" | "includeThoughts" | "thinkingLevel", string | number | boolean>;
36
+ thinkingConfig: Record<"thinkingBudget" | "thinkingLevel" | "includeThoughts", string | number | boolean>;
37
37
  } & Record<string, any>;
38
38
  export declare function createChatGenerationParams(params: ModelRequestParams, plugin: ChatLunaPlugin<ClientConfig, Config>, modelConfig: ReturnType<typeof prepareModelConfig>, pluginConfig: Config): Promise<{
39
39
  [x: string]: Record<string, any> | ChatCompletionResponseMessage | ChatCompletionResponseMessage[] | {
@@ -54,7 +54,7 @@ export declare function createChatGenerationParams(params: ModelRequestParams, p
54
54
  imageConfig: {
55
55
  imageSize: string;
56
56
  };
57
- thinkingConfig: Record<"thinkingBudget" | "includeThoughts" | "thinkingLevel", string | number | boolean>;
57
+ thinkingConfig: Record<"thinkingBudget" | "thinkingLevel" | "includeThoughts", string | number | boolean>;
58
58
  } & Record<string, any>;
59
59
  tools: Record<string, any>;
60
60
  }>;
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.11",
4
+ "version": "1.3.13",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.mjs",
7
7
  "typings": "lib/index.d.ts",