@ai-sdk/google 3.0.130 → 3.0.131

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.
@@ -672,7 +672,7 @@ The [File Search tool](https://ai.google.dev/gemini-api/docs/file-search) lets G
672
672
  import { google } from '@ai-sdk/google';
673
673
  import { generateText } from 'ai';
674
674
 
675
- const { text, sources } = await generateText({
675
+ const { text, sources, providerMetadata } = await generateText({
676
676
  model: google('gemini-2.5-pro'),
677
677
  tools: {
678
678
  file_search: google.tools.fileSearch({
@@ -689,6 +689,9 @@ const { text, sources } = await generateText({
689
689
 
690
690
  File Search responses include citations via the normal `sources` field and expose raw [grounding metadata](#google-search) in `providerMetadata.google.groundingMetadata`.
691
691
 
692
+ Custom metadata attached to the indexed documents is available in
693
+ `groundingMetadata.groundingChunks[].retrievedContext.customMetadata`.
694
+
692
695
  ### URL Context
693
696
 
694
697
  Google provides a provider-defined URL context tool.
@@ -1082,6 +1085,7 @@ The following Zod features are known to not work with Google Generative AI:
1082
1085
 
1083
1086
  | Model | Image Input | Object Generation | Tool Usage | Tool Streaming | Google Search | URL Context |
1084
1087
  | ------------------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
1088
+ | `gemini-nano-banana-2.1` | <Check size={18} /> | <Cross size={18} /> | <Cross size={18} /> | <Cross size={18} /> | <Check size={18} /> | <Cross size={18} /> |
1085
1089
  | `gemini-3.8-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1086
1090
  | `gemini-3.7-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1087
1091
  | `gemini-3.6-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
@@ -1965,6 +1969,7 @@ console.log(result.providerMetadata?.google?.groundingMetadata);
1965
1969
  | `gemini-2.5-flash-image` | <Check size={18} /> | <Check size={18} /> | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
1966
1970
  | `gemini-3-pro-image-preview` | <Check size={18} /> | <Check size={18} /> | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
1967
1971
  | `gemini-3.1-flash-image-preview` | <Check size={18} /> | <Check size={18} /> | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
1972
+ | `gemini-nano-banana-2.1` | <Check size={18} /> | <Check size={18} /> | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:8, 8:1, 1:4, 4:1 |
1968
1973
 
1969
1974
  <Note>
1970
1975
  `gemini-3-pro-image-preview` supports additional features including up to 14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.130",
3
+ "version": "3.0.131",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -7,6 +7,7 @@ export type GoogleGenerativeAIImageModelId =
7
7
  | 'gemini-2.5-flash-image'
8
8
  | 'gemini-3-pro-image-preview'
9
9
  | 'gemini-3.1-flash-image-preview'
10
+ | 'gemini-nano-banana-2.1'
10
11
  | (string & {});
11
12
 
12
13
  export interface GoogleGenerativeAIImageSettings {
@@ -1383,6 +1383,18 @@ export const getGroundingMetadataSchema = () =>
1383
1383
  title: z.string().nullish(),
1384
1384
  text: z.string().nullish(),
1385
1385
  fileSearchStore: z.string().nullish(),
1386
+ customMetadata: z
1387
+ .array(
1388
+ z.object({
1389
+ key: z.string(),
1390
+ stringValue: z.string().nullish(),
1391
+ numericValue: z.number().nullish(),
1392
+ stringListValue: z
1393
+ .object({ values: z.array(z.string()).nullish() })
1394
+ .nullish(),
1395
+ }),
1396
+ )
1397
+ .nullish(),
1386
1398
  })
1387
1399
  .nullish(),
1388
1400
  maps: z
@@ -35,6 +35,7 @@ export type GoogleGenerativeAIModelId =
35
35
  | 'gemini-3.6-flash'
36
36
  | 'gemini-3.7-flash'
37
37
  | 'gemini-3.8-flash'
38
+ | 'gemini-nano-banana-2.1'
38
39
  // latest version
39
40
  // https://ai.google.dev/gemini-api/docs/models#latest
40
41
  | 'gemini-pro-latest'
@@ -37,6 +37,7 @@ export type GoogleInteractionsModelId =
37
37
  | 'gemini-3.6-flash'
38
38
  | 'gemini-3.7-flash'
39
39
  | 'gemini-3.8-flash'
40
+ | 'gemini-nano-banana-2.1'
40
41
  | 'lyria-3-clip-preview'
41
42
  | 'lyria-3-pro-preview'
42
43
  | (string & {});