@ai-sdk/google 4.0.45 → 4.0.46

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.46
4
+
5
+ ### Patch Changes
6
+
7
+ - f69920a: fix(google): use low as the minimum reasoning level for full Gemini Flash 3.7 and later
8
+
3
9
  ## 4.0.45
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "@ai-sdk/provider-utils";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "4.0.45" : "0.0.0-test";
10
+ var VERSION = true ? "4.0.46" : "0.0.0-test";
11
11
 
12
12
  // src/google-embedding-model.ts
13
13
  import {
@@ -2495,7 +2495,7 @@ function resolveGemini3ThinkingConfig({
2495
2495
  modelId,
2496
2496
  warnings
2497
2497
  }) {
2498
- const minimumThinkingLevel = /(^|\/)gemini-3\.7-flash$/i.test(modelId) ? "low" : "minimal";
2498
+ const minimumThinkingLevel = getMinimumThinkingLevelForGemini3Model(modelId);
2499
2499
  if (reasoning === "none") {
2500
2500
  return { thinkingLevel: minimumThinkingLevel };
2501
2501
  }
@@ -2515,6 +2515,22 @@ function resolveGemini3ThinkingConfig({
2515
2515
  }
2516
2516
  return { thinkingLevel };
2517
2517
  }
2518
+ function getMinimumThinkingLevelForGemini3Model(modelId) {
2519
+ var _a;
2520
+ const modelName = (_a = modelId.split("/").at(-1)) == null ? void 0 : _a.toLowerCase();
2521
+ if (modelName === "gemini-flash-latest") {
2522
+ return "low";
2523
+ }
2524
+ const versionMatch = /^gemini-(\d+)\.(\d+)-flash(?:$|-(?!lite(?:-|$)))/.exec(
2525
+ modelName != null ? modelName : ""
2526
+ );
2527
+ if (versionMatch == null) {
2528
+ return "minimal";
2529
+ }
2530
+ const majorVersion = Number(versionMatch[1]);
2531
+ const minorVersion = Number(versionMatch[2]);
2532
+ return majorVersion > 3 || majorVersion === 3 && minorVersion >= 7 ? "low" : "minimal";
2533
+ }
2518
2534
  function resolveGemini25ThinkingConfig({
2519
2535
  reasoning,
2520
2536
  modelId,