@ai-sdk/google 3.0.0-beta.80 → 3.0.0-beta.82

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 ? "3.0.0-beta.80" : "0.0.0-test";
10
+ var VERSION = true ? "3.0.0-beta.82" : "0.0.0-test";
11
11
 
12
12
  // src/google-generative-ai-embedding-model.ts
13
13
  import {
@@ -690,6 +690,17 @@ function prepareTools({
690
690
  googleTools2.push({ googleSearchRetrieval: {} });
691
691
  }
692
692
  break;
693
+ case "google.enterprise_web_search":
694
+ if (isGemini2orNewer) {
695
+ googleTools2.push({ enterpriseWebSearch: {} });
696
+ } else {
697
+ toolWarnings.push({
698
+ type: "unsupported",
699
+ feature: `provider-defined tool ${tool.id}`,
700
+ details: "Enterprise Web Search requires Gemini 2.0 or newer."
701
+ });
702
+ }
703
+ break;
693
704
  case "google.url_context":
694
705
  if (isGemini2orNewer) {
695
706
  googleTools2.push({ urlContext: {} });
@@ -1594,63 +1605,75 @@ var codeExecution = createProviderToolFactoryWithOutputSchema({
1594
1605
  })
1595
1606
  });
1596
1607
 
1597
- // src/tool/file-search.ts
1608
+ // src/tool/enterprise-web-search.ts
1598
1609
  import {
1599
1610
  createProviderToolFactory,
1600
1611
  lazySchema as lazySchema6,
1601
1612
  zodSchema as zodSchema6
1602
1613
  } from "@ai-sdk/provider-utils";
1603
1614
  import { z as z7 } from "zod/v4";
1604
- var fileSearchArgsBaseSchema = z7.object({
1615
+ var enterpriseWebSearch = createProviderToolFactory({
1616
+ id: "google.enterprise_web_search",
1617
+ inputSchema: lazySchema6(() => zodSchema6(z7.object({})))
1618
+ });
1619
+
1620
+ // src/tool/file-search.ts
1621
+ import {
1622
+ createProviderToolFactory as createProviderToolFactory2,
1623
+ lazySchema as lazySchema7,
1624
+ zodSchema as zodSchema7
1625
+ } from "@ai-sdk/provider-utils";
1626
+ import { z as z8 } from "zod/v4";
1627
+ var fileSearchArgsBaseSchema = z8.object({
1605
1628
  /** The names of the file_search_stores to retrieve from.
1606
1629
  * Example: `fileSearchStores/my-file-search-store-123`
1607
1630
  */
1608
- fileSearchStoreNames: z7.array(z7.string()).describe(
1631
+ fileSearchStoreNames: z8.array(z8.string()).describe(
1609
1632
  "The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
1610
1633
  ),
1611
1634
  /** The number of file search retrieval chunks to retrieve. */
1612
- topK: z7.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
1635
+ topK: z8.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
1613
1636
  /** Metadata filter to apply to the file search retrieval documents.
1614
1637
  * See https://google.aip.dev/160 for the syntax of the filter expression.
1615
1638
  */
1616
- metadataFilter: z7.string().describe(
1639
+ metadataFilter: z8.string().describe(
1617
1640
  "Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
1618
1641
  ).optional()
1619
1642
  }).passthrough();
1620
- var fileSearchArgsSchema = lazySchema6(
1621
- () => zodSchema6(fileSearchArgsBaseSchema)
1643
+ var fileSearchArgsSchema = lazySchema7(
1644
+ () => zodSchema7(fileSearchArgsBaseSchema)
1622
1645
  );
1623
- var fileSearch = createProviderToolFactory({
1646
+ var fileSearch = createProviderToolFactory2({
1624
1647
  id: "google.file_search",
1625
1648
  inputSchema: fileSearchArgsSchema
1626
1649
  });
1627
1650
 
1628
1651
  // src/tool/google-maps.ts
1629
1652
  import {
1630
- createProviderToolFactory as createProviderToolFactory2,
1631
- lazySchema as lazySchema7,
1632
- zodSchema as zodSchema7
1653
+ createProviderToolFactory as createProviderToolFactory3,
1654
+ lazySchema as lazySchema8,
1655
+ zodSchema as zodSchema8
1633
1656
  } from "@ai-sdk/provider-utils";
1634
- import { z as z8 } from "zod/v4";
1635
- var googleMaps = createProviderToolFactory2({
1657
+ import { z as z9 } from "zod/v4";
1658
+ var googleMaps = createProviderToolFactory3({
1636
1659
  id: "google.google_maps",
1637
- inputSchema: lazySchema7(() => zodSchema7(z8.object({})))
1660
+ inputSchema: lazySchema8(() => zodSchema8(z9.object({})))
1638
1661
  });
1639
1662
 
1640
1663
  // src/tool/google-search.ts
1641
1664
  import {
1642
- createProviderToolFactory as createProviderToolFactory3,
1643
- lazySchema as lazySchema8,
1644
- zodSchema as zodSchema8
1665
+ createProviderToolFactory as createProviderToolFactory4,
1666
+ lazySchema as lazySchema9,
1667
+ zodSchema as zodSchema9
1645
1668
  } from "@ai-sdk/provider-utils";
1646
- import { z as z9 } from "zod/v4";
1647
- var googleSearch = createProviderToolFactory3({
1669
+ import { z as z10 } from "zod/v4";
1670
+ var googleSearch = createProviderToolFactory4({
1648
1671
  id: "google.google_search",
1649
- inputSchema: lazySchema8(
1650
- () => zodSchema8(
1651
- z9.object({
1652
- mode: z9.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
1653
- dynamicThreshold: z9.number().default(1)
1672
+ inputSchema: lazySchema9(
1673
+ () => zodSchema9(
1674
+ z10.object({
1675
+ mode: z10.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
1676
+ dynamicThreshold: z10.number().default(1)
1654
1677
  })
1655
1678
  )
1656
1679
  )
@@ -1658,24 +1681,24 @@ var googleSearch = createProviderToolFactory3({
1658
1681
 
1659
1682
  // src/tool/url-context.ts
1660
1683
  import {
1661
- createProviderToolFactory as createProviderToolFactory4,
1662
- lazySchema as lazySchema9,
1663
- zodSchema as zodSchema9
1684
+ createProviderToolFactory as createProviderToolFactory5,
1685
+ lazySchema as lazySchema10,
1686
+ zodSchema as zodSchema10
1664
1687
  } from "@ai-sdk/provider-utils";
1665
- import { z as z10 } from "zod/v4";
1666
- var urlContext = createProviderToolFactory4({
1688
+ import { z as z11 } from "zod/v4";
1689
+ var urlContext = createProviderToolFactory5({
1667
1690
  id: "google.url_context",
1668
- inputSchema: lazySchema9(() => zodSchema9(z10.object({})))
1691
+ inputSchema: lazySchema10(() => zodSchema10(z11.object({})))
1669
1692
  });
1670
1693
 
1671
1694
  // src/tool/vertex-rag-store.ts
1672
- import { createProviderToolFactory as createProviderToolFactory5 } from "@ai-sdk/provider-utils";
1673
- import { z as z11 } from "zod/v4";
1674
- var vertexRagStore = createProviderToolFactory5({
1695
+ import { createProviderToolFactory as createProviderToolFactory6 } from "@ai-sdk/provider-utils";
1696
+ import { z as z12 } from "zod/v4";
1697
+ var vertexRagStore = createProviderToolFactory6({
1675
1698
  id: "google.vertex_rag_store",
1676
- inputSchema: z11.object({
1677
- ragCorpus: z11.string(),
1678
- topK: z11.number().optional()
1699
+ inputSchema: z12.object({
1700
+ ragCorpus: z12.string(),
1701
+ topK: z12.number().optional()
1679
1702
  })
1680
1703
  });
1681
1704
 
@@ -1686,6 +1709,17 @@ var googleTools = {
1686
1709
  * Must have name "google_search".
1687
1710
  */
1688
1711
  googleSearch,
1712
+ /**
1713
+ * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
1714
+ * Designed for highly-regulated industries (finance, healthcare, public sector).
1715
+ * Does not log customer data and supports VPC service controls.
1716
+ * Must have name "enterprise_web_search".
1717
+ *
1718
+ * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
1719
+ *
1720
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
1721
+ */
1722
+ enterpriseWebSearch,
1689
1723
  /**
1690
1724
  * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
1691
1725
  * Must have name "google_maps".
@@ -1732,13 +1766,13 @@ var googleTools = {
1732
1766
  import {
1733
1767
  combineHeaders as combineHeaders3,
1734
1768
  createJsonResponseHandler as createJsonResponseHandler3,
1735
- lazySchema as lazySchema10,
1769
+ lazySchema as lazySchema11,
1736
1770
  parseProviderOptions as parseProviderOptions3,
1737
1771
  postJsonToApi as postJsonToApi3,
1738
1772
  resolve as resolve3,
1739
- zodSchema as zodSchema10
1773
+ zodSchema as zodSchema11
1740
1774
  } from "@ai-sdk/provider-utils";
1741
- import { z as z12 } from "zod/v4";
1775
+ import { z as z13 } from "zod/v4";
1742
1776
  var GoogleGenerativeAIImageModel = class {
1743
1777
  constructor(modelId, settings, config) {
1744
1778
  this.modelId = modelId;
@@ -1758,14 +1792,26 @@ var GoogleGenerativeAIImageModel = class {
1758
1792
  const {
1759
1793
  prompt,
1760
1794
  n = 1,
1761
- size = "1024x1024",
1795
+ size,
1762
1796
  aspectRatio = "1:1",
1763
1797
  seed,
1764
1798
  providerOptions,
1765
1799
  headers,
1766
- abortSignal
1800
+ abortSignal,
1801
+ files,
1802
+ mask
1767
1803
  } = options;
1768
1804
  const warnings = [];
1805
+ if (files != null && files.length > 0) {
1806
+ throw new Error(
1807
+ "Google Generative AI does not support image editing. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities."
1808
+ );
1809
+ }
1810
+ if (mask != null) {
1811
+ throw new Error(
1812
+ "Google Generative AI does not support image editing with masks. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities."
1813
+ );
1814
+ }
1769
1815
  if (size != null) {
1770
1816
  warnings.push({
1771
1817
  type: "unsupported",
@@ -1830,18 +1876,18 @@ var GoogleGenerativeAIImageModel = class {
1830
1876
  };
1831
1877
  }
1832
1878
  };
1833
- var googleImageResponseSchema = lazySchema10(
1834
- () => zodSchema10(
1835
- z12.object({
1836
- predictions: z12.array(z12.object({ bytesBase64Encoded: z12.string() })).default([])
1879
+ var googleImageResponseSchema = lazySchema11(
1880
+ () => zodSchema11(
1881
+ z13.object({
1882
+ predictions: z13.array(z13.object({ bytesBase64Encoded: z13.string() })).default([])
1837
1883
  })
1838
1884
  )
1839
1885
  );
1840
- var googleImageProviderOptionsSchema = lazySchema10(
1841
- () => zodSchema10(
1842
- z12.object({
1843
- personGeneration: z12.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
1844
- aspectRatio: z12.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish()
1886
+ var googleImageProviderOptionsSchema = lazySchema11(
1887
+ () => zodSchema11(
1888
+ z13.object({
1889
+ personGeneration: z13.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
1890
+ aspectRatio: z13.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish()
1845
1891
  })
1846
1892
  )
1847
1893
  );