@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/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "@ai-sdk/provider-utils";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "2.0.36" : "0.0.0-test";
10
+ var VERSION = true ? "2.0.37" : "0.0.0-test";
11
11
 
12
12
  // src/google-generative-ai-embedding-model.ts
13
13
  import {
@@ -598,7 +598,12 @@ function prepareTools({
598
598
  var _a;
599
599
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
600
600
  const toolWarnings = [];
601
- const isGemini2 = modelId.includes("gemini-2");
601
+ const isLatest = [
602
+ "gemini-flash-latest",
603
+ "gemini-flash-lite-latest",
604
+ "gemini-pro-latest"
605
+ ].some((id) => id === modelId);
606
+ const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
602
607
  const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
603
608
  const supportsFileSearch = modelId.includes("gemini-2.5");
604
609
  if (tools == null) {
@@ -624,7 +629,7 @@ function prepareTools({
624
629
  providerDefinedTools.forEach((tool) => {
625
630
  switch (tool.id) {
626
631
  case "google.google_search":
627
- if (isGemini2) {
632
+ if (isGemini2orNewer) {
628
633
  googleTools2.push({ googleSearch: {} });
629
634
  } else if (supportsDynamicRetrieval) {
630
635
  googleTools2.push({
@@ -640,7 +645,7 @@ function prepareTools({
640
645
  }
641
646
  break;
642
647
  case "google.url_context":
643
- if (isGemini2) {
648
+ if (isGemini2orNewer) {
644
649
  googleTools2.push({ urlContext: {} });
645
650
  } else {
646
651
  toolWarnings.push({
@@ -651,7 +656,7 @@ function prepareTools({
651
656
  }
652
657
  break;
653
658
  case "google.code_execution":
654
- if (isGemini2) {
659
+ if (isGemini2orNewer) {
655
660
  googleTools2.push({ codeExecution: {} });
656
661
  } else {
657
662
  toolWarnings.push({
@@ -673,7 +678,7 @@ function prepareTools({
673
678
  }
674
679
  break;
675
680
  case "google.vertex_rag_store":
676
- if (isGemini2) {
681
+ if (isGemini2orNewer) {
677
682
  googleTools2.push({
678
683
  retrieval: {
679
684
  vertex_rag_store: {