@ai-sdk/google 3.0.119 → 3.0.120

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.120
4
+
5
+ ### Patch Changes
6
+
7
+ - daaa769: fix(google): support video response formats in Gemini Interactions
8
+
3
9
  ## 3.0.119
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -344,6 +344,14 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
344
344
  [x: string]: unknown;
345
345
  type: "audio";
346
346
  mimeType?: string | null | undefined;
347
+ } | {
348
+ [x: string]: unknown;
349
+ type: "video";
350
+ aspectRatio?: "9:16" | "16:9" | null | undefined;
351
+ resolution?: "720p" | "1080p" | "4k" | "360p" | null | undefined;
352
+ duration?: string | null | undefined;
353
+ delivery?: "uri" | "inline" | null | undefined;
354
+ gcsUri?: string | null | undefined;
347
355
  })[] | null | undefined;
348
356
  imageConfig?: {
349
357
  aspectRatio?: "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" | null | undefined;
package/dist/index.d.ts CHANGED
@@ -344,6 +344,14 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
344
344
  [x: string]: unknown;
345
345
  type: "audio";
346
346
  mimeType?: string | null | undefined;
347
+ } | {
348
+ [x: string]: unknown;
349
+ type: "video";
350
+ aspectRatio?: "9:16" | "16:9" | null | undefined;
351
+ resolution?: "720p" | "1080p" | "4k" | "360p" | null | undefined;
352
+ duration?: string | null | undefined;
353
+ delivery?: "uri" | "inline" | null | undefined;
354
+ gcsUri?: string | null | undefined;
347
355
  })[] | null | undefined;
