@ai-sdk/google 3.0.129 → 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.
- package/CHANGELOG.md +17 -0
- package/dist/index.d.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +18 -2
- package/dist/internal/index.d.ts +18 -2
- package/dist/internal/index.js +9 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +9 -1
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +6 -1
- package/package.json +2 -2
- package/src/google-generative-ai-image-settings.ts +1 -0
- package/src/google-generative-ai-language-model.ts +12 -0
- package/src/google-generative-ai-options.ts +1 -0
- package/src/interactions/google-interactions-language-model-options.ts +1 -0
|
@@ -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.
|
|
3
|
+
"version": "3.0.131",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ai-sdk/provider": "3.0.18",
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.57"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -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
|