@ai-sdk/google 3.0.119 → 3.0.121

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.
@@ -1082,6 +1082,7 @@ The following Zod features are known to not work with Google Generative AI:
1082
1082
 
1083
1083
  | Model | Image Input | Object Generation | Tool Usage | Tool Streaming | Google Search | URL Context |
1084
1084
  | ------------------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
1085
+ | `gemini-3.8-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1085
1086
  | `gemini-3.7-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1086
1087
  | `gemini-3.6-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
1087
1088
  | `gemini-3.5-flash` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
@@ -1111,8 +1112,8 @@ The [Gemini Interactions API](https://ai.google.dev/gemini-api/docs/interactions
1111
1112
  (`POST /v1beta/interactions`) is a separate Google endpoint with server-side
1112
1113
  state, unified content blocks, first-class built-in tools, agent presets,
1113
1114
  managed agents that run in a sandboxed Linux environment, and native
1114
- multimodal image output. It is reached via the `google.interactions(...)`
1115
- factory:
1115
+ multimodal image and video output. It is reached via the
1116
+ `google.interactions(...)` factory:
1116
1117
 
1117
1118
  ```ts
1118
1119
  import { google } from '@ai-sdk/google';
@@ -1202,16 +1203,42 @@ The following optional provider options are available:
1202
1203
  Whether the model returns synthesized thought summaries on reasoning
1203
1204
  parts. Defaults to the API default.
1204
1205
 
1205
- - **responseFormat** _Array\<\{ type: 'text' | 'image' | 'audio'; mimeType?: string; schema?: unknown; aspectRatio?: string; imageSize?: '1K' \| '2K' \| '4K' \| '512' \}\>_
1206
+ - **responseFormat** _Array\<ResponseFormatEntry\>_
1206
1207
 
1207
1208
  Output-format entries that map directly to the API's `response_format`
1208
- array. Use this for fine-grained control over image, audio, or non-JSON
1209
- text outputs (e.g. `aspectRatio` and `imageSize` for image generation).
1209
+ array. Entries have the following shape:
1210
+
1211
+ ```ts
1212
+ type ResponseFormatEntry =
1213
+ | { type: 'text'; mimeType?: string; schema?: unknown }
1214
+ | {
1215
+ type: 'image';
1216
+ mimeType?: string;
1217
+ aspectRatio?: string;
1218
+ imageSize?: '1K' | '2K' | '4K' | '512';
1219
+ }
1220
+ | { type: 'audio'; mimeType?: string }
1221
+ | {
1222
+ type: 'video';
1223
+ aspectRatio?: '16:9' | '9:16';
1224
+ resolution?: '360p' | '720p' | '1080p' | '4k';
1225
+ duration?: string;
1226
+ delivery?: 'inline' | 'uri';
1227
+ gcsUri?: string;
1228
+ };
1229
+ ```
1230
+
1231
+ Use this for fine-grained control over image, audio, video, or non-JSON
1232
+ text outputs. Video entries can control aspect ratio, resolution, duration,
1233
+ and inline or URI delivery; set `gcsUri` when delivering to Google Cloud
1234
+ Storage. Inline videos are returned in `result.files` by `generateText` and
1235
+ emitted as `file` parts by `streamText`.
1210
1236
  The AI SDK call-level `responseFormat: { type: 'json', schema }` still
1211
1237
  drives JSON-mode automatically and prepends a matching text entry;
1212
1238
  entries listed here are appended.
1213
1239
 
1214
- `aspectRatio` accepts `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`,
1240
+ For image entries, `aspectRatio` accepts `1:1`, `2:3`, `3:2`, `3:4`, `4:3`,
1241
+ `4:5`, `5:4`,
1215
1242
  `9:16`, `16:9`, `21:9`, `1:8`, `8:1`, `1:4`, `4:1`.
1216
1243
 
1217
1244
  - **imageConfig** _\{ aspectRatio?: string; imageSize?: '1K' | '2K' | '4K' | '512' \}_ (deprecated)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "3.0.119",
3
+ "version": "3.0.121",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -34,6 +34,7 @@ export type GoogleGenerativeAIModelId =
34
34
  | 'gemini-3.5-flash-lite'
35
35
  | 'gemini-3.6-flash'
36
36
  | 'gemini-3.7-flash'
37
+ | 'gemini-3.8-flash'
37
38
  // latest version
