@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 2.0.37
4
+
5
+ ### Patch Changes
6
+
7
+ - 6de29ca: Prepare search tool for gemini-3-pro-preview
8
+
3
9
  ## 2.0.36
4
10
 
5
11
  ### Patch Changes
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.36" : "0.0.0-test";
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 isGemini2 = modelId.includes("gemini-2");
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 (isGemini2) {
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 (isGemini2) {
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 (isGemini2) {
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 (isGemini2) {
670
+ if (isGemini2orNewer) {
666
671
  googleTools2.push({
667
672
  retrieval: {
668
673
  vertex_rag_store: {