348
356
  imageConfig?: {
349
357
  aspectRatio?: "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" | null | undefined;
package/dist/index.js CHANGED
@@ -235,7 +235,7 @@ var googleInteractionsTranscriptionResponseSchema = import_v43.z.object({
235
235
  var import_provider_utils24 = require("@ai-sdk/provider-utils");
236
236
 
237
237
  // src/version.ts
238
- var VERSION = true ? "3.0.119" : "0.0.0-test";
238
+ var VERSION = true ? "3.0.120" : "0.0.0-test";
239
239
 
240
240
  // src/google-generative-ai-embedding-model.ts
241
241
  var import_provider2 = require("@ai-sdk/provider");
@@ -5241,8 +5241,8 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils19.lazySch
5241
5241
  thinkingSummaries: import_v418.z.enum(["auto", "none"]).nullish(),
5242
5242
  /**
5243
5243
  * Output-format entries that map directly to the API's `response_format`
5244
- * array. Use this to request image, audio, or non-JSON text outputs
5245
- * with full control over `mime_type`, `aspect_ratio`, and `image_size`.
5244
+ * array. Use this to request image, audio, video, or non-JSON text
5245
+ * outputs with modality-specific controls.
5246
5246
  *
5247
5247
  * Entries are sent in order. The AI SDK call-level `responseFormat: {
5248
5248
  * type: 'json', schema }` still drives JSON-mode and adds a matching
@@ -5279,6 +5279,14 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils19.lazySch
5279
5279
  import_v418.z.object({
5280
5280
  type: import_v418.z.literal("audio"),
5281
5281
  mimeType: import_v418.z.string().nullish()
5282
+ }).loose(),
5283
+ import_v418.z.object({
5284
+ type: import_v418.z.literal("video"),
5285
+ aspectRatio: import_v418.z.enum(["16:9", "9:16"]).nullish(),
5286
+ resolution: import_v418.z.enum(["360p", "720p", "1080p", "4k"]).nullish(),
5287
+ duration: import_v418.z.string().nullish(),
5288
+ delivery: import_v418.z.enum(["inline", "uri"]).nullish(),
5289
+ gcsUri: import_v418.z.string().nullish()
5282
5290
  }).loose()
5283
5291
  ])
5284
5292
  ).nullish(),
@@ -6165,7 +6173,7 @@ var GoogleInteractionsLanguageModel = class {
6165
6173
  };
6166
6174
  }
6167
6175
  async getArgs(options) {
6168
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
6176
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
6169
6177
  const warnings = [];
6170
6178
  const opts = await (0, import_provider_utils23.parseProviderOptions)({
6171
6179
  provider: "google",
@@ -6241,6 +6249,17 @@ var GoogleInteractionsLanguageModel = class {
6241
6249
  mime_type: (_g = entry.mimeType) != null ? _g : void 0
6242
6250
  })
6243
6251
  );
6252
+ } else if (entry.type === "video") {
6253
+ responseFormatEntries.push(
6254
+ pruneUndefined({
6255
+ type: "video",
6256
+ aspect_ratio: (_h = entry.aspectRatio) != null ? _h : void 0,
6257
+ resolution: (_i = entry.resolution) != null ? _i : void 0,
6258
+ duration: (_j = entry.duration) != null ? _j : void 0,
6259
+ delivery: (_k = entry.delivery) != null ? _k : void 0,
6260
+ gcs_uri: (_l = entry.gcsUri) != null ? _l : void 0
6261
+ })
6262
+ );
6244
6263
  }
6245
6264
  }
6246
6265
  }
@@ -6250,13 +6269,13 @@ var GoogleInteractionsLanguageModel = class {
6250
6269
  warnings: convWarnings
6251
6270
  } = convertToGoogleInteractionsInput({
6252
6271
  prompt: options.prompt,
6253
- previousInteractionId: (_h = opts == null ? void 0 : opts.previousInteractionId) != null ? _h : void 0,
6254
- store: (_i = opts == null ? void 0 : opts.store) != null ? _i : void 0,
6255
- mediaResolution: (_j = opts == null ? void 0 : opts.mediaResolution) != null ? _j : void 0
6272
+ previousInteractionId: (_m = opts == null ? void 0 : opts.previousInteractionId) != null ? _m : void 0,
6273
+ store: (_n = opts == null ? void 0 : opts.store) != null ? _n : void 0,
6274
+ mediaResolution: (_o = opts == null ? void 0 : opts.mediaResolution) != null ? _o : void 0
6256
6275
  });
6257
6276
  warnings.push(...convWarnings);
6258
6277
  let systemInstruction = convertedSystemInstruction;
6259
- const optionSystemInstruction = (_k = opts == null ? void 0 : opts.systemInstruction) != null ? _k : void 0;
6278
+ const optionSystemInstruction = (_p = opts == null ? void 0 : opts.systemInstruction) != null ? _p : void 0;
6260
6279
  if (systemInstruction != null && optionSystemInstruction != null) {
6261
6280
  warnings.push({
6262
6281
  type: "other",
@@ -6295,14 +6314,14 @@ var GoogleInteractionsLanguageModel = class {
6295
6314
  generationConfig = void 0;
6296
6315
  } else {
6297
6316
  generationConfig = pruneUndefined({
6298
- temperature: (_l = options.temperature) != null ? _l : void 0,
6299
- top_p: (_m = options.topP) != null ? _m : void 0,
6300
- top_k: (_n = options.topK) != null ? _n : void 0,
6301
- seed: (_o = options.seed) != null ? _o : void 0,
6317
+ temperature: (_q = options.temperature) != null ? _q : void 0,
6318
+ top_p: (_r = options.topP) != null ? _r : void 0,
6319
+ top_k: (_s = options.topK) != null ? _s : void 0,
6320
+ seed: (_t = options.seed) != null ? _t : void 0,
6302
6321
  stop_sequences: options.stopSequences != null && options.stopSequences.length > 0 ? options.stopSequences : void 0,
6303
- max_output_tokens: (_p = options.maxOutputTokens) != null ? _p : void 0,
6304
- thinking_level: (_q = opts == null ? void 0 : opts.thinkingLevel) != null ? _q : void 0,
6305
- thinking_summaries: (_r = opts == null ? void 0 : opts.thinkingSummaries) != null ? _r : void 0,
6322
+ max_output_tokens: (_u = options.maxOutputTokens) != null ? _u : void 0,
6323
+ thinking_level: (_v = opts == null ? void 0 : opts.thinkingLevel) != null ? _v : void 0,
6324
+ thinking_summaries: (_w = opts == null ? void 0 : opts.thinkingSummaries) != null ? _w : void 0,
6306
6325
  tool_choice: toolChoiceForBody
6307
6326
  });
6308
6327
  if ((opts == null ? void 0 : opts.imageConfig) != null) {
@@ -6329,9 +6348,9 @@ var GoogleInteractionsLanguageModel = class {
6329
6348
  if (ac.type === "deep-research") {
6330
6349
  agentConfig = pruneUndefined({
6331
6350
  type: "deep-research",
6332
- thinking_summaries: (_s = ac.thinkingSummaries) != null ? _s : void 0,
6333
- visualization: (_t = ac.visualization) != null ? _t : void 0,
6334
- collaborative_planning: (_u = ac.collaborativePlanning) != null ? _u : void 0
6351
+ thinking_summaries: (_x = ac.thinkingSummaries) != null ? _x : void 0,
6352
+ visualization: (_y = ac.visualization) != null ? _y : void 0,
6353
+ collaborative_planning: (_z = ac.collaborativePlanning) != null ? _z : void 0
6335
6354
  });
6336
6355
  } else if (ac.type === "dynamic") {
6337
6356
  agentConfig = { type: "dynamic" };
@@ -6348,7 +6367,7 @@ var GoogleInteractionsLanguageModel = class {
6348
6367
  environment = opts.environment;
6349
6368
  } else {
6350
6369
  const env = opts.environment;
6351
- const sources = (_v = env.sources) == null ? void 0 : _v.map((s) => {
6370
+ const sources = (_A = env.sources) == null ? void 0 : _A.map((s) => {
6352
6371
  var _a2;
6353
6372
  if (s.type === "inline") {
6354
6373
  return {
@@ -6393,20 +6412,20 @@ var GoogleInteractionsLanguageModel = class {
6393
6412
  tools: toolsForBody,
6394
6413
  response_format: responseFormatEntries.length > 0 ? responseFormatEntries : void 0,
6395
6414
  response_modalities: (opts == null ? void 0 : opts.responseModalities) != null ? opts.responseModalities : void 0,
6396
- previous_interaction_id: (_w = opts == null ? void 0 : opts.previousInteractionId) != null ? _w : void 0,
6397
- service_tier: (_x = opts == null ? void 0 : opts.serviceTier) != null ? _x : void 0,
6398
- store: (_y = opts == null ? void 0 : opts.store) != null ? _y : void 0,
6415
+ previous_interaction_id: (_B = opts == null ? void 0 : opts.previousInteractionId) != null ? _B : void 0,
6416
+ service_tier: (_C = opts == null ? void 0 : opts.serviceTier) != null ? _C : void 0,
6417
+ store: (_D = opts == null ? void 0 : opts.store) != null ? _D : void 0,
6399
6418
  generation_config: generationConfig != null && Object.keys(generationConfig).length > 0 ? generationConfig : void 0,
6400
6419
  agent_config: agentConfig,
6401
6420
  environment,
6402
- background: (_z = opts == null ? void 0 : opts.background) != null ? _z : void 0
6421
+ background: (_E = opts == null ? void 0 : opts.background) != null ? _E : void 0
6403
6422
  });
6404
6423
  return {
6405
6424
  args,
6406
6425
  warnings,
6407
6426
  isAgent,
6408
6427
  isBackground: (opts == null ? void 0 : opts.background) === true,
6409
- pollingTimeoutMs: (_A = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _A : void 0
6428
+ pollingTimeoutMs: (_F = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _F : void 0
6410
6429
  };
6411
6430
  }
6412
6431
  async doGenerate(options) {