38
39
  // https://ai.google.dev/gemini-api/docs/models#latest
39
40
  | 'gemini-pro-latest'
@@ -36,6 +36,7 @@ export type GoogleInteractionsModelId =
36
36
  | 'gemini-3.5-flash-lite'
37
37
  | 'gemini-3.6-flash'
38
38
  | 'gemini-3.7-flash'
39
+ | 'gemini-3.8-flash'
39
40
  | 'lyria-3-clip-preview'
40
41
  | 'lyria-3-pro-preview'
41
42
  | (string & {});
@@ -75,8 +76,8 @@ export const googleInteractionsLanguageModelOptions = lazySchema(() =>
75
76
 
76
77
  /**
77
78
  * Output-format entries that map directly to the API's `response_format`
78
- * array. Use this to request image, audio, or non-JSON text outputs
79
- * with full control over `mime_type`, `aspect_ratio`, and `image_size`.
79
+ * array. Use this to request image, audio, video, or non-JSON text
80
+ * outputs with modality-specific controls.
80
81
  *
81
82
  * Entries are sent in order. The AI SDK call-level `responseFormat: {
82
83
  * type: 'json', schema }` still drives JSON-mode and adds a matching
@@ -123,6 +124,16 @@ export const googleInteractionsLanguageModelOptions = lazySchema(() =>
123
124
  mimeType: z.string().nullish(),
124
125
  })
125
126
  .loose(),
127
+ z
128
+ .object({
129
+ type: z.literal('video'),
130
+ aspectRatio: z.enum(['16:9', '9:16']).nullish(),
131
+ resolution: z.enum(['360p', '720p', '1080p', '4k']).nullish(),
132
+ duration: z.string().nullish(),
133
+ delivery: z.enum(['inline', 'uri']).nullish(),
134
+ gcsUri: z.string().nullish(),
135
+ })
136
+ .loose(),
126
137
  ]),
127
138
  )
128
139
  .nullish(),
@@ -221,6 +221,17 @@ export class GoogleInteractionsLanguageModel implements LanguageModelV3 {
221
221
  mime_type: entry.mimeType ?? undefined,
222
222
  }),
223
223
  );
224
+ } else if (entry.type === 'video') {
225
+ responseFormatEntries.push(
226
+ pruneUndefined({
227
+ type: 'video' as const,
228
+ aspect_ratio: entry.aspectRatio ?? undefined,
229
+ resolution: entry.resolution ?? undefined,
230
+ duration: entry.duration ?? undefined,
231
+ delivery: entry.delivery ?? undefined,
232
+ gcs_uri: entry.gcsUri ?? undefined,
233
+ }),
234
+ );
224
235
  }
225
236
  }
226
237
  }
@@ -434,6 +434,10 @@ export type GoogleInteractionsImageSize = '1K' | '2K' | '4K' | '512';
434
434
  *
435
435
  * { type: 'image', mime_type, aspect_ratio?, image_size? }
436
436
  * -- image generation. `mime_type` defaults to `image/png`.
437
+ *
438
+ * { type: 'video', aspect_ratio?, resolution?, duration?, delivery?,
439
+ * gcs_uri? }
440
+ * -- video generation and delivery configuration.
437
441
  */
438
442
  export type GoogleInteractionsResponseFormatTextEntry = {
439
443
  type: 'text';
@@ -453,10 +457,20 @@ export type GoogleInteractionsResponseFormatAudioEntry = {
453
457
  mime_type?: string;
454
458
  };
455
459
 
460
+ export type GoogleInteractionsResponseFormatVideoEntry = {
461
+ type: 'video';
462
+ aspect_ratio?: '16:9' | '9:16';
463
+ resolution?: '360p' | '720p' | '1080p' | '4k';
464
+ duration?: string;
465
+ delivery?: 'inline' | 'uri';
466
+ gcs_uri?: string;
467
+ };
468
+
456
469
  export type GoogleInteractionsResponseFormatEntry =
457
470
  | GoogleInteractionsResponseFormatTextEntry
458
471
  | GoogleInteractionsResponseFormatImageEntry
459
- | GoogleInteractionsResponseFormatAudioEntry;
472
+ | GoogleInteractionsResponseFormatAudioEntry
473
+ | GoogleInteractionsResponseFormatVideoEntry;
460
474
 
461
475
  export type GoogleInteractionsGenerationConfig = {
462
476
  temperature?: number;