@ai-sdk/google 2.0.36 → 2.0.37
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 +11 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +10 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +10 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "2.0.
|
|
33
|
+
var VERSION = true ? "2.0.37" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -587,7 +587,12 @@ function prepareTools({
|
|
|
587
587
|
var _a;
|
|
588
588
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
589
589
|
const toolWarnings = [];
|
|
590
|
-
const
|
|
590
|
+
const isLatest = [
|
|
591
|
+
"gemini-flash-latest",
|
|
592
|
+
"gemini-flash-lite-latest",
|
|
593
|
+
"gemini-pro-latest"
|
|
594
|
+
].some((id) => id === modelId);
|
|
595
|
+
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
591
596
|
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
592
597
|
const supportsFileSearch = modelId.includes("gemini-2.5");
|
|
593
598
|
if (tools == null) {
|
|
@@ -613,7 +618,7 @@ function prepareTools({
|
|
|
613
618
|
providerDefinedTools.forEach((tool) => {
|
|
614
619
|
switch (tool.id) {
|
|
615
620
|
case "google.google_search":
|
|
616
|
-
if (
|
|
621
|
+
if (isGemini2orNewer) {
|
|
617
622
|
googleTools2.push({ googleSearch: {} });
|
|
618
623
|
} else if (supportsDynamicRetrieval) {
|
|
619
624
|
googleTools2.push({
|
|
@@ -629,7 +634,7 @@ function prepareTools({
|
|
|
629
634
|
}
|
|
630
635
|
break;
|
|
631
636
|
case "google.url_context":
|
|
632
|
-
if (
|
|
637
|
+
if (isGemini2orNewer) {
|
|
633
638
|
googleTools2.push({ urlContext: {} });
|
|
634
639
|
} else {
|
|
635
640
|
toolWarnings.push({
|
|
@@ -640,7 +645,7 @@ function prepareTools({
|
|
|
640
645
|
}
|
|
641
646
|
break;
|
|
642
647
|
case "google.code_execution":
|
|
643
|
-
if (
|
|
648
|
+
if (isGemini2orNewer) {
|
|
644
649
|
googleTools2.push({ codeExecution: {} });
|
|
645
650
|
} else {
|
|
646
651
|
toolWarnings.push({
|
|
@@ -662,7 +667,7 @@ function prepareTools({
|
|
|
662
667
|
}
|
|
663
668
|
break;
|
|
664
669
|
case "google.vertex_rag_store":
|
|
665
|
-
if (
|
|
670
|
+
if (isGemini2orNewer) {
|
|
666
671
|
googleTools2.push({
|
|
667
672
|
retrieval: {
|
|
668
673
|
vertex_rag_store: {
|