@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.
package/dist/index.mjs CHANGED
@@ -224,7 +224,7 @@ import {
224
224
  } from "@ai-sdk/provider-utils";
225
225
 
226
226
  // src/version.ts
227
- var VERSION = true ? "3.0.119" : "0.0.0-test";
227
+ var VERSION = true ? "3.0.121" : "0.0.0-test";
228
228
 
229
229
  // src/google-generative-ai-embedding-model.ts
230
230
  import {
@@ -5320,8 +5320,8 @@ var googleInteractionsLanguageModelOptions = lazySchema14(
5320
5320
  thinkingSummaries: z18.enum(["auto", "none"]).nullish(),
5321
5321
  /**
5322
5322
  * Output-format entries that map directly to the API's `response_format`
5323
- * array. Use this to request image, audio, or non-JSON text outputs
5324
- * with full control over `mime_type`, `aspect_ratio`, and `image_size`.
5323
+ * array. Use this to request image, audio, video, or non-JSON text
5324
+ * outputs with modality-specific controls.
5325
5325
  *
5326
5326
  * Entries are sent in order. The AI SDK call-level `responseFormat: {
5327
5327
  * type: 'json', schema }` still drives JSON-mode and adds a matching
@@ -5358,6 +5358,14 @@ var googleInteractionsLanguageModelOptions = lazySchema14(
5358
5358
  z18.object({
5359
5359
  type: z18.literal("audio"),
5360
5360
  mimeType: z18.string().nullish()
5361
+ }).loose(),
5362
+ z18.object({
5363
+ type: z18.literal("video"),
5364
+ aspectRatio: z18.enum(["16:9", "9:16"]).nullish(),
5365
+ resolution: z18.enum(["360p", "720p", "1080p", "4k"]).nullish(),
5366
+ duration: z18.string().nullish(),
5367
+ delivery: z18.enum(["inline", "uri"]).nullish(),
5368
+ gcsUri: z18.string().nullish()
5361
5369
  }).loose()
5362
5370
  ])
5363
5371
  ).nullish(),
@@ -6258,7 +6266,7 @@ var GoogleInteractionsLanguageModel = class {
6258
6266
  };
6259
6267
  }
6260
6268
  async getArgs(options) {
6261
- 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;
6269
+ 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;
6262
6270
  const warnings = [];
6263
6271
  const opts = await parseProviderOptions6({
6264
6272
  provider: "google",
@@ -6334,6 +6342,17 @@ var GoogleInteractionsLanguageModel = class {
6334
6342
  mime_type: (_g = entry.mimeType) != null ? _g : void 0
6335
6343
  })
6336
6344
  );
6345
+ } else if (entry.type === "video") {
6346
+ responseFormatEntries.push(
6347
+ pruneUndefined({
6348
+ type: "video",
6349
+ aspect_ratio: (_h = entry.aspectRatio) != null ? _h : void 0,
6350
+ resolution: (_i = entry.resolution) != null ? _i : void 0,
6351
+ duration: (_j = entry.duration) != null ? _j : void 0,
6352
+ delivery: (_k = entry.delivery) != null ? _k : void 0,
6353
+ gcs_uri: (_l = entry.gcsUri) != null ? _l : void 0
6354
+ })
6355
+ );
6337
6356
  }
6338
6357
  }
6339
6358
  }
@@ -6343,13 +6362,13 @@ var GoogleInteractionsLanguageModel = class {
6343
6362
  warnings: convWarnings
6344
6363
  } = convertToGoogleInteractionsInput({
6345
6364
  prompt: options.prompt,
6346
- previousInteractionId: (_h = opts == null ? void 0 : opts.previousInteractionId) != null ? _h : void 0,
6347
- store: (_i = opts == null ? void 0 : opts.store) != null ? _i : void 0,
6348
- mediaResolution: (_j = opts == null ? void 0 : opts.mediaResolution) != null ? _j : void 0
6365
+ previousInteractionId: (_m = opts == null ? void 0 : opts.previousInteractionId) != null ? _m : void 0,
6366
+ store: (_n = opts == null ? void 0 : opts.store) != null ? _n : void 0,
6367
+ mediaResolution: (_o = opts == null ? void 0 : opts.mediaResolution) != null ? _o : void 0
6349
6368
  });
6350
6369
  warnings.push(...convWarnings);
6351
6370
  let systemInstruction = convertedSystemInstruction;
6352
- const optionSystemInstruction = (_k = opts == null ? void 0 : opts.systemInstruction) != null ? _k : void 0;
6371
+ const optionSystemInstruction = (_p = opts == null ? void 0 : opts.systemInstruction) != null ? _p : void 0;
6353
6372
  if (systemInstruction != null && optionSystemInstruction != null) {
6354
6373
  warnings.push({
6355
6374
  type: "other",
@@ -6388,14 +6407,14 @@ var GoogleInteractionsLanguageModel = class {
6388
6407
  generationConfig = void 0;
6389
6408
  } else {
6390
6409
  generationConfig = pruneUndefined({
6391
- temperature: (_l = options.temperature) != null ? _l : void 0,
6392
- top_p: (_m = options.topP) != null ? _m : void 0,
6393
- top_k: (_n = options.topK) != null ? _n : void 0,
6394
- seed: (_o = options.seed) != null ? _o : void 0,
6410
+ temperature: (_q = options.temperature) != null ? _q : void 0,
6411
+ top_p: (_r = options.topP) != null ? _r : void 0,
6412
+ top_k: (_s = options.topK) != null ? _s : void 0,
6413
+ seed: (_t = options.seed) != null ? _t : void 0,
6395
6414
  stop_sequences: options.stopSequences != null && options.stopSequences.length > 0 ? options.stopSequences : void 0,
6396
- max_output_tokens: (_p = options.maxOutputTokens) != null ? _p : void 0,
6397
- thinking_level: (_q = opts == null ? void 0 : opts.thinkingLevel) != null ? _q : void 0,
6398
- thinking_summaries: (_r = opts == null ? void 0 : opts.thinkingSummaries) != null ? _r : void 0,
6415
+ max_output_tokens: (_u = options.maxOutputTokens) != null ? _u : void 0,
6416
+ thinking_level: (_v = opts == null ? void 0 : opts.thinkingLevel) != null ? _v : void 0,
6417
+ thinking_summaries: (_w = opts == null ? void 0 : opts.thinkingSummaries) != null ? _w : void 0,
6399
6418
  tool_choice: toolChoiceForBody
6400
6419
  });
6401
6420
  if ((opts == null ? void 0 : opts.imageConfig) != null) {
@@ -6422,9 +6441,9 @@ var GoogleInteractionsLanguageModel = class {
6422
6441
  if (ac.type === "deep-research") {
6423
6442
  agentConfig = pruneUndefined({
6424
6443
  type: "deep-research",
6425
- thinking_summaries: (_s = ac.thinkingSummaries) != null ? _s : void 0,
6426
- visualization: (_t = ac.visualization) != null ? _t : void 0,
6427
- collaborative_planning: (_u = ac.collaborativePlanning) != null ? _u : void 0
6444
+ thinking_summaries: (_x = ac.thinkingSummaries) != null ? _x : void 0,
6445
+ visualization: (_y = ac.visualization) != null ? _y : void 0,
6446
+ collaborative_planning: (_z = ac.collaborativePlanning) != null ? _z : void 0
6428
6447
  });
6429
6448
  } else if (ac.type === "dynamic") {
6430
6449
  agentConfig = { type: "dynamic" };
@@ -6441,7 +6460,7 @@ var GoogleInteractionsLanguageModel = class {
6441
6460
  environment = opts.environment;
6442
6461
  } else {
6443
6462
  const env = opts.environment;
6444
- const sources = (_v = env.sources) == null ? void 0 : _v.map((s) => {
6463
+ const sources = (_A = env.sources) == null ? void 0 : _A.map((s) => {
6445
6464
  var _a2;
6446
6465
  if (s.type === "inline") {
6447
6466
  return {
@@ -6486,20 +6505,20 @@ var GoogleInteractionsLanguageModel = class {
6486
6505
  tools: toolsForBody,
6487
6506
  response_format: responseFormatEntries.length > 0 ? responseFormatEntries : void 0,
6488
6507
  response_modalities: (opts == null ? void 0 : opts.responseModalities) != null ? opts.responseModalities : void 0,
6489
- previous_interaction_id: (_w = opts == null ? void 0 : opts.previousInteractionId) != null ? _w : void 0,
6490
- service_tier: (_x = opts == null ? void 0 : opts.serviceTier) != null ? _x : void 0,
6491
- store: (_y = opts == null ? void 0 : opts.store) != null ? _y : void 0,
6508
+ previous_interaction_id: (_B = opts == null ? void 0 : opts.previousInteractionId) != null ? _B : void 0,
6509
+ service_tier: (_C = opts == null ? void 0 : opts.serviceTier) != null ? _C : void 0,
6510
+ store: (_D = opts == null ? void 0 : opts.store) != null ? _D : void 0,
6492
6511
  generation_config: generationConfig != null && Object.keys(generationConfig).length > 0 ? generationConfig : void 0,
6493
6512
  agent_config: agentConfig,
6494
6513
  environment,
6495
- background: (_z = opts == null ? void 0 : opts.background) != null ? _z : void 0
6514
+ background: (_E = opts == null ? void 0 : opts.background) != null ? _E : void 0
6496
6515
  });
6497
6516
  return {
6498
6517
  args,
6499
6518
  warnings,
6500
6519
  isAgent,
6501
6520
  isBackground: (opts == null ? void 0 : opts.background) === true,
6502
- pollingTimeoutMs: (_A = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _A : void 0
6521
+ pollingTimeoutMs: (_F = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _F : void 0
6503
6522
  };
6504
6523
  }
6505
6524
  async doGenerate(options) {