@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 +6 -0
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +17 -1
- package/dist/internal/index.js.map +1 -1
- package/package.json +1 -1
- package/src/google-language-model.ts +26 -3
package/dist/internal/index.js
CHANGED
|
@@ -2266,7 +2266,7 @@ function resolveGemini3ThinkingConfig({
|
|
|
2266
2266
|
modelId,
|
|
2267
2267
|
warnings
|
|
2268
2268
|
}) {
|
|
2269
|
-
const minimumThinkingLevel =
|
|
2269
|
+
const minimumThinkingLevel = getMinimumThinkingLevelForGemini3Model(modelId);
|
|
2270
2270
|
if (reasoning === "none") {
|
|
2271
2271
|
return { thinkingLevel: minimumThinkingLevel };
|
|
2272
2272
|
}
|
|
@@ -2286,6 +2286,22 @@ function resolveGemini3ThinkingConfig({
|
|
|
2286
2286
|
}
|
|
2287
2287
|
return { thinkingLevel };
|
|
2288
2288
|
}
|
|
2289
|
+
function getMinimumThinkingLevelForGemini3Model(modelId) {
|
|
2290
|
+
var _a;
|
|
2291
|
+
const modelName = (_a = modelId.split("/").at(-1)) == null ? void 0 : _a.toLowerCase();
|
|
2292
|
+
if (modelName === "gemini-flash-latest") {
|
|
2293
|
+
return "low";
|
|
2294
|
+
}
|
|
2295
|
+
const versionMatch = /^gemini-(\d+)\.(\d+)-flash(?:$|-(?!lite(?:-|$)))/.exec(
|
|
2296
|
+
modelName != null ? modelName : ""
|
|
2297
|
+
);
|
|
2298
|
+
if (versionMatch == null) {
|
|
2299
|
+
return "minimal";
|
|
2300
|
+
}
|
|
2301
|
+
const majorVersion = Number(versionMatch[1]);
|
|
2302
|
+
const minorVersion = Number(versionMatch[2]);
|
|
2303
|
+
return majorVersion > 3 || majorVersion === 3 && minorVersion >= 7 ? "low" : "minimal";
|
|
2304
|
+
}
|
|
2289
2305
|
function resolveGemini25ThinkingConfig({
|
|
2290
2306
|
reasoning,
|
|
2291
2307
|
modelId,
|