@ai-sdk/google 4.0.47 → 4.0.49

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.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "@ai-sdk/provider-utils";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "4.0.47" : "0.0.0-test";
10
+ var VERSION = true ? "4.0.49" : "0.0.0-test";
11
11
 
12
12
  // src/google-embedding-model.ts
13
13
  import {
@@ -303,21 +303,37 @@ import {
303
303
  UnsupportedFunctionalityError
304
304
  } from "@ai-sdk/provider";
305
305
  function convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {
306
+ const rootSchema = typeof jsonSchema === "object" ? jsonSchema : void 0;
307
+ return convertJSONSchemaDefinition(jsonSchema, isRoot, {
308
+ definitions: rootSchema == null ? void 0 : rootSchema.definitions,
309
+ dollarDefinitions: rootSchema == null ? void 0 : rootSchema.$defs,
310
+ resolvingReferences: /* @__PURE__ */ new Set()
311
+ });
312
+ }
313
+ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
306
314
  if (jsonSchema == null) {
307
315
  return void 0;
308
316
  }
317
+ if (typeof jsonSchema === "boolean") {
318
+ return { type: "boolean", properties: {} };
319
+ }
320
+ if (jsonSchema.$ref != null) {
321
+ return convertJSONSchemaReference({
322
+ jsonSchema,
323
+ reference: jsonSchema.$ref,
324
+ isRoot,
325
+ referenceContext
326
+ });
327
+ }
309
328
  if (isEmptyObjectSchema(jsonSchema)) {
310
329
  if (isRoot) {
311
330
  return void 0;
312
331
  }
313
- if (typeof jsonSchema === "object" && jsonSchema.description) {
332
+ if (jsonSchema.description) {
314
333
  return { type: "object", description: jsonSchema.description };
315
334
  }
316
335
  return { type: "object" };
317
336
  }
318
- if (typeof jsonSchema === "boolean") {
319
- return { type: "boolean", properties: {} };
320
- }
321
337
  const {
322
338
  type,
323
339
  description,
@@ -359,18 +375,20 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {
359
375
  if (properties != null) {
360
376
  result.properties = Object.entries(properties).reduce(
361
377
  (acc, [key, value]) => {
362
- acc[key] = convertJSONSchemaToOpenAPISchema(value, false);
378
+ acc[key] = convertJSONSchemaDefinition(value, false, referenceContext);
363
379
  return acc;
364
380
  },
365
381
  {}
366
382
  );
367
383
  }
368
384
  if (items) {
369
- result.items = Array.isArray(items) ? items.map((item) => convertJSONSchemaToOpenAPISchema(item, false)) : convertJSONSchemaToOpenAPISchema(items, false);
385
+ result.items = Array.isArray(items) ? items.map(
386
+ (item) => convertJSONSchemaDefinition(item, false, referenceContext)
387
+ ) : convertJSONSchemaDefinition(items, false, referenceContext);
370
388
  }
371
389
  if (allOf) {
372
390
  result.allOf = allOf.map(
373
- (item) => convertJSONSchemaToOpenAPISchema(item, false)
391
+ (item) => convertJSONSchemaDefinition(item, false, referenceContext)
374
392
  );
375
393
  }
376
394
  if (anyOf) {
@@ -381,9 +399,10 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {
381
399
  (schema) => !(typeof schema === "object" && (schema == null ? void 0 : schema.type) === "null")
382
400
  );
383
401
  if (nonNullSchemas.length === 1) {
384
- const converted = convertJSONSchemaToOpenAPISchema(
402
+ const converted = convertJSONSchemaDefinition(
385
403
  nonNullSchemas[0],
386
- false
404
+ false,
405
+ referenceContext
387
406
  );
388
407
  if (typeof converted === "object") {
389
408
  result.nullable = true;
@@ -391,19 +410,19 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {
391
410
  }
392
411
  } else {
393
412
  result.anyOf = nonNullSchemas.map(
394
- (item) => convertJSONSchemaToOpenAPISchema(item, false)
413
+ (item) => convertJSONSchemaDefinition(item, false, referenceContext)
395
414
  );
396
415
  result.nullable = true;
397
416
  }
398
417
  } else {
399
418
  result.anyOf = anyOf.map(
400
- (item) => convertJSONSchemaToOpenAPISchema(item, false)
419
+ (item) => convertJSONSchemaDefinition(item, false, referenceContext)
401
420
  );
402
421
  }
403
422
  }
404
423
  if (oneOf) {
405
424
  result.oneOf = oneOf.map(
406
- (item) => convertJSONSchemaToOpenAPISchema(item, false)
425
+ (item) => convertJSONSchemaDefinition(item, false, referenceContext)
407
426
  );
408
427
  }
409
428
  if (minLength !== void 0) {
@@ -411,6 +430,76 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {
411
430
  }
412
431
  return result;
413
432
  }
433
+ function convertJSONSchemaReference({
434
+ jsonSchema,
435
+ reference,
436
+ isRoot,
437
+ referenceContext
438
+ }) {
439
+ const { definition, referenceKey } = getReferencedDefinition(
440
+ reference,
441
+ referenceContext
442
+ );
443
+ if (referenceContext.resolvingReferences.has(referenceKey)) {
444
+ throw new UnsupportedFunctionalityError({
445
+ functionality: `recursive JSON Schema reference: ${reference}`,
446
+ message: "Google schema conversion does not support recursive JSON Schema references."
447
+ });
448
+ }
449
+ const resolvingReferences = new Set(referenceContext.resolvingReferences);
450
+ resolvingReferences.add(referenceKey);
451
+ const { $ref: _reference, ...siblingSchema } = jsonSchema;
452
+ const resolvedSchema = typeof definition === "boolean" ? definition ? siblingSchema : false : { ...definition, ...siblingSchema };
453
+ return convertJSONSchemaDefinition(resolvedSchema, isRoot, {
454
+ ...referenceContext,
455
+ resolvingReferences
456
+ });
457
+ }
458
+ function getReferencedDefinition(reference, referenceContext) {
459
+ const definitionSources = [
460
+ {
461
+ prefix: "#/$defs/",
462
+ definitions: referenceContext.dollarDefinitions
463
+ },
464
+ {
465
+ prefix: "#/definitions/",
466
+ definitions: referenceContext.definitions
467
+ }
468
+ ];
469
+ const source = definitionSources.find(
470
+ ({ prefix }) => reference.startsWith(prefix)
471
+ );
472
+ const encodedDefinitionName = source ? reference.slice(source.prefix.length) : void 0;
473
+ if (source == null || encodedDefinitionName == null || encodedDefinitionName.length === 0 || encodedDefinitionName.includes("/")) {
474
+ throwUnsupportedReference(reference);
475
+ }
476
+ let decodedDefinitionName;
477
+ try {
478
+ decodedDefinitionName = decodeURIComponent(encodedDefinitionName);
479
+ } catch (e) {
480
+ throwUnsupportedReference(reference);
481
+ }
482
+ if (decodedDefinitionName.includes("/") || /~(?![01])/u.test(decodedDefinitionName) || source.definitions == null) {
483
+ throwUnsupportedReference(reference);
484
+ }
485
+ const definitionName = decodedDefinitionName.replace(
486
+ /~[01]/g,
487
+ (match) => match === "~1" ? "/" : "~"
488
+ );
489
+ if (!Object.prototype.hasOwnProperty.call(source.definitions, definitionName)) {
490
+ throwUnsupportedReference(reference);
491
+ }
492
+ return {
493
+ definition: source.definitions[definitionName],
494
+ referenceKey: `${source.prefix}${definitionName}`
495
+ };
496
+ }
497
+ function throwUnsupportedReference(reference) {
498
+ throw new UnsupportedFunctionalityError({
499
+ functionality: `JSON Schema reference: ${reference}`,
500
+ message: "Google schema conversion only supports references to direct children of root-level $defs or definitions."
501
+ });
502
+ }
414
503
  function addEnumToSchema({
415
504
  values,
416
505
  type,
@@ -1143,13 +1232,13 @@ function isKnownPreGemini2Model(modelId) {
1143
1232
  return gemini1ModelPattern.test(modelId) || /(^|\/)gemini-pro(?:-vision)?$/i.test(modelId) || /(^|\/)gemini-robotics-er-1\.5(?:[.-]|$)/i.test(modelId);
1144
1233
  }
1145
1234
  function getGoogleModelCapabilities(modelId) {
1146
- const isGeminiModel2 = geminiModelPattern.test(modelId);
1235
+ const isGeminiModel = geminiModelPattern.test(modelId);
1147
1236
  const isGemini2Model = gemini2ModelPattern.test(modelId);
1148
1237
  const isKnownPreGemini2 = isKnownPreGemini2Model(modelId);
1149
1238
  const isKnownOlderModel = isKnownPreGemini2 || isGemini2Model;
1150
- const usesGemini3Features = isGeminiModel2 && !isKnownOlderModel;
1239
+ const usesGemini3Features = isGeminiModel && !isKnownOlderModel;
1151
1240
  return {
1152
- supportsGemini2Tools: isGeminiModel2 && !isKnownPreGemini2 || modelId.toLowerCase().includes("nano-banana"),
1241
+ supportsGemini2Tools: isGeminiModel && !isKnownPreGemini2 || modelId.toLowerCase().includes("nano-banana"),
1153
1242
  supportsFileSearch: gemini25ModelPattern.test(modelId) || usesGemini3Features,
1154
1243
  usesGemini3Features
1155
1244
  };
@@ -3017,32 +3106,20 @@ var googleTools = {
3017
3106
 
3018
3107
  // src/google-image-model.ts
3019
3108
  import {
3020
- combineHeaders as combineHeaders3,
3021
3109
  convertToBase64 as convertToBase642,
3022
- createJsonResponseHandler as createJsonResponseHandler3,
3023
3110
  generateId as defaultGenerateId,
3024
- lazySchema as lazySchema13,
3025
3111
  parseProviderOptions as parseProviderOptions3,
3026
- postJsonToApi as postJsonToApi3,
3027
- resolve as resolve3,
3028
3112
  serializeModelOptions as serializeModelOptions3,
3029
3113
  WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE3,
3030
- WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE3,
3031
- zodSchema as zodSchema13
3114
+ WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE3
3032
3115
  } from "@ai-sdk/provider-utils";
3033
- import { z as z14 } from "zod/v4";
3034
3116
 
3035
3117
  // src/google-image-model-options.ts
3036
- import {
3037
- lazySchema as lazySchema12,
3038
- zodSchema as zodSchema12
3039
- } from "@ai-sdk/provider-utils";
3118
+ import { lazySchema as lazySchema12, zodSchema as zodSchema12 } from "@ai-sdk/provider-utils";
3040
3119
  import { z as z13 } from "zod/v4";
3041
3120
  var googleImageModelOptionsSchema = lazySchema12(
3042
3121
  () => zodSchema12(
3043
3122
  z13.object({
3044
- personGeneration: z13.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
3045
- aspectRatio: z13.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish(),
3046
3123
  /**
3047
3124
  * Enable Google Search grounding for Gemini image models. The value is
3048
3125
  * forwarded as the args of the `google.tools.googleSearch` provider
@@ -3078,121 +3155,18 @@ var GoogleImageModel = class _GoogleImageModel {
3078
3155
  if (this.settings.maxImagesPerCall != null) {
3079
3156
  return this.settings.maxImagesPerCall;
3080
3157
  }
3081
- if (isGeminiModel(this.modelId)) {
3082
- return 10;
3083
- }
3084
- return 4;
3158
+ return 10;
3085
3159
  }
3086
3160
  get provider() {
3087
3161
  return this.config.provider;
3088
3162
  }
3089
3163
  async doGenerate(options) {
3090
- if (isGeminiModel(this.modelId)) {
3091
- return this.doGenerateGemini(options);
3092
- }
3093
- return this.doGenerateImagen(options);
3094
- }
3095
- async doGenerateImagen(options) {
3096
- var _a, _b, _c;
3097
- const {
3098
- prompt,
3099
- n = 1,
3100
- size,
3101
- aspectRatio = "1:1",
3102
- seed,
3103
- providerOptions,
3104
- headers,
3105
- abortSignal,
3106
- files,
3107
- mask
3108
- } = options;
3109
- const warnings = [];
3110
- if (files != null && files.length > 0) {
3111
- throw new Error(
3112
- "Google Gemini API does not support image editing with Imagen models. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities."
3113
- );
3114
- }
3115
- if (mask != null) {
3164
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3165
+ if (!this.modelId.startsWith("gemini-")) {
3116
3166
  throw new Error(
3117
- "Google Gemini API does not support image editing with masks. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities."
3167
+ "Google image models other than Gemini are no longer supported. Use a model ID that starts with `gemini-`."
3118
3168
  );
3119
3169
  }
3120
- if (size != null) {
3121
- warnings.push({
3122
- type: "unsupported",
3123
- feature: "size",
3124
- details: "This model does not support the `size` option. Use `aspectRatio` instead."
3125
- });
3126
- }
3127
- if (seed != null) {
3128
- warnings.push({
3129
- type: "unsupported",
3130
- feature: "seed",
3131
- details: "This model does not support the `seed` option through this provider."
3132
- });
3133
- }
3134
- const googleOptions = await parseProviderOptions3({
3135
- provider: "google",
3136
- providerOptions,
3137
- schema: googleImageModelOptionsSchema
3138
- });
3139
- const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
3140
- const parameters = {
3141
- sampleCount: n
3142
- };
3143
- if (aspectRatio != null) {
3144
- parameters.aspectRatio = aspectRatio;
3145
- }
3146
- if (googleOptions) {
3147
- const { googleSearch: imagenGoogleSearch, ...imagenOptions } = googleOptions;
3148
- if (imagenGoogleSearch != null) {
3149
- warnings.push({
3150
- type: "unsupported",
3151
- feature: "googleSearch",
3152
- details: "Google Search grounding is only supported on Gemini image models."
3153
- });
3154
- }
3155
- Object.assign(parameters, imagenOptions);
3156
- }
3157
- const body = {
3158
- instances: [{ prompt }],
3159
- parameters
3160
- };
3161
- const { responseHeaders, value: response } = await postJsonToApi3({
3162
- url: `${this.config.baseURL}/models/${this.modelId}:predict`,
3163
- headers: combineHeaders3(
3164
- this.config.headers ? await resolve3(this.config.headers) : void 0,
3165
- headers
3166
- ),
3167
- body,
3168
- failedResponseHandler: googleFailedResponseHandler,
3169
- successfulResponseHandler: createJsonResponseHandler3(
3170
- googleImageResponseSchema
3171
- ),
3172
- abortSignal,
3173
- fetch: this.config.fetch
3174
- });
3175
- return {
3176
- images: response.predictions.map(
3177
- (p) => p.bytesBase64Encoded
3178
- ),
3179
- warnings,
3180
- providerMetadata: {
3181
- google: {
3182
- images: response.predictions.map(() => ({
3183
- // Add any prediction-specific metadata here
3184
- }))
3185
- }
3186
- },
3187
- response: {
3188
- timestamp: currentDate,
3189
- modelId: this.modelId,
3190
- headers: responseHeaders
3191
- }
3192
- };
3193
- }
3194
- async doGenerateGemini(options) {
3195
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3196
3170
  const {
3197
3171
  prompt,
3198
3172
  n,
@@ -3255,7 +3229,12 @@ var GoogleImageModel = class _GoogleImageModel {
3255
3229
  providerOptions,
3256
3230
  schema: googleImageModelOptionsSchema
3257
3231
  });
3258
- const { googleSearch: _strippedGoogleSearch, ...passthroughGoogleOptions } = (_a = providerOptions == null ? void 0 : providerOptions.google) != null ? _a : {};
3232
+ const {
3233
+ googleSearch: _strippedGoogleSearch,
3234
+ responseModalities: _strippedResponseModalities,
3235
+ imageConfig: userImageConfig,
3236
+ ...passthroughGoogleOptions
3237
+ } = (_a = providerOptions == null ? void 0 : providerOptions.google) != null ? _a : {};
3259
3238
  const languageModel = new GoogleLanguageModel(this.modelId, {
3260
3239
  provider: this.config.provider,
3261
3240
  baseURL: this.config.baseURL,
@@ -3268,11 +3247,14 @@ var GoogleImageModel = class _GoogleImageModel {
3268
3247
  seed,
3269
3248
  providerOptions: {
3270
3249
  google: {
3250
+ ...passthroughGoogleOptions,
3271
3251
  responseModalities: ["IMAGE"],
3272
- imageConfig: aspectRatio ? {
3273
- aspectRatio
3274
- } : void 0,
3275
- ...passthroughGoogleOptions
3252
+ imageConfig: aspectRatio != null || userImageConfig != null ? {
3253
+ ...userImageConfig,
3254
+ ...aspectRatio != null ? {
3255
+ aspectRatio
3256
+ } : {}
3257
+ } : void 0
3276
3258
  }
3277
3259
  },
3278
3260
  tools: (googleImageOptions == null ? void 0 : googleImageOptions.googleSearch) != null ? [
@@ -3316,32 +3298,22 @@ var GoogleImageModel = class _GoogleImageModel {
3316
3298
  };
3317
3299
  }
3318
3300
  };
3319
- function isGeminiModel(modelId) {
3320
- return modelId.startsWith("gemini-");
3321
- }
3322
- var googleImageResponseSchema = lazySchema13(
3323
- () => zodSchema13(
3324
- z14.object({
3325
- predictions: z14.array(z14.object({ bytesBase64Encoded: z14.string() })).default([])
3326
- })
3327
- )
3328
- );
3329
3301
 
3330
3302
  // src/google-files.ts
3331
3303
  import {
3332
3304
  AISDKError
3333
3305
  } from "@ai-sdk/provider";
3334
3306
  import {
3335
- combineHeaders as combineHeaders4,
3307
+ combineHeaders as combineHeaders3,
3336
3308
  convertInlineFileDataToUint8Array,
3337
- createJsonResponseHandler as createJsonResponseHandler4,
3309
+ createJsonResponseHandler as createJsonResponseHandler3,
3338
3310
  delay,
3339
- lazySchema as lazySchema14,
3311
+ lazySchema as lazySchema13,
3340
3312
  parseProviderOptions as parseProviderOptions4,
3341
- zodSchema as zodSchema14,
3313
+ zodSchema as zodSchema13,
3342
3314
  getFromApi
3343
3315
  } from "@ai-sdk/provider-utils";
3344
- import { z as z15 } from "zod/v4";
3316
+ import { z as z14 } from "zod/v4";
3345
3317
  var GoogleFiles = class {
3346
3318
  constructor(config) {
3347
3319
  this.config = config;
@@ -3428,8 +3400,8 @@ var GoogleFiles = class {
3428
3400
  const { value: fileStatus } = await getFromApi({
3429
3401
  url: `${this.config.baseURL}/${file.name}`,
3430
3402
  validateUrl: false,
3431
- headers: combineHeaders4(resolvedHeaders),
3432
- successfulResponseHandler: createJsonResponseHandler4(
3403
+ headers: combineHeaders3(resolvedHeaders),
3404
+ successfulResponseHandler: createJsonResponseHandler3(
3433
3405
  googleFileResponseSchema
3434
3406
  ),
3435
3407
  failedResponseHandler: googleFailedResponseHandler,
@@ -3464,28 +3436,28 @@ var GoogleFiles = class {
3464
3436
  };
3465
3437
  }
3466
3438
  };
3467
- var googleFileResponseSchema = lazySchema14(
3468
- () => zodSchema14(
3469
- z15.object({
3470
- name: z15.string(),
3471
- displayName: z15.string().nullish(),
3472
- mimeType: z15.string(),
3473
- sizeBytes: z15.string().nullish(),
3474
- createTime: z15.string().nullish(),
3475
- updateTime: z15.string().nullish(),
3476
- expirationTime: z15.string().nullish(),
3477
- sha256Hash: z15.string().nullish(),
3478
- uri: z15.string(),
3479
- state: z15.string()
3439
+ var googleFileResponseSchema = lazySchema13(
3440
+ () => zodSchema13(
3441
+ z14.object({
3442
+ name: z14.string(),
3443
+ displayName: z14.string().nullish(),
3444
+ mimeType: z14.string(),
3445
+ sizeBytes: z14.string().nullish(),
3446
+ createTime: z14.string().nullish(),
3447
+ updateTime: z14.string().nullish(),
3448
+ expirationTime: z14.string().nullish(),
3449
+ sha256Hash: z14.string().nullish(),
3450
+ uri: z14.string(),
3451
+ state: z14.string()
3480
3452
  })
3481
3453
  )
3482
3454
  );
3483
- var googleFilesUploadOptionsSchema = lazySchema14(
3484
- () => zodSchema14(
3485
- z15.looseObject({
3486
- displayName: z15.string().nullish(),
3487
- pollIntervalMs: z15.number().positive().nullish(),
3488
- pollTimeoutMs: z15.number().positive().nullish()
3455
+ var googleFilesUploadOptionsSchema = lazySchema13(
3456
+ () => zodSchema13(
3457
+ z14.looseObject({
3458
+ displayName: z14.string().nullish(),
3459
+ pollIntervalMs: z14.number().positive().nullish(),
3460
+ pollTimeoutMs: z14.number().positive().nullish()
3489
3461
  })
3490
3462
  )
3491
3463
  );
@@ -3495,31 +3467,31 @@ import {
3495
3467
  AISDKError as AISDKError2
3496
3468
  } from "@ai-sdk/provider";
3497
3469
  import {
3498
- combineHeaders as combineHeaders5,
3470
+ combineHeaders as combineHeaders4,
3499
3471
  convertUint8ArrayToBase64,
3500
- createJsonResponseHandler as createJsonResponseHandler5,
3472
+ createJsonResponseHandler as createJsonResponseHandler4,
3501
3473
  getFromApi as getFromApi2,
3502
3474
  isSameOrigin,
3503
3475
  parseProviderOptions as parseProviderOptions5,
3504
- postJsonToApi as postJsonToApi4,
3505
- resolve as resolve4
3476
+ postJsonToApi as postJsonToApi3,
3477
+ resolve as resolve3
3506
3478
  } from "@ai-sdk/provider-utils";
3507
- import { z as z17 } from "zod/v4";
3479
+ import { z as z16 } from "zod/v4";
3508
3480
 
3509
3481
  // src/google-video-model-options.ts
3510
- import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
3511
- import { z as z16 } from "zod/v4";
3512
- var googleVideoModelOptionsSchema = lazySchema15(
3513
- () => zodSchema15(
3514
- z16.looseObject({
3515
- pollIntervalMs: z16.number().positive().nullish(),
3516
- pollTimeoutMs: z16.number().positive().nullish(),
3517
- personGeneration: z16.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
3518
- negativePrompt: z16.string().nullish(),
3519
- referenceImages: z16.array(
3520
- z16.object({
3521
- bytesBase64Encoded: z16.string().nullish(),
3522
- gcsUri: z16.string().nullish()
3482
+ import { lazySchema as lazySchema14, zodSchema as zodSchema14 } from "@ai-sdk/provider-utils";
3483
+ import { z as z15 } from "zod/v4";
3484
+ var googleVideoModelOptionsSchema = lazySchema14(
3485
+ () => zodSchema14(
3486
+ z15.looseObject({
3487
+ pollIntervalMs: z15.number().positive().nullish(),
3488
+ pollTimeoutMs: z15.number().positive().nullish(),
3489
+ personGeneration: z15.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
3490
+ negativePrompt: z15.string().nullish(),
3491
+ referenceImages: z15.array(
3492
+ z15.object({
3493
+ bytesBase64Encoded: z15.string().nullish(),
3494
+ gcsUri: z15.string().nullish()
3523
3495
  })
3524
3496
  ).nullish()
3525
3497
  })
@@ -3693,7 +3665,7 @@ var GoogleVideoModel = class {
3693
3665
  }
3694
3666
  const videos = [];
3695
3667
  const videoMetadata = [];
3696
- const resolvedHeaders = await resolve4(this.config.headers);
3668
+ const resolvedHeaders = await resolve3(this.config.headers);
3697
3669
  const apiKey = resolvedHeaders == null ? void 0 : resolvedHeaders["x-goog-api-key"];
3698
3670
  for (const generatedSample of response.generateVideoResponse.generatedSamples) {
3699
3671
  if ((_b = generatedSample.video) == null ? void 0 : _b.uri) {
@@ -3734,17 +3706,17 @@ var GoogleVideoModel = class {
3734
3706
  var _a, _b, _c;
3735
3707
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
3736
3708
  const { instances, parameters, warnings } = await this.buildRequest(options);
3737
- const { value: operation, responseHeaders } = await postJsonToApi4({
3709
+ const { value: operation, responseHeaders } = await postJsonToApi3({
3738
3710
  url: `${this.config.baseURL}/models/${this.modelId}:predictLongRunning`,
3739
- headers: combineHeaders5(
3740
- await resolve4(this.config.headers),
3711
+ headers: combineHeaders4(
3712
+ await resolve3(this.config.headers),
3741
3713
  options.headers
3742
3714
  ),
3743
3715
  body: {
3744
3716
  instances,
3745
3717
  parameters
3746
3718
  },
3747
- successfulResponseHandler: createJsonResponseHandler5(
3719
+ successfulResponseHandler: createJsonResponseHandler4(
3748
3720
  googleOperationSchema
3749
3721
  ),
3750
3722
  failedResponseHandler: googleFailedResponseHandler,
@@ -3775,11 +3747,11 @@ var GoogleVideoModel = class {
3775
3747
  const { value: statusOperation, responseHeaders } = await getFromApi2({
3776
3748
  url: `${this.config.baseURL}/${operationName}`,
3777
3749
  validateUrl: false,
3778
- headers: combineHeaders5(
3779
- await resolve4(this.config.headers),
3750
+ headers: combineHeaders4(
3751
+ await resolve3(this.config.headers),
3780
3752
  options.headers
3781
3753
  ),
3782
- successfulResponseHandler: createJsonResponseHandler5(
3754
+ successfulResponseHandler: createJsonResponseHandler4(
3783
3755
  googleOperationSchema
3784
3756
  ),
3785
3757
  failedResponseHandler: googleFailedResponseHandler,
@@ -3815,20 +3787,20 @@ var GoogleVideoModel = class {
3815
3787
  );
3816
3788
  }
3817
3789
  };
3818
- var googleOperationSchema = z17.object({
3819
- name: z17.string().nullish(),
3820
- done: z17.boolean().nullish(),
3821
- error: z17.object({
3822
- code: z17.number().nullish(),
3823
- message: z17.string(),
3824
- status: z17.string().nullish()
3790
+ var googleOperationSchema = z16.object({
3791
+ name: z16.string().nullish(),
3792
+ done: z16.boolean().nullish(),
3793
+ error: z16.object({
3794
+ code: z16.number().nullish(),
3795
+ message: z16.string(),
3796
+ status: z16.string().nullish()
3825
3797
  }).nullish(),
3826
- response: z17.object({
3827
- generateVideoResponse: z17.object({
3828
- generatedSamples: z17.array(
3829
- z17.object({
3830
- video: z17.object({
3831
- uri: z17.string().nullish()
3798
+ response: z16.object({
3799
+ generateVideoResponse: z16.object({
3800
+ generatedSamples: z16.array(
3801
+ z16.object({
3802
+ video: z16.object({
3803
+ uri: z16.string().nullish()
3832
3804
  }).nullish()
3833
3805
  })
3834
3806
  ).nullish()
@@ -3838,31 +3810,31 @@ var googleOperationSchema = z17.object({
3838
3810
 
3839
3811
  // src/google-speech-model.ts
3840
3812
  import {
3841
- combineHeaders as combineHeaders6,
3813
+ combineHeaders as combineHeaders5,
3842
3814
  convertBase64ToUint8Array,
3843
- createJsonResponseHandler as createJsonResponseHandler6,
3815
+ createJsonResponseHandler as createJsonResponseHandler5,
3844
3816
  parseProviderOptions as parseProviderOptions6,
3845
- postJsonToApi as postJsonToApi5,
3846
- resolve as resolve5,
3817
+ postJsonToApi as postJsonToApi4,
3818
+ resolve as resolve4,
3847
3819
  serializeModelOptions as serializeModelOptions4,
3848
3820
  WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE4,
3849
3821
  WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE4
3850
3822
  } from "@ai-sdk/provider-utils";
3851
3823
 
3852
3824
  // src/google-speech-api.ts
3853
- import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
3854
- import { z as z18 } from "zod/v4";
3855
- var googleSpeechResponseSchema = lazySchema16(
3856
- () => zodSchema16(
3857
- z18.object({
3858
- candidates: z18.array(
3859
- z18.object({
3860
- content: z18.object({
3861
- parts: z18.array(
3862
- z18.object({
3863
- inlineData: z18.object({
3864
- mimeType: z18.string().nullish(),
3865
- data: z18.string().nullish()
3825
+ import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
3826
+ import { z as z17 } from "zod/v4";
3827
+ var googleSpeechResponseSchema = lazySchema15(
3828
+ () => zodSchema15(
3829
+ z17.object({
3830
+ candidates: z17.array(
3831
+ z17.object({
3832
+ content: z17.object({
3833
+ parts: z17.array(
3834
+ z17.object({
3835
+ inlineData: z17.object({
3836
+ mimeType: z17.string().nullish(),
3837
+ data: z17.string().nullish()
3866
3838
  }).nullish()
3867
3839
  })
3868
3840
  ).nullish()
@@ -3875,19 +3847,19 @@ var googleSpeechResponseSchema = lazySchema16(
3875
3847
 
3876
3848
  // src/google-speech-model-options.ts
3877
3849
  import {
3878
- lazySchema as lazySchema17,
3879
- zodSchema as zodSchema17
3850
+ lazySchema as lazySchema16,
3851
+ zodSchema as zodSchema16
3880
3852
  } from "@ai-sdk/provider-utils";
3881
- import { z as z19 } from "zod/v4";
3882
- var prebuiltVoiceConfigSchema = z19.object({
3883
- voiceName: z19.string()
3853
+ import { z as z18 } from "zod/v4";
3854
+ var prebuiltVoiceConfigSchema = z18.object({
3855
+ voiceName: z18.string()
3884
3856
  });
3885
- var voiceConfigSchema = z19.object({
3857
+ var voiceConfigSchema = z18.object({
3886
3858
  prebuiltVoiceConfig: prebuiltVoiceConfigSchema
3887
3859
  });
3888
- var googleSpeechProviderOptionsSchema = lazySchema17(
3889
- () => zodSchema17(
3890
- z19.object({
3860
+ var googleSpeechProviderOptionsSchema = lazySchema16(
3861
+ () => zodSchema16(
3862
+ z18.object({
3891
3863
  /**
3892
3864
  * Multi-speaker configuration for dialogue audio. When provided, this
3893
3865
  * overrides the top-level `voice`. The Gemini TTS API supports up to two
@@ -3895,10 +3867,10 @@ var googleSpeechProviderOptionsSchema = lazySchema17(
3895
3867
  *
3896
3868
  * https://ai.google.dev/gemini-api/docs/speech-generation#multi-speaker
3897
3869
  */
3898
- multiSpeakerVoiceConfig: z19.object({
3899
- speakerVoiceConfigs: z19.array(
3900
- z19.object({
3901
- speaker: z19.string(),
3870
+ multiSpeakerVoiceConfig: z18.object({
3871
+ speakerVoiceConfigs: z18.array(
3872
+ z18.object({
3873
+ speaker: z18.string(),
3902
3874
  voiceConfig: voiceConfigSchema
3903
3875
  })
3904
3876
  )
@@ -4012,15 +3984,15 @@ var GoogleSpeechModel = class _GoogleSpeechModel {
4012
3984
  value: response,
4013
3985
  responseHeaders,
4014
3986
  rawValue: rawResponse
4015
- } = await postJsonToApi5({
3987
+ } = await postJsonToApi4({
4016
3988
  url: `${this.config.baseURL}/models/${this.modelId}:generateContent`,
4017
- headers: combineHeaders6(
4018
- this.config.headers ? await resolve5(this.config.headers) : void 0,
3989
+ headers: combineHeaders5(
3990
+ this.config.headers ? await resolve4(this.config.headers) : void 0,
4019
3991
  options.headers
4020
3992
  ),
4021
3993
  body: requestBody,
4022
3994
  failedResponseHandler: googleFailedResponseHandler,
4023
- successfulResponseHandler: createJsonResponseHandler6(
3995
+ successfulResponseHandler: createJsonResponseHandler5(
4024
3996
  googleSpeechResponseSchema
4025
3997
  ),
4026
3998
  abortSignal: options.abortSignal,
@@ -4111,13 +4083,13 @@ function writeAscii(view, offset, text) {
4111
4083
 
4112
4084
  // src/interactions/google-interactions-language-model.ts
4113
4085
  import {
4114
- combineHeaders as combineHeaders8,
4086
+ combineHeaders as combineHeaders7,
4115
4087
  createEventSourceResponseHandler as createEventSourceResponseHandler3,
4116
- createJsonResponseHandler as createJsonResponseHandler8,
4088
+ createJsonResponseHandler as createJsonResponseHandler7,
4117
4089
  generateId as defaultGenerateId2,
4118
4090
  parseProviderOptions as parseProviderOptions7,
4119
- postJsonToApi as postJsonToApi6,
4120
- resolve as resolve6,
4091
+ postJsonToApi as postJsonToApi5,
4092
+ resolve as resolve5,
4121
4093
  serializeModelOptions as serializeModelOptions5,
4122
4094
  WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE5,
4123
4095
  WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE5
@@ -5253,33 +5225,33 @@ ${block.text}`
5253
5225
 
5254
5226
  // src/interactions/google-interactions-api.ts
5255
5227
  import {
5256
- lazySchema as lazySchema18,
5257
- zodSchema as zodSchema18
5228
+ lazySchema as lazySchema17,
5229
+ zodSchema as zodSchema17
5258
5230
  } from "@ai-sdk/provider-utils";
5259
- import { z as z20 } from "zod/v4";
5260
- var tokenByModalitySchema = () => z20.object({
5261
- modality: z20.string().nullish(),
5262
- tokens: z20.number().nullish()
5231
+ import { z as z19 } from "zod/v4";
5232
+ var tokenByModalitySchema = () => z19.object({
5233
+ modality: z19.string().nullish(),
5234
+ tokens: z19.number().nullish()
5263
5235
  }).loose();
5264
- var usageSchema2 = () => z20.object({
5265
- total_input_tokens: z20.number().nullish(),
5266
- total_output_tokens: z20.number().nullish(),
5267
- total_thought_tokens: z20.number().nullish(),
5268
- total_cached_tokens: z20.number().nullish(),
5269
- total_tool_use_tokens: z20.number().nullish(),
5270
- total_tokens: z20.number().nullish(),
5271
- input_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5272
- output_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5273
- cached_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5274
- tool_use_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5275
- grounding_tool_count: z20.array(
5276
- z20.object({
5277
- type: z20.string().nullish(),
5278
- count: z20.number().nullish()
5236
+ var usageSchema2 = () => z19.object({
5237
+ total_input_tokens: z19.number().nullish(),
5238
+ total_output_tokens: z19.number().nullish(),
5239
+ total_thought_tokens: z19.number().nullish(),
5240
+ total_cached_tokens: z19.number().nullish(),
5241
+ total_tool_use_tokens: z19.number().nullish(),
5242
+ total_tokens: z19.number().nullish(),
5243
+ input_tokens_by_modality: z19.array(tokenByModalitySchema()).nullish(),
5244
+ output_tokens_by_modality: z19.array(tokenByModalitySchema()).nullish(),
5245
+ cached_tokens_by_modality: z19.array(tokenByModalitySchema()).nullish(),
5246
+ tool_use_tokens_by_modality: z19.array(tokenByModalitySchema()).nullish(),
5247
+ grounding_tool_count: z19.array(
5248
+ z19.object({
5249
+ type: z19.string().nullish(),
5250
+ count: z19.number().nullish()
5279
5251
  }).loose()
5280
5252
  ).nullish()
5281
5253
  }).loose();
5282
- var interactionStatusSchema = () => z20.enum([
5254
+ var interactionStatusSchema = () => z19.enum([
5283
5255
  "in_progress",
5284
5256
  "requires_action",
5285
5257
  "completed",
@@ -5288,69 +5260,69 @@ var interactionStatusSchema = () => z20.enum([
5288
5260
  "incomplete"
5289
5261
  ]);
5290
5262
  var annotationSchema = () => {
5291
- const urlCitation = z20.object({
5292
- type: z20.literal("url_citation"),
5293
- url: z20.string().nullish(),
5294
- title: z20.string().nullish(),
5295
- start_index: z20.number().nullish(),
5296
- end_index: z20.number().nullish()
5263
+ const urlCitation = z19.object({
5264
+ type: z19.literal("url_citation"),
5265
+ url: z19.string().nullish(),
5266
+ title: z19.string().nullish(),
5267
+ start_index: z19.number().nullish(),
5268
+ end_index: z19.number().nullish()
5297
5269
  }).loose();
5298
- const fileCitation = z20.object({
5299
- type: z20.literal("file_citation"),
5300
- file_name: z20.string().nullish(),
5301
- document_uri: z20.string().nullish(),
5302
- url: z20.string().nullish(),
5303
- page_number: z20.number().nullish(),
5304
- media_id: z20.string().nullish(),
5305
- start_index: z20.number().nullish(),
5306
- end_index: z20.number().nullish(),
5307
- custom_metadata: z20.record(z20.string(), z20.unknown()).nullish()
5270
+ const fileCitation = z19.object({
5271
+ type: z19.literal("file_citation"),
5272
+ file_name: z19.string().nullish(),
5273
+ document_uri: z19.string().nullish(),
5274
+ url: z19.string().nullish(),
5275
+ page_number: z19.number().nullish(),
5276
+ media_id: z19.string().nullish(),
5277
+ start_index: z19.number().nullish(),
5278
+ end_index: z19.number().nullish(),
5279
+ custom_metadata: z19.record(z19.string(), z19.unknown()).nullish()
5308
5280
  }).loose();
5309
- const placeCitation = z20.object({
5310
- type: z20.literal("place_citation"),
5311
- name: z20.string().nullish(),
5312
- url: z20.string().nullish(),
5313
- place_id: z20.string().nullish(),
5314
- start_index: z20.number().nullish(),
5315
- end_index: z20.number().nullish()
5281
+ const placeCitation = z19.object({
5282
+ type: z19.literal("place_citation"),
5283
+ name: z19.string().nullish(),
5284
+ url: z19.string().nullish(),
5285
+ place_id: z19.string().nullish(),
5286
+ start_index: z19.number().nullish(),
5287
+ end_index: z19.number().nullish()
5316
5288
  }).loose();
5317
- return z20.union([
5289
+ return z19.union([
5318
5290
  urlCitation,
5319
5291
  fileCitation,
5320
5292
  placeCitation,
5321
- z20.object({ type: z20.string() }).loose()
5293
+ z19.object({ type: z19.string() }).loose()
5322
5294
  ]);
5323
5295
  };
5324
- var thoughtSummaryItemSchema = () => z20.object({
5325
- type: z20.string(),
5326
- text: z20.string().nullish(),
5327
- data: z20.string().nullish(),
5328
- mime_type: z20.string().nullish()
5296
+ var thoughtSummaryItemSchema = () => z19.object({
5297
+ type: z19.string(),
5298
+ text: z19.string().nullish(),
5299
+ data: z19.string().nullish(),
5300
+ mime_type: z19.string().nullish()
5329
5301
  }).loose();
5330
5302
  var contentBlockSchema = () => {
5331
- const textContent = z20.object({
5332
- type: z20.literal("text"),
5333
- text: z20.string(),
5334
- annotations: z20.array(annotationSchema()).nullish()
5303
+ const textContent = z19.object({
5304
+ type: z19.literal("text"),
5305
+ text: z19.string(),
5306
+ annotations: z19.array(annotationSchema()).nullish()
5335
5307
  }).loose();
5336
- const imageContent = z20.object({
5337
- type: z20.literal("image"),
5338
- data: z20.string().nullish(),
5339
- mime_type: z20.string().nullish(),
5340
- resolution: z20.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5341
- uri: z20.string().nullish()
5308
+ const imageContent = z19.object({
5309
+ type: z19.literal("image"),
5310
+ data: z19.string().nullish(),
5311
+ mime_type: z19.string().nullish(),
5312
+ resolution: z19.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5313
+ uri: z19.string().nullish()
5342
5314
  }).loose();
5343
- const videoContent = z20.object({
5344
- type: z20.literal("video"),
5345
- data: z20.string().nullish(),
5346
- mime_type: z20.string().nullish(),
5347
- uri: z20.string().nullish()
5315
+ const videoContent = z19.object({
5316
+ type: z19.literal("video"),
5317
+ data: z19.string().nullish(),
5318
+ mime_type: z19.string().nullish(),
5319
+ uri: z19.string().nullish()
5348
5320
  }).loose();
5349
- return z20.union([
5321
+ return z19.union([
5350
5322
  textContent,
5351
5323
  imageContent,
5352
5324
  videoContent,
5353
- z20.object({ type: z20.string() }).loose()
5325
+ z19.object({ type: z19.string() }).loose()
5354
5326
  ]);
5355
5327
  };
5356
5328
  var BUILTIN_TOOL_CALL_STEP_TYPES = [
@@ -5370,158 +5342,158 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
5370
5342
  "mcp_server_tool_result"
5371
5343
  ];
5372
5344
  var stepSchema = () => {
5373
- const userInputStep = z20.object({
5374
- type: z20.literal("user_input"),
5375
- content: z20.array(contentBlockSchema()).nullish()
5345
+ const userInputStep = z19.object({
5346
+ type: z19.literal("user_input"),
5347
+ content: z19.array(contentBlockSchema()).nullish()
5376
5348
  }).loose();
5377
- const modelOutputStep = z20.object({
5378
- type: z20.literal("model_output"),
5379
- content: z20.array(contentBlockSchema()).nullish()
5349
+ const modelOutputStep = z19.object({
5350
+ type: z19.literal("model_output"),
5351
+ content: z19.array(contentBlockSchema()).nullish()
5380
5352
  }).loose();
5381
- const functionCallStep = z20.object({
5382
- type: z20.literal("function_call"),
5383
- id: z20.string(),
5384
- name: z20.string(),
5385
- arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5386
- signature: z20.string().nullish()
5353
+ const functionCallStep = z19.object({
5354
+ type: z19.literal("function_call"),
5355
+ id: z19.string(),
5356
+ name: z19.string(),
5357
+ arguments: z19.record(z19.string(), z19.unknown()).nullish(),
5358
+ signature: z19.string().nullish()
5387
5359
  }).loose();
5388
- const thoughtStep = z20.object({
5389
- type: z20.literal("thought"),
5390
- signature: z20.string().nullish(),
5391
- summary: z20.array(thoughtSummaryItemSchema()).nullish()
5360
+ const thoughtStep = z19.object({
5361
+ type: z19.literal("thought"),
5362
+ signature: z19.string().nullish(),
5363
+ summary: z19.array(thoughtSummaryItemSchema()).nullish()
5392
5364
  }).loose();
5393
- const builtinToolCallStep = z20.object({
5394
- type: z20.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5395
- id: z20.string(),
5396
- arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5397
- name: z20.string().nullish(),
5398
- server_name: z20.string().nullish(),
5399
- search_type: z20.string().nullish(),
5400
- signature: z20.string().nullish()
5365
+ const builtinToolCallStep = z19.object({
5366
+ type: z19.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5367
+ id: z19.string(),
5368
+ arguments: z19.record(z19.string(), z19.unknown()).nullish(),
5369
+ name: z19.string().nullish(),
5370
+ server_name: z19.string().nullish(),
5371
+ search_type: z19.string().nullish(),
5372
+ signature: z19.string().nullish()
5401
5373
  }).loose();
5402
- const builtinToolResultStep = z20.object({
5403
- type: z20.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5404
- call_id: z20.string(),
5405
- result: z20.unknown().nullish(),
5406
- is_error: z20.boolean().nullish(),
5407
- name: z20.string().nullish(),
5408
- server_name: z20.string().nullish(),
5409
- signature: z20.string().nullish()
5374
+ const builtinToolResultStep = z19.object({
5375
+ type: z19.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5376
+ call_id: z19.string(),
5377
+ result: z19.unknown().nullish(),
5378
+ is_error: z19.boolean().nullish(),
5379
+ name: z19.string().nullish(),
5380
+ server_name: z19.string().nullish(),
5381
+ signature: z19.string().nullish()
5410
5382
  }).loose();
5411
- return z20.union([
5383
+ return z19.union([
5412
5384
  userInputStep,
5413
5385
  modelOutputStep,
5414
5386
  functionCallStep,
5415
5387
  thoughtStep,
5416
5388
  builtinToolCallStep,
5417
5389
  builtinToolResultStep,
5418
- z20.object({ type: z20.string() }).loose()
5390
+ z19.object({ type: z19.string() }).loose()
5419
5391
  ]);
5420
5392
  };
5421
- var googleInteractionsResponseSchema = lazySchema18(
5422
- () => zodSchema18(
5423
- z20.object({
5393
+ var googleInteractionsResponseSchema = lazySchema17(
5394
+ () => zodSchema17(
5395
+ z19.object({
5424
5396
  /*
5425
5397
  * `id` is omitted from the response body when `store: false` (fully
5426
5398
  * stateless mode) — there is no server-side interaction record for the
5427
5399
  * client to reference. `nullish` lets the schema accept that shape.
5428
5400
  */
5429
- id: z20.string().nullish(),
5430
- created: z20.string().nullish(),
5431
- updated: z20.string().nullish(),
5401
+ id: z19.string().nullish(),
5402
+ created: z19.string().nullish(),
5403
+ updated: z19.string().nullish(),
5432
5404
  status: interactionStatusSchema(),
5433
- model: z20.string().nullish(),
5434
- agent: z20.string().nullish(),
5435
- steps: z20.array(stepSchema()).nullish(),
5405
+ model: z19.string().nullish(),
5406
+ agent: z19.string().nullish(),
5407
+ steps: z19.array(stepSchema()).nullish(),
5436
5408
  usage: usageSchema2().nullish(),
5437
- service_tier: z20.string().nullish(),
5438
- previous_interaction_id: z20.string().nullish(),
5439
- response_modalities: z20.array(z20.string()).nullish()
5409
+ service_tier: z19.string().nullish(),
5410
+ previous_interaction_id: z19.string().nullish(),
5411
+ response_modalities: z19.array(z19.string()).nullish()
5440
5412
  }).loose()
5441
5413
  )
5442
5414
  );
5443
- var googleInteractionsEventSchema = lazySchema18(
5444
- () => zodSchema18(
5415
+ var googleInteractionsEventSchema = lazySchema17(
5416
+ () => zodSchema17(
5445
5417
  (() => {
5446
5418
  const status = interactionStatusSchema();
5447
5419
  const annotation = annotationSchema();
5448
5420
  const thoughtSummaryItem = thoughtSummaryItemSchema();
5449
- const interactionCreatedEvent = z20.object({
5450
- event_type: z20.literal("interaction.created"),
5451
- event_id: z20.string().nullish(),
5452
- interaction: z20.object({
5421
+ const interactionCreatedEvent = z19.object({
5422
+ event_type: z19.literal("interaction.created"),
5423
+ event_id: z19.string().nullish(),
5424
+ interaction: z19.object({
5453
5425
  /*
5454
5426
  * `id` is omitted when `store: false` (fully stateless mode);
5455
5427
  * see the matching note on `googleInteractionsResponseSchema.id`.
5456
5428
  */
5457
- id: z20.string().nullish(),
5458
- created: z20.string().nullish(),
5459
- model: z20.string().nullish(),
5460
- agent: z20.string().nullish(),
5429
+ id: z19.string().nullish(),
5430
+ created: z19.string().nullish(),
5431
+ model: z19.string().nullish(),
5432
+ agent: z19.string().nullish(),
5461
5433
  status: status.nullish()
5462
5434
  }).loose()
5463
5435
  }).loose();
5464
- const stepStartEvent = z20.object({
5465
- event_type: z20.literal("step.start"),
5466
- event_id: z20.string().nullish(),
5467
- index: z20.number(),
5436
+ const stepStartEvent = z19.object({
5437
+ event_type: z19.literal("step.start"),
5438
+ event_id: z19.string().nullish(),
5439
+ index: z19.number(),
5468
5440
  step: stepSchema()
5469
5441
  }).loose();
5470
- const stepDeltaText = z20.object({
5471
- type: z20.literal("text"),
5472
- text: z20.string()
5442
+ const stepDeltaText = z19.object({
5443
+ type: z19.literal("text"),
5444
+ text: z19.string()
5473
5445
  }).loose();
5474
- const stepDeltaThoughtSummary = z20.object({
5475
- type: z20.literal("thought_summary"),
5446
+ const stepDeltaThoughtSummary = z19.object({
5447
+ type: z19.literal("thought_summary"),
5476
5448
  content: thoughtSummaryItem.nullish()
5477
5449
  }).loose();
5478
- const stepDeltaThoughtSignature = z20.object({
5479
- type: z20.literal("thought_signature"),
5480
- signature: z20.string().nullish()
5450
+ const stepDeltaThoughtSignature = z19.object({
5451
+ type: z19.literal("thought_signature"),
5452
+ signature: z19.string().nullish()
5481
5453
  }).loose();
5482
- const stepDeltaArgumentsDelta = z20.object({
5483
- type: z20.literal("arguments_delta"),
5484
- arguments: z20.string().nullish(),
5485
- id: z20.string().nullish(),
5486
- signature: z20.string().nullish()
5454
+ const stepDeltaArgumentsDelta = z19.object({
5455
+ type: z19.literal("arguments_delta"),
5456
+ arguments: z19.string().nullish(),
5457
+ id: z19.string().nullish(),
5458
+ signature: z19.string().nullish()
5487
5459
  }).loose();
5488
- const stepDeltaTextAnnotation = z20.object({
5489
- type: z20.enum(["text_annotation_delta", "text_annotation"]),
5490
- annotations: z20.array(annotation).nullish()
5460
+ const stepDeltaTextAnnotation = z19.object({
5461
+ type: z19.enum(["text_annotation_delta", "text_annotation"]),
5462
+ annotations: z19.array(annotation).nullish()
5491
5463
  }).loose();
5492
- const stepDeltaImage = z20.object({
5493
- type: z20.literal("image"),
5494
- data: z20.string().nullish(),
5495
- mime_type: z20.string().nullish(),
5496
- resolution: z20.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5497
- uri: z20.string().nullish()
5464
+ const stepDeltaImage = z19.object({
5465
+ type: z19.literal("image"),
5466
+ data: z19.string().nullish(),
5467
+ mime_type: z19.string().nullish(),
5468
+ resolution: z19.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5469
+ uri: z19.string().nullish()
5498
5470
  }).loose();
5499
- const stepDeltaVideo = z20.object({
5500
- type: z20.literal("video"),
5501
- data: z20.string().nullish(),
5502
- mime_type: z20.string().nullish(),
5503
- uri: z20.string().nullish()
5471
+ const stepDeltaVideo = z19.object({
5472
+ type: z19.literal("video"),
5473
+ data: z19.string().nullish(),
5474
+ mime_type: z19.string().nullish(),
5475
+ uri: z19.string().nullish()
5504
5476
  }).loose();
5505
- const stepDeltaBuiltinToolCall = z20.object({
5506
- type: z20.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5507
- id: z20.string().nullish(),
5508
- arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5509
- name: z20.string().nullish(),
5510
- server_name: z20.string().nullish(),
5511
- search_type: z20.string().nullish(),
5512
- signature: z20.string().nullish()
5477
+ const stepDeltaBuiltinToolCall = z19.object({
5478
+ type: z19.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5479
+ id: z19.string().nullish(),
5480
+ arguments: z19.record(z19.string(), z19.unknown()).nullish(),
5481
+ name: z19.string().nullish(),
5482
+ server_name: z19.string().nullish(),
5483
+ search_type: z19.string().nullish(),
5484
+ signature: z19.string().nullish()
5513
5485
  }).loose();
5514
- const stepDeltaBuiltinToolResult = z20.object({
5515
- type: z20.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5516
- call_id: z20.string().nullish(),
5517
- result: z20.unknown().nullish(),
5518
- is_error: z20.boolean().nullish(),
5519
- name: z20.string().nullish(),
5520
- server_name: z20.string().nullish(),
5521
- signature: z20.string().nullish()
5486
+ const stepDeltaBuiltinToolResult = z19.object({
5487
+ type: z19.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5488
+ call_id: z19.string().nullish(),
5489
+ result: z19.unknown().nullish(),
5490
+ is_error: z19.boolean().nullish(),
5491
+ name: z19.string().nullish(),
5492
+ server_name: z19.string().nullish(),
5493
+ signature: z19.string().nullish()
5522
5494
  }).loose();
5523
- const stepDeltaUnknown = z20.object({ type: z20.string() }).loose();
5524
- const stepDeltaUnion = z20.union([
5495
+ const stepDeltaUnknown = z19.object({ type: z19.string() }).loose();
5496
+ const stepDeltaUnion = z19.union([
5525
5497
  stepDeltaText,
5526
5498
  stepDeltaImage,
5527
5499
  stepDeltaVideo,
@@ -5533,55 +5505,55 @@ var googleInteractionsEventSchema = lazySchema18(
5533
5505
  stepDeltaBuiltinToolResult,
5534
5506
  stepDeltaUnknown
5535
5507
  ]);
5536
- const stepDeltaEvent = z20.object({
5537
- event_type: z20.literal("step.delta"),
5538
- event_id: z20.string().nullish(),
5539
- index: z20.number(),
5508
+ const stepDeltaEvent = z19.object({
5509
+ event_type: z19.literal("step.delta"),
5510
+ event_id: z19.string().nullish(),
5511
+ index: z19.number(),
5540
5512
  delta: stepDeltaUnion
5541
5513
  }).loose();
5542
- const stepStopEvent = z20.object({
5543
- event_type: z20.literal("step.stop"),
5544
- event_id: z20.string().nullish(),
5545
- index: z20.number()
5514
+ const stepStopEvent = z19.object({
5515
+ event_type: z19.literal("step.stop"),
5516
+ event_id: z19.string().nullish(),
5517
+ index: z19.number()
5546
5518
  }).loose();
5547
- const interactionStatusUpdateEvent = z20.object({
5548
- event_type: z20.literal("interaction.status_update"),
5549
- event_id: z20.string().nullish(),
5550
- interaction_id: z20.string().nullish(),
5519
+ const interactionStatusUpdateEvent = z19.object({
5520
+ event_type: z19.literal("interaction.status_update"),
5521
+ event_id: z19.string().nullish(),
5522
+ interaction_id: z19.string().nullish(),
5551
5523
  status: status.nullish()
5552
5524
  }).loose();
5553
- const interactionInProgressEvent = z20.object({
5554
- event_type: z20.literal("interaction.in_progress"),
5555
- event_id: z20.string().nullish(),
5556
- interaction_id: z20.string().nullish(),
5525
+ const interactionInProgressEvent = z19.object({
5526
+ event_type: z19.literal("interaction.in_progress"),
5527
+ event_id: z19.string().nullish(),
5528
+ interaction_id: z19.string().nullish(),
5557
5529
  status: status.nullish()
5558
5530
  }).loose();
5559
- const interactionRequiresActionEvent = z20.object({
5560
- event_type: z20.literal("interaction.requires_action"),
5561
- event_id: z20.string().nullish(),
5562
- interaction_id: z20.string().nullish(),
5531
+ const interactionRequiresActionEvent = z19.object({
5532
+ event_type: z19.literal("interaction.requires_action"),
5533
+ event_id: z19.string().nullish(),
5534
+ interaction_id: z19.string().nullish(),
5563
5535
  status: status.nullish()
5564
5536
  }).loose();
5565
- const interactionCompletedEvent = z20.object({
5566
- event_type: z20.literal("interaction.completed"),
5567
- event_id: z20.string().nullish(),
5568
- interaction: z20.object({
5569
- id: z20.string().nullish(),
5537
+ const interactionCompletedEvent = z19.object({
5538
+ event_type: z19.literal("interaction.completed"),
5539
+ event_id: z19.string().nullish(),
5540
+ interaction: z19.object({
5541
+ id: z19.string().nullish(),
5570
5542
  status: status.nullish(),
5571
5543
  usage: usageSchema2().nullish(),
5572
- service_tier: z20.string().nullish()
5544
+ service_tier: z19.string().nullish()
5573
5545
  }).loose()
5574
5546
  }).loose();
5575
- const errorEvent = z20.object({
5576
- event_type: z20.literal("error"),
5577
- event_id: z20.string().nullish(),
5578
- error: z20.object({
5579
- code: z20.string().nullish(),
5580
- message: z20.string().nullish()
5547
+ const errorEvent = z19.object({
5548
+ event_type: z19.literal("error"),
5549
+ event_id: z19.string().nullish(),
5550
+ error: z19.object({
5551
+ code: z19.string().nullish(),
5552
+ message: z19.string().nullish()
5581
5553
  }).loose().nullish()
5582
5554
  }).loose();
5583
- const unknownEvent = z20.object({ event_type: z20.string() }).loose();
5584
- return z20.union([
5555
+ const unknownEvent = z19.object({ event_type: z19.string() }).loose();
5556
+ return z19.union([
5585
5557
  interactionCreatedEvent,
5586
5558
  stepStartEvent,
5587
5559
  stepDeltaEvent,
@@ -5599,29 +5571,29 @@ var googleInteractionsEventSchema = lazySchema18(
5599
5571
 
5600
5572
  // src/interactions/google-interactions-language-model-options.ts
5601
5573
  import {
5602
- lazySchema as lazySchema19,
5603
- zodSchema as zodSchema19
5574
+ lazySchema as lazySchema18,
5575
+ zodSchema as zodSchema18
5604
5576
  } from "@ai-sdk/provider-utils";
5605
- import { z as z21 } from "zod/v4";
5606
- var googleInteractionsLanguageModelOptions = lazySchema19(
5607
- () => zodSchema19(
5608
- z21.object({
5609
- previousInteractionId: z21.string().nullish(),
5610
- store: z21.boolean().nullish(),
5611
- agent: z21.string().nullish(),
5612
- agentConfig: z21.union([
5613
- z21.object({
5614
- type: z21.literal("dynamic")
5577
+ import { z as z20 } from "zod/v4";
5578
+ var googleInteractionsLanguageModelOptions = lazySchema18(
5579
+ () => zodSchema18(
5580
+ z20.object({
5581
+ previousInteractionId: z20.string().nullish(),
5582
+ store: z20.boolean().nullish(),
5583
+ agent: z20.string().nullish(),
5584
+ agentConfig: z20.union([
5585
+ z20.object({
5586
+ type: z20.literal("dynamic")
5615
5587
  }).loose(),
5616
- z21.object({
5617
- type: z21.literal("deep-research"),
5618
- thinkingSummaries: z21.enum(["auto", "none"]).nullish(),
5619
- visualization: z21.enum(["off", "auto"]).nullish(),
5620
- collaborativePlanning: z21.boolean().nullish()
5588
+ z20.object({
5589
+ type: z20.literal("deep-research"),
5590
+ thinkingSummaries: z20.enum(["auto", "none"]).nullish(),
5591
+ visualization: z20.enum(["off", "auto"]).nullish(),
5592
+ collaborativePlanning: z20.boolean().nullish()
5621
5593
  })
5622
5594
  ]).nullish(),
5623
- thinkingLevel: z21.enum(["minimal", "low", "medium", "high"]).nullish(),
5624
- thinkingSummaries: z21.enum(["auto", "none"]).nullish(),
5595
+ thinkingLevel: z20.enum(["minimal", "low", "medium", "high"]).nullish(),
5596
+ thinkingSummaries: z20.enum(["auto", "none"]).nullish(),
5625
5597
  /**
5626
5598
  * Output-format entries that map directly to the API's `response_format`
5627
5599
  * array. Use this to request image, audio, or non-JSON text outputs
@@ -5631,17 +5603,17 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5631
5603
  * type: 'json', schema }` still drives JSON-mode and adds a matching
5632
5604
  * text entry automatically; entries listed here are appended.
5633
5605
  */
5634
- responseFormat: z21.array(
5635
- z21.union([
5636
- z21.object({
5637
- type: z21.literal("text"),
5638
- mimeType: z21.string().nullish(),
5639
- schema: z21.unknown().nullish()
5606
+ responseFormat: z20.array(
5607
+ z20.union([
5608
+ z20.object({
5609
+ type: z20.literal("text"),
5610
+ mimeType: z20.string().nullish(),
5611
+ schema: z20.unknown().nullish()
5640
5612
  }).loose(),
5641
- z21.object({
5642
- type: z21.literal("image"),
5643
- mimeType: z21.string().nullish(),
5644
- aspectRatio: z21.enum([
5613
+ z20.object({
5614
+ type: z20.literal("image"),
5615
+ mimeType: z20.string().nullish(),
5616
+ aspectRatio: z20.enum([
5645
5617
  "1:1",
5646
5618
  "2:3",
5647
5619
  "3:2",
@@ -5657,11 +5629,11 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5657
5629
  "1:4",
5658
5630
  "4:1"
5659
5631
  ]).nullish(),
5660
- imageSize: z21.enum(["1K", "2K", "4K", "512"]).nullish()
5632
+ imageSize: z20.enum(["1K", "2K", "4K", "512"]).nullish()
5661
5633
  }).loose(),
5662
- z21.object({
5663
- type: z21.literal("audio"),
5664
- mimeType: z21.string().nullish()
5634
+ z20.object({
5635
+ type: z20.literal("audio"),
5636
+ mimeType: z20.string().nullish()
5665
5637
  }).loose()
5666
5638
  ])
5667
5639
  ).nullish(),
@@ -5671,8 +5643,8 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5671
5643
  * translates it into a matching `response_format` image entry and
5672
5644
  * emits a warning when set.
5673
5645
  */
5674
- imageConfig: z21.object({
5675
- aspectRatio: z21.enum([
5646
+ imageConfig: z20.object({
5647
+ aspectRatio: z20.enum([
5676
5648
  "1:1",
5677
5649
  "2:3",
5678
5650
  "3:2",
@@ -5688,35 +5660,35 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5688
5660
  "1:4",
5689
5661
  "4:1"
5690
5662
  ]).nullish(),
5691
- imageSize: z21.enum(["1K", "2K", "4K", "512"]).nullish()
5663
+ imageSize: z20.enum(["1K", "2K", "4K", "512"]).nullish()
5692
5664
  }).nullish(),
5693
- mediaResolution: z21.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5694
- responseModalities: z21.array(z21.enum(["text", "image", "audio", "video", "document"])).nullish(),
5695
- serviceTier: z21.enum(["flex", "standard", "priority"]).nullish(),
5665
+ mediaResolution: z20.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5666
+ responseModalities: z20.array(z20.enum(["text", "image", "audio", "video", "document"])).nullish(),
5667
+ serviceTier: z20.enum(["flex", "standard", "priority"]).nullish(),
5696
5668
  /**
5697
5669
  * Alternative to AI SDK `system` message. If both are set, the AI SDK
5698
5670
  * `system` message wins and a warning is emitted.
5699
5671
  */
5700
- systemInstruction: z21.string().nullish(),
5672
+ systemInstruction: z20.string().nullish(),
5701
5673
  /**
5702
5674
  * Per-block signature for round-tripping `thought.signature` and
5703
5675
  * `function_call.signature` blocks. Set by the SDK on output reasoning /
5704
5676
  * tool-call parts; passed back unchanged on input parts so the API
5705
5677
  * accepts the prior turn.
5706
5678
  */
5707
- signature: z21.string().nullish(),
5679
+ signature: z20.string().nullish(),
5708
5680
  /**
5709
5681
  * Set by the SDK on output assistant messages. The converter uses it to
5710
5682
  * decide which messages to drop when compacting under
5711
5683
  * `previousInteractionId`.
5712
5684
  */
5713
- interactionId: z21.string().nullish(),
5685
+ interactionId: z20.string().nullish(),
5714
5686
  /**
5715
5687
  * Maximum time, in milliseconds, to poll a background interaction (agent
5716
5688
  * call) before giving up. Defaults to 30 minutes. Long-running agents
5717
5689
  * such as deep research can take tens of minutes — increase if needed.
5718
5690
  */
5719
- pollingTimeoutMs: z21.number().int().positive().nullish(),
5691
+ pollingTimeoutMs: z20.number().int().positive().nullish(),
5720
5692
  /**
5721
5693
  * Run the interaction in the background. Required for agents whose
5722
5694
  * server-side workflow cannot complete within a single request/response.
@@ -5725,7 +5697,7 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5725
5697
  * reject `true`; see the agent's documentation for which mode it
5726
5698
  * requires.
5727
5699
  */
5728
- background: z21.boolean().nullish(),
5700
+ background: z20.boolean().nullish(),
5729
5701
  /**
5730
5702
  * Environment configuration for the agent sandbox. Only applies to agent
5731
5703
  * calls (`google.interactions({ agent })`); ignored on model-id calls.
@@ -5735,36 +5707,36 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5735
5707
  * - object: provision a fresh sandbox and optionally preload `sources`
5736
5708
  * and/or constrain outbound traffic via `network`.
5737
5709
  */
5738
- environment: z21.union([
5739
- z21.string(),
5740
- z21.object({
5741
- type: z21.literal("remote"),
5742
- sources: z21.array(
5743
- z21.union([
5744
- z21.object({
5745
- type: z21.literal("gcs"),
5746
- source: z21.string(),
5747
- target: z21.string().nullish()
5710
+ environment: z20.union([
5711
+ z20.string(),
5712
+ z20.object({
5713
+ type: z20.literal("remote"),
5714
+ sources: z20.array(
5715
+ z20.union([
5716
+ z20.object({
5717
+ type: z20.literal("gcs"),
5718
+ source: z20.string(),
5719
+ target: z20.string().nullish()
5748
5720
  }),
5749
- z21.object({
5750
- type: z21.literal("repository"),
5751
- source: z21.string(),
5752
- target: z21.string().nullish()
5721
+ z20.object({
5722
+ type: z20.literal("repository"),
5723
+ source: z20.string(),
5724
+ target: z20.string().nullish()
5753
5725
  }),
5754
- z21.object({
5755
- type: z21.literal("inline"),
5756
- content: z21.string(),
5757
- target: z21.string()
5726
+ z20.object({
5727
+ type: z20.literal("inline"),
5728
+ content: z20.string(),
5729
+ target: z20.string()
5758
5730
  })
5759
5731
  ])
5760
5732
  ).nullish(),
5761
- network: z21.union([
5762
- z21.literal("disabled"),
5763
- z21.object({
5764
- allowlist: z21.array(
5765
- z21.object({
5766
- domain: z21.string(),
5767
- transform: z21.array(z21.record(z21.string(), z21.string())).nullish()
5733
+ network: z20.union([
5734
+ z20.literal("disabled"),
5735
+ z20.object({
5736
+ allowlist: z20.array(
5737
+ z20.object({
5738
+ domain: z20.string(),
5739
+ transform: z20.array(z20.record(z20.string(), z20.string())).nullish()
5768
5740
  })
5769
5741
  )
5770
5742
  })
@@ -5954,7 +5926,7 @@ function parseGoogleInteractionsOutputs({
5954
5926
 
5955
5927
  // src/interactions/poll-google-interactions.ts
5956
5928
  import {
5957
- createJsonResponseHandler as createJsonResponseHandler7,
5929
+ createJsonResponseHandler as createJsonResponseHandler6,
5958
5930
  delay as delay2,
5959
5931
  getFromApi as getFromApi3,
5960
5932
  isAbortError
@@ -5962,7 +5934,7 @@ import {
5962
5934
 
5963
5935
  // src/interactions/cancel-google-interaction.ts
5964
5936
  import {
5965
- combineHeaders as combineHeaders7,
5937
+ combineHeaders as combineHeaders6,
5966
5938
  getRuntimeEnvironmentUserAgent,
5967
5939
  withUserAgentSuffix
5968
5940
  } from "@ai-sdk/provider-utils";
@@ -5981,7 +5953,7 @@ async function cancelGoogleInteraction({
5981
5953
  const response = await fetch2(url, {
5982
5954
  method: "POST",
5983
5955
  headers: withUserAgentSuffix(
5984
- combineHeaders7({ "Content-Type": "application/json" }, headers),
5956
+ combineHeaders6({ "Content-Type": "application/json" }, headers),
5985
5957
  getRuntimeEnvironmentUserAgent()
5986
5958
  ),
5987
5959
  body: "{}"
@@ -6042,7 +6014,7 @@ async function pollGoogleInteractionUntilTerminal({
6042
6014
  validateUrl: false,
6043
6015
  headers,
6044
6016
  failedResponseHandler: googleFailedResponseHandler,
6045
- successfulResponseHandler: createJsonResponseHandler7(
6017
+ successfulResponseHandler: createJsonResponseHandler6(
6046
6018
  googleInteractionsResponseSchema
6047
6019
  ),
6048
6020
  abortSignal,
@@ -6818,16 +6790,16 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6818
6790
  var _a, _b, _c, _d, _e, _f;
6819
6791
  const { args, warnings, isAgent, pollingTimeoutMs } = await this.getArgs(options);
6820
6792
  const url = `${this.config.baseURL}/interactions`;
6821
- const mergedHeaders = combineHeaders8(
6822
- this.config.headers ? await resolve6(this.config.headers) : void 0,
6793
+ const mergedHeaders = combineHeaders7(
6794
+ this.config.headers ? await resolve5(this.config.headers) : void 0,
6823
6795
  options.headers
6824
6796
  );
6825
- const postResult = await postJsonToApi6({
6797
+ const postResult = await postJsonToApi5({
6826
6798
  url,
6827
6799
  headers: mergedHeaders,
6828
6800
  body: args,
6829
6801
  failedResponseHandler: googleFailedResponseHandler,
6830
- successfulResponseHandler: createJsonResponseHandler8(
6802
+ successfulResponseHandler: createJsonResponseHandler7(
6831
6803
  googleInteractionsResponseSchema
6832
6804
  ),
6833
6805
  abortSignal: options.abortSignal,
@@ -6902,8 +6874,8 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6902
6874
  var _a;
6903
6875
  const { args, warnings, isBackground, pollingTimeoutMs } = await this.getArgs(options);
6904
6876
  const url = `${this.config.baseURL}/interactions`;
6905
- const mergedHeaders = combineHeaders8(
6906
- this.config.headers ? await resolve6(this.config.headers) : void 0,
6877
+ const mergedHeaders = combineHeaders7(
6878
+ this.config.headers ? await resolve5(this.config.headers) : void 0,
6907
6879
  options.headers
6908
6880
  );
6909
6881
  if (isBackground) {
@@ -6917,7 +6889,7 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6917
6889
  });
6918
6890
  }
6919
6891
  const body = { ...args, stream: true };
6920
- const { responseHeaders, value: response } = await postJsonToApi6({
6892
+ const { responseHeaders, value: response } = await postJsonToApi5({
6921
6893
  url,
6922
6894
  headers: mergedHeaders,
6923
6895
  body,
@@ -6968,12 +6940,12 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6968
6940
  pollingTimeoutMs
6969
6941
  }) {
6970
6942
  var _a, _b;
6971
- const postResult = await postJsonToApi6({
6943
+ const postResult = await postJsonToApi5({
6972
6944
  url,
6973
6945
  headers: mergedHeaders,
6974
6946
  body: args,
6975
6947
  failedResponseHandler: googleFailedResponseHandler,
6976
- successfulResponseHandler: createJsonResponseHandler8(
6948
+ successfulResponseHandler: createJsonResponseHandler7(
6977
6949
  googleInteractionsResponseSchema
6978
6950
  ),
6979
6951
  abortSignal: options.abortSignal,
@@ -7460,7 +7432,7 @@ import {
7460
7432
  } from "@ai-sdk/provider";
7461
7433
  import {
7462
7434
  connectToWebSocket,
7463
- combineHeaders as combineHeaders9,
7435
+ combineHeaders as combineHeaders8,
7464
7436
  convertBase64ToUint8Array as convertBase64ToUint8Array2,
7465
7437
  convertToBase64 as convertToBase644,
7466
7438
  parseProviderOptions as parseProviderOptions8,
@@ -7473,18 +7445,18 @@ import {
7473
7445
 
7474
7446
  // src/speech-translation/google-speech-translation-model-options.ts
7475
7447
  import {
7476
- lazySchema as lazySchema20,
7477
- zodSchema as zodSchema20
7448
+ lazySchema as lazySchema19,
7449
+ zodSchema as zodSchema19
7478
7450
  } from "@ai-sdk/provider-utils";
7479
- import { z as z22 } from "zod/v4";
7480
- var googleSpeechTranslationModelOptions = lazySchema20(
7481
- () => zodSchema20(
7482
- z22.object({
7451
+ import { z as z21 } from "zod/v4";
7452
+ var googleSpeechTranslationModelOptions = lazySchema19(
7453
+ () => zodSchema19(
7454
+ z21.object({
7483
7455
  /**
7484
7456
  * Whether input audio already in the target language should be echoed
7485
7457
  * instead of producing silence.
7486
7458
  */
7487
- echoTargetLanguage: z22.boolean().optional()
7459
+ echoTargetLanguage: z21.boolean().optional()
7488
7460
  })
7489
7461
  )
7490
7462
  );
@@ -7547,7 +7519,7 @@ var GoogleSpeechTranslationModel = class _GoogleSpeechTranslationModel {
7547
7519
  details: "The Gemini Live API always outputs 24kHz 16-bit PCM audio and does not accept an output audio format."
7548
7520
  });
7549
7521
  }
7550
- const headers = combineHeaders9(this.config.headers(), options.headers);
7522
+ const headers = combineHeaders8(this.config.headers(), options.headers);
7551
7523
  let apiKey;
7552
7524
  for (const [key, value] of Object.entries(headers)) {
7553
7525
  if (key.toLowerCase() === "x-goog-api-key" && value != null) {
@@ -7610,8 +7582,8 @@ function createGoogleLiveSpeechTranslationStream({
7610
7582
  let audioReader;
7611
7583
  let connection;
7612
7584
  let resolveSetupComplete;
7613
- const setupComplete = new Promise((resolve7) => {
7614
- resolveSetupComplete = resolve7;
7585
+ const setupComplete = new Promise((resolve6) => {
7586
+ resolveSetupComplete = resolve6;
7615
7587
  });
7616
7588
  let turnCounter = 0;
7617
7589
  let sourceText = "";