@ai-sdk/google 4.0.48 → 4.0.50

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.48" : "0.0.0-test";
10
+ var VERSION = true ? "4.0.50" : "0.0.0-test";
11
11
 
12
12
  // src/google-embedding-model.ts
13
13
  import {
@@ -1232,13 +1232,13 @@ function isKnownPreGemini2Model(modelId) {
1232
1232
  return gemini1ModelPattern.test(modelId) || /(^|\/)gemini-pro(?:-vision)?$/i.test(modelId) || /(^|\/)gemini-robotics-er-1\.5(?:[.-]|$)/i.test(modelId);
1233
1233
  }
1234
1234
  function getGoogleModelCapabilities(modelId) {
1235
- const isGeminiModel2 = geminiModelPattern.test(modelId);
1235
+ const isGeminiModel = geminiModelPattern.test(modelId);
1236
1236
  const isGemini2Model = gemini2ModelPattern.test(modelId);
1237
1237
  const isKnownPreGemini2 = isKnownPreGemini2Model(modelId);
1238
1238
  const isKnownOlderModel = isKnownPreGemini2 || isGemini2Model;
1239
- const usesGemini3Features = isGeminiModel2 && !isKnownOlderModel;
1239
+ const usesGemini3Features = isGeminiModel && !isKnownOlderModel;
1240
1240
  return {
1241
- supportsGemini2Tools: isGeminiModel2 && !isKnownPreGemini2 || modelId.toLowerCase().includes("nano-banana"),
1241
+ supportsGemini2Tools: isGeminiModel && !isKnownPreGemini2 || modelId.toLowerCase().includes("nano-banana"),
1242
1242
  supportsFileSearch: gemini25ModelPattern.test(modelId) || usesGemini3Features,
1243
1243
  usesGemini3Features
1244
1244
  };
@@ -3106,32 +3106,20 @@ var googleTools = {
3106
3106
 
3107
3107
  // src/google-image-model.ts
3108
3108
  import {
3109
- combineHeaders as combineHeaders3,
3110
3109
  convertToBase64 as convertToBase642,
3111
- createJsonResponseHandler as createJsonResponseHandler3,
3112
3110
  generateId as defaultGenerateId,
3113
- lazySchema as lazySchema13,
3114
3111
  parseProviderOptions as parseProviderOptions3,
3115
- postJsonToApi as postJsonToApi3,
3116
- resolve as resolve3,
3117
3112
  serializeModelOptions as serializeModelOptions3,
3118
3113
  WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE3,
3119
- WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE3,
3120
- zodSchema as zodSchema13
3114
+ WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE3
3121
3115
  } from "@ai-sdk/provider-utils";
3122
- import { z as z14 } from "zod/v4";
3123
3116
 
3124
3117
  // src/google-image-model-options.ts
3125
- import {
3126
- lazySchema as lazySchema12,
3127
- zodSchema as zodSchema12
3128
- } from "@ai-sdk/provider-utils";
3118
+ import { lazySchema as lazySchema12, zodSchema as zodSchema12 } from "@ai-sdk/provider-utils";
3129
3119
  import { z as z13 } from "zod/v4";
3130
3120
  var googleImageModelOptionsSchema = lazySchema12(
3131
3121
  () => zodSchema12(
3132
3122
  z13.object({
3133
- personGeneration: z13.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
3134
- aspectRatio: z13.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish(),
3135
3123
  /**
3136
3124
  * Enable Google Search grounding for Gemini image models. The value is
3137
3125
  * forwarded as the args of the `google.tools.googleSearch` provider
@@ -3167,121 +3155,18 @@ var GoogleImageModel = class _GoogleImageModel {
3167
3155
  if (this.settings.maxImagesPerCall != null) {
3168
3156
  return this.settings.maxImagesPerCall;
3169
3157
  }
3170
- if (isGeminiModel(this.modelId)) {
3171
- return 10;
3172
- }
3173
- return 4;
3158
+ return 10;
3174
3159
  }
3175
3160
  get provider() {
3176
3161
  return this.config.provider;
3177
3162
  }
3178
3163
  async doGenerate(options) {
3179
- if (isGeminiModel(this.modelId)) {
3180
- return this.doGenerateGemini(options);
3181
- }
3182
- return this.doGenerateImagen(options);
3183
- }
3184
- async doGenerateImagen(options) {
3185
- var _a, _b, _c;
3186
- const {
3187
- prompt,
3188
- n = 1,
3189
- size,
3190
- aspectRatio = "1:1",
3191
- seed,
3192
- providerOptions,
3193
- headers,
3194
- abortSignal,
3195
- files,
3196
- mask
3197
- } = options;
3198
- const warnings = [];
3199
- if (files != null && files.length > 0) {
3200
- throw new Error(
3201
- "Google Gemini API does not support image editing with Imagen models. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities."
3202
- );
3203
- }
3204
- if (mask != null) {
3164
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3165
+ if (!this.modelId.startsWith("gemini-")) {
3205
3166
  throw new Error(
3206
- "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-`."
3207
3168
  );
3208
3169
  }
3209
- if (size != null) {
3210
- warnings.push({
3211
- type: "unsupported",
3212
- feature: "size",
3213
- details: "This model does not support the `size` option. Use `aspectRatio` instead."
3214
- });
3215
- }
3216
- if (seed != null) {
3217
- warnings.push({
3218
- type: "unsupported",
3219
- feature: "seed",
3220
- details: "This model does not support the `seed` option through this provider."
3221
- });
3222
- }
3223
- const googleOptions = await parseProviderOptions3({
3224
- provider: "google",
3225
- providerOptions,
3226
- schema: googleImageModelOptionsSchema
3227
- });
3228
- const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
3229
- const parameters = {
3230
- sampleCount: n
3231
- };
3232
- if (aspectRatio != null) {
3233
- parameters.aspectRatio = aspectRatio;
3234
- }
3235
- if (googleOptions) {
3236
- const { googleSearch: imagenGoogleSearch, ...imagenOptions } = googleOptions;
3237
- if (imagenGoogleSearch != null) {
3238
- warnings.push({
3239
- type: "unsupported",
3240
- feature: "googleSearch",
3241
- details: "Google Search grounding is only supported on Gemini image models."
3242
- });
3243
- }
3244
- Object.assign(parameters, imagenOptions);
3245
- }
3246
- const body = {
3247
- instances: [{ prompt }],
3248
- parameters
3249
- };
3250
- const { responseHeaders, value: response } = await postJsonToApi3({
3251
- url: `${this.config.baseURL}/models/${this.modelId}:predict`,
3252
- headers: combineHeaders3(
3253
- this.config.headers ? await resolve3(this.config.headers) : void 0,
3254
- headers
3255
- ),
3256
- body,
3257
- failedResponseHandler: googleFailedResponseHandler,
3258
- successfulResponseHandler: createJsonResponseHandler3(
3259
- googleImageResponseSchema
3260
- ),
3261
- abortSignal,
3262
- fetch: this.config.fetch
3263
- });
3264
- return {
3265
- images: response.predictions.map(
3266
- (p) => p.bytesBase64Encoded
3267
- ),
3268
- warnings,
3269
- providerMetadata: {
3270
- google: {
3271
- images: response.predictions.map(() => ({
3272
- // Add any prediction-specific metadata here
3273
- }))
3274
- }
3275
- },
3276
- response: {
3277
- timestamp: currentDate,
3278
- modelId: this.modelId,
3279
- headers: responseHeaders
3280
- }
3281
- };
3282
- }
3283
- async doGenerateGemini(options) {
3284
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3285
3170
  const {
3286
3171
  prompt,
3287
3172
  n,
@@ -3344,7 +3229,12 @@ var GoogleImageModel = class _GoogleImageModel {
3344
3229
  providerOptions,
3345
3230
  schema: googleImageModelOptionsSchema
3346
3231
  });
3347
- 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 : {};
3348
3238
  const languageModel = new GoogleLanguageModel(this.modelId, {
3349
3239
  provider: this.config.provider,
3350
3240
  baseURL: this.config.baseURL,
@@ -3357,11 +3247,14 @@ var GoogleImageModel = class _GoogleImageModel {
3357
3247
  seed,
3358
3248
  providerOptions: {
3359
3249
  google: {
3250
+ ...passthroughGoogleOptions,
3360
3251
  responseModalities: ["IMAGE"],
3361
- imageConfig: aspectRatio ? {
3362
- aspectRatio
3363
- } : void 0,
3364
- ...passthroughGoogleOptions
3252
+ imageConfig: aspectRatio != null || userImageConfig != null ? {
3253
+ ...userImageConfig,
3254
+ ...aspectRatio != null ? {
3255
+ aspectRatio
3256
+ } : {}
3257
+ } : void 0
3365
3258
  }
3366
3259
  },
3367
3260
  tools: (googleImageOptions == null ? void 0 : googleImageOptions.googleSearch) != null ? [
@@ -3405,32 +3298,22 @@ var GoogleImageModel = class _GoogleImageModel {
3405
3298
  };
3406
3299
  }
3407
3300
  };
3408
- function isGeminiModel(modelId) {
3409
- return modelId.startsWith("gemini-");
3410
- }
3411
- var googleImageResponseSchema = lazySchema13(
3412
- () => zodSchema13(
3413
- z14.object({
3414
- predictions: z14.array(z14.object({ bytesBase64Encoded: z14.string() })).default([])
3415
- })
3416
- )
3417
- );
3418
3301
 
3419
3302
  // src/google-files.ts
3420
3303
  import {
3421
3304
  AISDKError
3422
3305
  } from "@ai-sdk/provider";
3423
3306
  import {
3424
- combineHeaders as combineHeaders4,
3307
+ combineHeaders as combineHeaders3,
3425
3308
  convertInlineFileDataToUint8Array,
3426
- createJsonResponseHandler as createJsonResponseHandler4,
3309
+ createJsonResponseHandler as createJsonResponseHandler3,
3427
3310
  delay,
3428
- lazySchema as lazySchema14,
3311
+ lazySchema as lazySchema13,
3429
3312
  parseProviderOptions as parseProviderOptions4,
3430
- zodSchema as zodSchema14,
3313
+ zodSchema as zodSchema13,
3431
3314
  getFromApi
3432
3315
  } from "@ai-sdk/provider-utils";
3433
- import { z as z15 } from "zod/v4";
3316
+ import { z as z14 } from "zod/v4";
3434
3317
  var GoogleFiles = class {
3435
3318
  constructor(config) {
3436
3319
  this.config = config;
@@ -3517,8 +3400,8 @@ var GoogleFiles = class {
3517
3400
  const { value: fileStatus } = await getFromApi({
3518
3401
  url: `${this.config.baseURL}/${file.name}`,
3519
3402
  validateUrl: false,
3520
- headers: combineHeaders4(resolvedHeaders),
3521
- successfulResponseHandler: createJsonResponseHandler4(
3403
+ headers: combineHeaders3(resolvedHeaders),
3404
+ successfulResponseHandler: createJsonResponseHandler3(
3522
3405
  googleFileResponseSchema
3523
3406
  ),
3524
3407
  failedResponseHandler: googleFailedResponseHandler,
@@ -3553,28 +3436,28 @@ var GoogleFiles = class {
3553
3436
  };
3554
3437
  }
3555
3438
  };
3556
- var googleFileResponseSchema = lazySchema14(
3557
- () => zodSchema14(
3558
- z15.object({
3559
- name: z15.string(),
3560
- displayName: z15.string().nullish(),
3561
- mimeType: z15.string(),
3562
- sizeBytes: z15.string().nullish(),
3563
- createTime: z15.string().nullish(),
3564
- updateTime: z15.string().nullish(),
3565
- expirationTime: z15.string().nullish(),
3566
- sha256Hash: z15.string().nullish(),
3567
- uri: z15.string(),
3568
- 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()
3569
3452
  })
3570
3453
  )
3571
3454
  );
3572
- var googleFilesUploadOptionsSchema = lazySchema14(
3573
- () => zodSchema14(
3574
- z15.looseObject({
3575
- displayName: z15.string().nullish(),
3576
- pollIntervalMs: z15.number().positive().nullish(),
3577
- 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()
3578
3461
  })
3579
3462
  )
3580
3463
  );
@@ -3584,31 +3467,31 @@ import {
3584
3467
  AISDKError as AISDKError2
3585
3468
  } from "@ai-sdk/provider";
3586
3469
  import {
3587
- combineHeaders as combineHeaders5,
3470
+ combineHeaders as combineHeaders4,
3588
3471
  convertUint8ArrayToBase64,
3589
- createJsonResponseHandler as createJsonResponseHandler5,
3472
+ createJsonResponseHandler as createJsonResponseHandler4,
3590
3473
  getFromApi as getFromApi2,
3591
3474
  isSameOrigin,
3592
3475
  parseProviderOptions as parseProviderOptions5,
3593
- postJsonToApi as postJsonToApi4,
3594
- resolve as resolve4
3476
+ postJsonToApi as postJsonToApi3,
3477
+ resolve as resolve3
3595
3478
  } from "@ai-sdk/provider-utils";
3596
- import { z as z17 } from "zod/v4";
3479
+ import { z as z16 } from "zod/v4";
3597
3480
 
3598
3481
  // src/google-video-model-options.ts
3599
- import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
3600
- import { z as z16 } from "zod/v4";
3601
- var googleVideoModelOptionsSchema = lazySchema15(
3602
- () => zodSchema15(
3603
- z16.looseObject({
3604
- pollIntervalMs: z16.number().positive().nullish(),
3605
- pollTimeoutMs: z16.number().positive().nullish(),
3606
- personGeneration: z16.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
3607
- negativePrompt: z16.string().nullish(),
3608
- referenceImages: z16.array(
3609
- z16.object({
3610
- bytesBase64Encoded: z16.string().nullish(),
3611
- 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()
3612
3495
  })
3613
3496
  ).nullish()
3614
3497
  })
@@ -3782,7 +3665,7 @@ var GoogleVideoModel = class {
3782
3665
  }
3783
3666
  const videos = [];
3784
3667
  const videoMetadata = [];
3785
- const resolvedHeaders = await resolve4(this.config.headers);
3668
+ const resolvedHeaders = await resolve3(this.config.headers);
3786
3669
  const apiKey = resolvedHeaders == null ? void 0 : resolvedHeaders["x-goog-api-key"];
3787
3670
  for (const generatedSample of response.generateVideoResponse.generatedSamples) {
3788
3671
  if ((_b = generatedSample.video) == null ? void 0 : _b.uri) {
@@ -3823,17 +3706,17 @@ var GoogleVideoModel = class {
3823
3706
  var _a, _b, _c;
3824
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();
3825
3708
  const { instances, parameters, warnings } = await this.buildRequest(options);
3826
- const { value: operation, responseHeaders } = await postJsonToApi4({
3709
+ const { value: operation, responseHeaders } = await postJsonToApi3({
3827
3710
  url: `${this.config.baseURL}/models/${this.modelId}:predictLongRunning`,
3828
- headers: combineHeaders5(
3829
- await resolve4(this.config.headers),
3711
+ headers: combineHeaders4(
3712
+ await resolve3(this.config.headers),
3830
3713
  options.headers
3831
3714
  ),
3832
3715
  body: {
3833
3716
  instances,
3834
3717
  parameters
3835
3718
  },
3836
- successfulResponseHandler: createJsonResponseHandler5(
3719
+ successfulResponseHandler: createJsonResponseHandler4(
3837
3720
  googleOperationSchema
3838
3721
  ),
3839
3722
  failedResponseHandler: googleFailedResponseHandler,
@@ -3864,11 +3747,11 @@ var GoogleVideoModel = class {
3864
3747
  const { value: statusOperation, responseHeaders } = await getFromApi2({
3865
3748
  url: `${this.config.baseURL}/${operationName}`,
3866
3749
  validateUrl: false,
3867
- headers: combineHeaders5(
3868
- await resolve4(this.config.headers),
3750
+ headers: combineHeaders4(
3751
+ await resolve3(this.config.headers),
3869
3752
  options.headers
3870
3753
  ),
3871
- successfulResponseHandler: createJsonResponseHandler5(
3754
+ successfulResponseHandler: createJsonResponseHandler4(
3872
3755
  googleOperationSchema
3873
3756
  ),
3874
3757
  failedResponseHandler: googleFailedResponseHandler,
@@ -3904,20 +3787,20 @@ var GoogleVideoModel = class {
3904
3787
  );
3905
3788
  }
3906
3789
  };
3907
- var googleOperationSchema = z17.object({
3908
- name: z17.string().nullish(),
3909
- done: z17.boolean().nullish(),
3910
- error: z17.object({
3911
- code: z17.number().nullish(),
3912
- message: z17.string(),
3913
- 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()
3914
3797
  }).nullish(),
3915
- response: z17.object({
3916
- generateVideoResponse: z17.object({
3917
- generatedSamples: z17.array(
3918
- z17.object({
3919
- video: z17.object({
3920
- 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()
3921
3804
  }).nullish()
3922
3805
  })
3923
3806
  ).nullish()
@@ -3927,31 +3810,31 @@ var googleOperationSchema = z17.object({
3927
3810
 
3928
3811
  // src/google-speech-model.ts
3929
3812
  import {
3930
- combineHeaders as combineHeaders6,
3813
+ combineHeaders as combineHeaders5,
3931
3814
  convertBase64ToUint8Array,
3932
- createJsonResponseHandler as createJsonResponseHandler6,
3815
+ createJsonResponseHandler as createJsonResponseHandler5,
3933
3816
  parseProviderOptions as parseProviderOptions6,
3934
- postJsonToApi as postJsonToApi5,
3935
- resolve as resolve5,
3817
+ postJsonToApi as postJsonToApi4,
3818
+ resolve as resolve4,
3936
3819
  serializeModelOptions as serializeModelOptions4,
3937
3820
  WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE4,
3938
3821
  WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE4
3939
3822
  } from "@ai-sdk/provider-utils";
3940
3823
 
3941
3824
  // src/google-speech-api.ts
3942
- import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
3943
- import { z as z18 } from "zod/v4";
3944
- var googleSpeechResponseSchema = lazySchema16(
3945
- () => zodSchema16(
3946
- z18.object({
3947
- candidates: z18.array(
3948
- z18.object({
3949
- content: z18.object({
3950
- parts: z18.array(
3951
- z18.object({
3952
- inlineData: z18.object({
3953
- mimeType: z18.string().nullish(),
3954
- 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()
3955
3838
  }).nullish()
3956
3839
  })
3957
3840
  ).nullish()
@@ -3964,19 +3847,19 @@ var googleSpeechResponseSchema = lazySchema16(
3964
3847
 
3965
3848
  // src/google-speech-model-options.ts
3966
3849
  import {
3967
- lazySchema as lazySchema17,
3968
- zodSchema as zodSchema17
3850
+ lazySchema as lazySchema16,
3851
+ zodSchema as zodSchema16
3969
3852
  } from "@ai-sdk/provider-utils";
3970
- import { z as z19 } from "zod/v4";
3971
- var prebuiltVoiceConfigSchema = z19.object({
3972
- voiceName: z19.string()
3853
+ import { z as z18 } from "zod/v4";
3854
+ var prebuiltVoiceConfigSchema = z18.object({
3855
+ voiceName: z18.string()
3973
3856
  });
3974
- var voiceConfigSchema = z19.object({
3857
+ var voiceConfigSchema = z18.object({
3975
3858
  prebuiltVoiceConfig: prebuiltVoiceConfigSchema
3976
3859
  });
3977
- var googleSpeechProviderOptionsSchema = lazySchema17(
3978
- () => zodSchema17(
3979
- z19.object({
3860
+ var googleSpeechProviderOptionsSchema = lazySchema16(
3861
+ () => zodSchema16(
3862
+ z18.object({
3980
3863
  /**
3981
3864
  * Multi-speaker configuration for dialogue audio. When provided, this
3982
3865
  * overrides the top-level `voice`. The Gemini TTS API supports up to two
@@ -3984,10 +3867,10 @@ var googleSpeechProviderOptionsSchema = lazySchema17(
3984
3867
  *
3985
3868
  * https://ai.google.dev/gemini-api/docs/speech-generation#multi-speaker
3986
3869
  */
3987
- multiSpeakerVoiceConfig: z19.object({
3988
- speakerVoiceConfigs: z19.array(
3989
- z19.object({
3990
- speaker: z19.string(),
3870
+ multiSpeakerVoiceConfig: z18.object({
3871
+ speakerVoiceConfigs: z18.array(
3872
+ z18.object({
3873
+ speaker: z18.string(),
3991
3874
  voiceConfig: voiceConfigSchema
3992
3875
  })
3993
3876
  )
@@ -4101,15 +3984,15 @@ var GoogleSpeechModel = class _GoogleSpeechModel {
4101
3984
  value: response,
4102
3985
  responseHeaders,
4103
3986
  rawValue: rawResponse
4104
- } = await postJsonToApi5({
3987
+ } = await postJsonToApi4({
4105
3988
  url: `${this.config.baseURL}/models/${this.modelId}:generateContent`,
4106
- headers: combineHeaders6(
4107
- this.config.headers ? await resolve5(this.config.headers) : void 0,
3989
+ headers: combineHeaders5(
3990
+ this.config.headers ? await resolve4(this.config.headers) : void 0,
4108
3991
  options.headers
4109
3992
  ),
4110
3993
  body: requestBody,
4111
3994
  failedResponseHandler: googleFailedResponseHandler,
4112
- successfulResponseHandler: createJsonResponseHandler6(
3995
+ successfulResponseHandler: createJsonResponseHandler5(
4113
3996
  googleSpeechResponseSchema
4114
3997
  ),
4115
3998
  abortSignal: options.abortSignal,
@@ -4200,13 +4083,13 @@ function writeAscii(view, offset, text) {
4200
4083
 
4201
4084
  // src/interactions/google-interactions-language-model.ts
4202
4085
  import {
4203
- combineHeaders as combineHeaders8,
4086
+ combineHeaders as combineHeaders7,
4204
4087
  createEventSourceResponseHandler as createEventSourceResponseHandler3,
4205
- createJsonResponseHandler as createJsonResponseHandler8,
4088
+ createJsonResponseHandler as createJsonResponseHandler7,
4206
4089
  generateId as defaultGenerateId2,
4207
4090
  parseProviderOptions as parseProviderOptions7,
4208
- postJsonToApi as postJsonToApi6,
4209
- resolve as resolve6,
4091
+ postJsonToApi as postJsonToApi5,
4092
+ resolve as resolve5,
4210
4093
  serializeModelOptions as serializeModelOptions5,
4211
4094
  WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE5,
4212
4095
  WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE5
@@ -5342,33 +5225,33 @@ ${block.text}`
5342
5225
 
5343
5226
  // src/interactions/google-interactions-api.ts
5344
5227
  import {
5345
- lazySchema as lazySchema18,
5346
- zodSchema as zodSchema18
5228
+ lazySchema as lazySchema17,
5229
+ zodSchema as zodSchema17
5347
5230
  } from "@ai-sdk/provider-utils";
5348
- import { z as z20 } from "zod/v4";
5349
- var tokenByModalitySchema = () => z20.object({
5350
- modality: z20.string().nullish(),
5351
- 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()
5352
5235
  }).loose();
5353
- var usageSchema2 = () => z20.object({
5354
- total_input_tokens: z20.number().nullish(),
5355
- total_output_tokens: z20.number().nullish(),
5356
- total_thought_tokens: z20.number().nullish(),
5357
- total_cached_tokens: z20.number().nullish(),
5358
- total_tool_use_tokens: z20.number().nullish(),
5359
- total_tokens: z20.number().nullish(),
5360
- input_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5361
- output_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5362
- cached_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5363
- tool_use_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
5364
- grounding_tool_count: z20.array(
5365
- z20.object({
5366
- type: z20.string().nullish(),
5367
- 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()
5368
5251
  }).loose()
5369
5252
  ).nullish()
5370
5253
  }).loose();
5371
- var interactionStatusSchema = () => z20.enum([
5254
+ var interactionStatusSchema = () => z19.enum([
5372
5255
  "in_progress",
5373
5256
  "requires_action",
5374
5257
  "completed",
@@ -5377,69 +5260,69 @@ var interactionStatusSchema = () => z20.enum([
5377
5260
  "incomplete"
5378
5261
  ]);
5379
5262
  var annotationSchema = () => {
5380
- const urlCitation = z20.object({
5381
- type: z20.literal("url_citation"),
5382
- url: z20.string().nullish(),
5383
- title: z20.string().nullish(),
5384
- start_index: z20.number().nullish(),
5385
- 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()
5386
5269
  }).loose();
5387
- const fileCitation = z20.object({
5388
- type: z20.literal("file_citation"),
5389
- file_name: z20.string().nullish(),
5390
- document_uri: z20.string().nullish(),
5391
- url: z20.string().nullish(),
5392
- page_number: z20.number().nullish(),
5393
- media_id: z20.string().nullish(),
5394
- start_index: z20.number().nullish(),
5395
- end_index: z20.number().nullish(),
5396
- 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()
5397
5280
  }).loose();
5398
- const placeCitation = z20.object({
5399
- type: z20.literal("place_citation"),
5400
- name: z20.string().nullish(),
5401
- url: z20.string().nullish(),
5402
- place_id: z20.string().nullish(),
5403
- start_index: z20.number().nullish(),
5404
- 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()
5405
5288
  }).loose();
5406
- return z20.union([
5289
+ return z19.union([
5407
5290
  urlCitation,
5408
5291
  fileCitation,
5409
5292
  placeCitation,
5410
- z20.object({ type: z20.string() }).loose()
5293
+ z19.object({ type: z19.string() }).loose()
5411
5294
  ]);
5412
5295
  };
5413
- var thoughtSummaryItemSchema = () => z20.object({
5414
- type: z20.string(),
5415
- text: z20.string().nullish(),
5416
- data: z20.string().nullish(),
5417
- 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()
5418
5301
  }).loose();
5419
5302
  var contentBlockSchema = () => {
5420
- const textContent = z20.object({
5421
- type: z20.literal("text"),
5422
- text: z20.string(),
5423
- 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()
5424
5307
  }).loose();
5425
- const imageContent = z20.object({
5426
- type: z20.literal("image"),
5427
- data: z20.string().nullish(),
5428
- mime_type: z20.string().nullish(),
5429
- resolution: z20.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5430
- 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()
5431
5314
  }).loose();
5432
- const videoContent = z20.object({
5433
- type: z20.literal("video"),
5434
- data: z20.string().nullish(),
5435
- mime_type: z20.string().nullish(),
5436
- 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()
5437
5320
  }).loose();
5438
- return z20.union([
5321
+ return z19.union([
5439
5322
  textContent,
5440
5323
  imageContent,
5441
5324
  videoContent,
5442
- z20.object({ type: z20.string() }).loose()
5325
+ z19.object({ type: z19.string() }).loose()
5443
5326
  ]);
5444
5327
  };
5445
5328
  var BUILTIN_TOOL_CALL_STEP_TYPES = [
@@ -5459,158 +5342,158 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
5459
5342
  "mcp_server_tool_result"
5460
5343
  ];
5461
5344
  var stepSchema = () => {
5462
- const userInputStep = z20.object({
5463
- type: z20.literal("user_input"),
5464
- content: z20.array(contentBlockSchema()).nullish()
5345
+ const userInputStep = z19.object({
5346
+ type: z19.literal("user_input"),
5347
+ content: z19.array(contentBlockSchema()).nullish()
5465
5348
  }).loose();
5466
- const modelOutputStep = z20.object({
5467
- type: z20.literal("model_output"),
5468
- content: z20.array(contentBlockSchema()).nullish()
5349
+ const modelOutputStep = z19.object({
5350
+ type: z19.literal("model_output"),
5351
+ content: z19.array(contentBlockSchema()).nullish()
5469
5352
  }).loose();
5470
- const functionCallStep = z20.object({
5471
- type: z20.literal("function_call"),
5472
- id: z20.string(),
5473
- name: z20.string(),
5474
- arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5475
- 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()
5476
5359
  }).loose();
5477
- const thoughtStep = z20.object({
5478
- type: z20.literal("thought"),
5479
- signature: z20.string().nullish(),
5480
- 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()
5481
5364
  }).loose();
5482
- const builtinToolCallStep = z20.object({
5483
- type: z20.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5484
- id: z20.string(),
5485
- arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5486
- name: z20.string().nullish(),
5487
- server_name: z20.string().nullish(),
5488
- search_type: z20.string().nullish(),
5489
- 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()
5490
5373
  }).loose();
5491
- const builtinToolResultStep = z20.object({
5492
- type: z20.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5493
- call_id: z20.string(),
5494
- result: z20.unknown().nullish(),
5495
- is_error: z20.boolean().nullish(),
5496
- name: z20.string().nullish(),
5497
- server_name: z20.string().nullish(),
5498
- 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()
5499
5382
  }).loose();
5500
- return z20.union([
5383
+ return z19.union([
5501
5384
  userInputStep,
5502
5385
  modelOutputStep,
5503
5386
  functionCallStep,
5504
5387
  thoughtStep,
5505
5388
  builtinToolCallStep,
5506
5389
  builtinToolResultStep,
5507
- z20.object({ type: z20.string() }).loose()
5390
+ z19.object({ type: z19.string() }).loose()
5508
5391
  ]);
5509
5392
  };
5510
- var googleInteractionsResponseSchema = lazySchema18(
5511
- () => zodSchema18(
5512
- z20.object({
5393
+ var googleInteractionsResponseSchema = lazySchema17(
5394
+ () => zodSchema17(
5395
+ z19.object({
5513
5396
  /*
5514
5397
  * `id` is omitted from the response body when `store: false` (fully
5515
5398
  * stateless mode) — there is no server-side interaction record for the
5516
5399
  * client to reference. `nullish` lets the schema accept that shape.
5517
5400
  */
5518
- id: z20.string().nullish(),
5519
- created: z20.string().nullish(),
5520
- updated: z20.string().nullish(),
5401
+ id: z19.string().nullish(),
5402
+ created: z19.string().nullish(),
5403
+ updated: z19.string().nullish(),
5521
5404
  status: interactionStatusSchema(),
5522
- model: z20.string().nullish(),
5523
- agent: z20.string().nullish(),
5524
- steps: z20.array(stepSchema()).nullish(),
5405
+ model: z19.string().nullish(),
5406
+ agent: z19.string().nullish(),
5407
+ steps: z19.array(stepSchema()).nullish(),
5525
5408
  usage: usageSchema2().nullish(),
5526
- service_tier: z20.string().nullish(),
5527
- previous_interaction_id: z20.string().nullish(),
5528
- 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()
5529
5412
  }).loose()
5530
5413
  )
5531
5414
  );
5532
- var googleInteractionsEventSchema = lazySchema18(
5533
- () => zodSchema18(
5415
+ var googleInteractionsEventSchema = lazySchema17(
5416
+ () => zodSchema17(
5534
5417
  (() => {
5535
5418
  const status = interactionStatusSchema();
5536
5419
  const annotation = annotationSchema();
5537
5420
  const thoughtSummaryItem = thoughtSummaryItemSchema();
5538
- const interactionCreatedEvent = z20.object({
5539
- event_type: z20.literal("interaction.created"),
5540
- event_id: z20.string().nullish(),
5541
- 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({
5542
5425
  /*
5543
5426
  * `id` is omitted when `store: false` (fully stateless mode);
5544
5427
  * see the matching note on `googleInteractionsResponseSchema.id`.
5545
5428
  */
5546
- id: z20.string().nullish(),
5547
- created: z20.string().nullish(),
5548
- model: z20.string().nullish(),
5549
- agent: z20.string().nullish(),
5429
+ id: z19.string().nullish(),
5430
+ created: z19.string().nullish(),
5431
+ model: z19.string().nullish(),
5432
+ agent: z19.string().nullish(),
5550
5433
  status: status.nullish()
5551
5434
  }).loose()
5552
5435
  }).loose();
5553
- const stepStartEvent = z20.object({
5554
- event_type: z20.literal("step.start"),
5555
- event_id: z20.string().nullish(),
5556
- 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(),
5557
5440
  step: stepSchema()
5558
5441
  }).loose();
5559
- const stepDeltaText = z20.object({
5560
- type: z20.literal("text"),
5561
- text: z20.string()
5442
+ const stepDeltaText = z19.object({
5443
+ type: z19.literal("text"),
5444
+ text: z19.string()
5562
5445
  }).loose();
5563
- const stepDeltaThoughtSummary = z20.object({
5564
- type: z20.literal("thought_summary"),
5446
+ const stepDeltaThoughtSummary = z19.object({
5447
+ type: z19.literal("thought_summary"),
5565
5448
  content: thoughtSummaryItem.nullish()
5566
5449
  }).loose();
5567
- const stepDeltaThoughtSignature = z20.object({
5568
- type: z20.literal("thought_signature"),
5569
- signature: z20.string().nullish()
5450
+ const stepDeltaThoughtSignature = z19.object({
5451
+ type: z19.literal("thought_signature"),
5452
+ signature: z19.string().nullish()
5570
5453
  }).loose();
5571
- const stepDeltaArgumentsDelta = z20.object({
5572
- type: z20.literal("arguments_delta"),
5573
- arguments: z20.string().nullish(),
5574
- id: z20.string().nullish(),
5575
- 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()
5576
5459
  }).loose();
5577
- const stepDeltaTextAnnotation = z20.object({
5578
- type: z20.enum(["text_annotation_delta", "text_annotation"]),
5579
- 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()
5580
5463
  }).loose();
5581
- const stepDeltaImage = z20.object({
5582
- type: z20.literal("image"),
5583
- data: z20.string().nullish(),
5584
- mime_type: z20.string().nullish(),
5585
- resolution: z20.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5586
- 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()
5587
5470
  }).loose();
5588
- const stepDeltaVideo = z20.object({
5589
- type: z20.literal("video"),
5590
- data: z20.string().nullish(),
5591
- mime_type: z20.string().nullish(),
5592
- 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()
5593
5476
  }).loose();
5594
- const stepDeltaBuiltinToolCall = z20.object({
5595
- type: z20.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5596
- id: z20.string().nullish(),
5597
- arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5598
- name: z20.string().nullish(),
5599
- server_name: z20.string().nullish(),
5600
- search_type: z20.string().nullish(),
5601
- 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()
5602
5485
  }).loose();
5603
- const stepDeltaBuiltinToolResult = z20.object({
5604
- type: z20.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5605
- call_id: z20.string().nullish(),
5606
- result: z20.unknown().nullish(),
5607
- is_error: z20.boolean().nullish(),
5608
- name: z20.string().nullish(),
5609
- server_name: z20.string().nullish(),
5610
- 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()
5611
5494
  }).loose();
5612
- const stepDeltaUnknown = z20.object({ type: z20.string() }).loose();
5613
- const stepDeltaUnion = z20.union([
5495
+ const stepDeltaUnknown = z19.object({ type: z19.string() }).loose();
5496
+ const stepDeltaUnion = z19.union([
5614
5497
  stepDeltaText,
5615
5498
  stepDeltaImage,
5616
5499
  stepDeltaVideo,
@@ -5622,55 +5505,55 @@ var googleInteractionsEventSchema = lazySchema18(
5622
5505
  stepDeltaBuiltinToolResult,
5623
5506
  stepDeltaUnknown
5624
5507
  ]);
5625
- const stepDeltaEvent = z20.object({
5626
- event_type: z20.literal("step.delta"),
5627
- event_id: z20.string().nullish(),
5628
- 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(),
5629
5512
  delta: stepDeltaUnion
5630
5513
  }).loose();
5631
- const stepStopEvent = z20.object({
5632
- event_type: z20.literal("step.stop"),
5633
- event_id: z20.string().nullish(),
5634
- 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()
5635
5518
  }).loose();
5636
- const interactionStatusUpdateEvent = z20.object({
5637
- event_type: z20.literal("interaction.status_update"),
5638
- event_id: z20.string().nullish(),
5639
- 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(),
5640
5523
  status: status.nullish()
5641
5524
  }).loose();
5642
- const interactionInProgressEvent = z20.object({
5643
- event_type: z20.literal("interaction.in_progress"),
5644
- event_id: z20.string().nullish(),
5645
- 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(),
5646
5529
  status: status.nullish()
5647
5530
  }).loose();
5648
- const interactionRequiresActionEvent = z20.object({
5649
- event_type: z20.literal("interaction.requires_action"),
5650
- event_id: z20.string().nullish(),
5651
- 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(),
5652
5535
  status: status.nullish()
5653
5536
  }).loose();
5654
- const interactionCompletedEvent = z20.object({
5655
- event_type: z20.literal("interaction.completed"),
5656
- event_id: z20.string().nullish(),
5657
- interaction: z20.object({
5658
- 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(),
5659
5542
  status: status.nullish(),
5660
5543
  usage: usageSchema2().nullish(),
5661
- service_tier: z20.string().nullish()
5544
+ service_tier: z19.string().nullish()
5662
5545
  }).loose()
5663
5546
  }).loose();
5664
- const errorEvent = z20.object({
5665
- event_type: z20.literal("error"),
5666
- event_id: z20.string().nullish(),
5667
- error: z20.object({
5668
- code: z20.string().nullish(),
5669
- 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()
5670
5553
  }).loose().nullish()
5671
5554
  }).loose();
5672
- const unknownEvent = z20.object({ event_type: z20.string() }).loose();
5673
- return z20.union([
5555
+ const unknownEvent = z19.object({ event_type: z19.string() }).loose();
5556
+ return z19.union([
5674
5557
  interactionCreatedEvent,
5675
5558
  stepStartEvent,
5676
5559
  stepDeltaEvent,
@@ -5688,29 +5571,29 @@ var googleInteractionsEventSchema = lazySchema18(
5688
5571
 
5689
5572
  // src/interactions/google-interactions-language-model-options.ts
5690
5573
  import {
5691
- lazySchema as lazySchema19,
5692
- zodSchema as zodSchema19
5574
+ lazySchema as lazySchema18,
5575
+ zodSchema as zodSchema18
5693
5576
  } from "@ai-sdk/provider-utils";
5694
- import { z as z21 } from "zod/v4";
5695
- var googleInteractionsLanguageModelOptions = lazySchema19(
5696
- () => zodSchema19(
5697
- z21.object({
5698
- previousInteractionId: z21.string().nullish(),
5699
- store: z21.boolean().nullish(),
5700
- agent: z21.string().nullish(),
5701
- agentConfig: z21.union([
5702
- z21.object({
5703
- 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")
5704
5587
  }).loose(),
5705
- z21.object({
5706
- type: z21.literal("deep-research"),
5707
- thinkingSummaries: z21.enum(["auto", "none"]).nullish(),
5708
- visualization: z21.enum(["off", "auto"]).nullish(),
5709
- 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()
5710
5593
  })
5711
5594
  ]).nullish(),
5712
- thinkingLevel: z21.enum(["minimal", "low", "medium", "high"]).nullish(),
5713
- thinkingSummaries: z21.enum(["auto", "none"]).nullish(),
5595
+ thinkingLevel: z20.enum(["minimal", "low", "medium", "high"]).nullish(),
5596
+ thinkingSummaries: z20.enum(["auto", "none"]).nullish(),
5714
5597
  /**
5715
5598
  * Output-format entries that map directly to the API's `response_format`
5716
5599
  * array. Use this to request image, audio, or non-JSON text outputs
@@ -5720,17 +5603,17 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5720
5603
  * type: 'json', schema }` still drives JSON-mode and adds a matching
5721
5604
  * text entry automatically; entries listed here are appended.
5722
5605
  */
5723
- responseFormat: z21.array(
5724
- z21.union([
5725
- z21.object({
5726
- type: z21.literal("text"),
5727
- mimeType: z21.string().nullish(),
5728
- 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()
5729
5612
  }).loose(),
5730
- z21.object({
5731
- type: z21.literal("image"),
5732
- mimeType: z21.string().nullish(),
5733
- aspectRatio: z21.enum([
5613
+ z20.object({
5614
+ type: z20.literal("image"),
5615
+ mimeType: z20.string().nullish(),
5616
+ aspectRatio: z20.enum([
5734
5617
  "1:1",
5735
5618
  "2:3",
5736
5619
  "3:2",
@@ -5746,11 +5629,11 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5746
5629
  "1:4",
5747
5630
  "4:1"
5748
5631
  ]).nullish(),
5749
- imageSize: z21.enum(["1K", "2K", "4K", "512"]).nullish()
5632
+ imageSize: z20.enum(["1K", "2K", "4K", "512"]).nullish()
5750
5633
  }).loose(),
5751
- z21.object({
5752
- type: z21.literal("audio"),
5753
- mimeType: z21.string().nullish()
5634
+ z20.object({
5635
+ type: z20.literal("audio"),
5636
+ mimeType: z20.string().nullish()
5754
5637
  }).loose()
5755
5638
  ])
5756
5639
  ).nullish(),
@@ -5760,8 +5643,8 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5760
5643
  * translates it into a matching `response_format` image entry and
5761
5644
  * emits a warning when set.
5762
5645
  */
5763
- imageConfig: z21.object({
5764
- aspectRatio: z21.enum([
5646
+ imageConfig: z20.object({
5647
+ aspectRatio: z20.enum([
5765
5648
  "1:1",
5766
5649
  "2:3",
5767
5650
  "3:2",
@@ -5777,35 +5660,35 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5777
5660
  "1:4",
5778
5661
  "4:1"
5779
5662
  ]).nullish(),
5780
- imageSize: z21.enum(["1K", "2K", "4K", "512"]).nullish()
5663
+ imageSize: z20.enum(["1K", "2K", "4K", "512"]).nullish()
5781
5664
  }).nullish(),
5782
- mediaResolution: z21.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5783
- responseModalities: z21.array(z21.enum(["text", "image", "audio", "video", "document"])).nullish(),
5784
- 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(),
5785
5668
  /**
5786
5669
  * Alternative to AI SDK `system` message. If both are set, the AI SDK
5787
5670
  * `system` message wins and a warning is emitted.
5788
5671
  */
5789
- systemInstruction: z21.string().nullish(),
5672
+ systemInstruction: z20.string().nullish(),
5790
5673
  /**
5791
5674
  * Per-block signature for round-tripping `thought.signature` and
5792
5675
  * `function_call.signature` blocks. Set by the SDK on output reasoning /
5793
5676
  * tool-call parts; passed back unchanged on input parts so the API
5794
5677
  * accepts the prior turn.
5795
5678
  */
5796
- signature: z21.string().nullish(),
5679
+ signature: z20.string().nullish(),
5797
5680
  /**
5798
5681
  * Set by the SDK on output assistant messages. The converter uses it to
5799
5682
  * decide which messages to drop when compacting under
5800
5683
  * `previousInteractionId`.
5801
5684
  */
5802
- interactionId: z21.string().nullish(),
5685
+ interactionId: z20.string().nullish(),
5803
5686
  /**
5804
5687
  * Maximum time, in milliseconds, to poll a background interaction (agent
5805
5688
  * call) before giving up. Defaults to 30 minutes. Long-running agents
5806
5689
  * such as deep research can take tens of minutes — increase if needed.
5807
5690
  */
5808
- pollingTimeoutMs: z21.number().int().positive().nullish(),
5691
+ pollingTimeoutMs: z20.number().int().positive().nullish(),
5809
5692
  /**
5810
5693
  * Run the interaction in the background. Required for agents whose
5811
5694
  * server-side workflow cannot complete within a single request/response.
@@ -5814,7 +5697,7 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5814
5697
  * reject `true`; see the agent's documentation for which mode it
5815
5698
  * requires.
5816
5699
  */
5817
- background: z21.boolean().nullish(),
5700
+ background: z20.boolean().nullish(),
5818
5701
  /**
5819
5702
  * Environment configuration for the agent sandbox. Only applies to agent
5820
5703
  * calls (`google.interactions({ agent })`); ignored on model-id calls.
@@ -5824,36 +5707,36 @@ var googleInteractionsLanguageModelOptions = lazySchema19(
5824
5707
  * - object: provision a fresh sandbox and optionally preload `sources`
5825
5708
  * and/or constrain outbound traffic via `network`.
5826
5709
  */
5827
- environment: z21.union([
5828
- z21.string(),
5829
- z21.object({
5830
- type: z21.literal("remote"),
5831
- sources: z21.array(
5832
- z21.union([
5833
- z21.object({
5834
- type: z21.literal("gcs"),
5835
- source: z21.string(),
5836
- 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()
5837
5720
  }),
5838
- z21.object({
5839
- type: z21.literal("repository"),
5840
- source: z21.string(),
5841
- target: z21.string().nullish()
5721
+ z20.object({
5722
+ type: z20.literal("repository"),
5723
+ source: z20.string(),
5724
+ target: z20.string().nullish()
5842
5725
  }),
5843
- z21.object({
5844
- type: z21.literal("inline"),
5845
- content: z21.string(),
5846
- target: z21.string()
5726
+ z20.object({
5727
+ type: z20.literal("inline"),
5728
+ content: z20.string(),
5729
+ target: z20.string()
5847
5730
  })
5848
5731
  ])
5849
5732
  ).nullish(),
5850
- network: z21.union([
5851
- z21.literal("disabled"),
5852
- z21.object({
5853
- allowlist: z21.array(
5854
- z21.object({
5855
- domain: z21.string(),
5856
- 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()
5857
5740
  })
5858
5741
  )
5859
5742
  })
@@ -6043,7 +5926,7 @@ function parseGoogleInteractionsOutputs({
6043
5926
 
6044
5927
  // src/interactions/poll-google-interactions.ts
6045
5928
  import {
6046
- createJsonResponseHandler as createJsonResponseHandler7,
5929
+ createJsonResponseHandler as createJsonResponseHandler6,
6047
5930
  delay as delay2,
6048
5931
  getFromApi as getFromApi3,
6049
5932
  isAbortError
@@ -6051,7 +5934,7 @@ import {
6051
5934
 
6052
5935
  // src/interactions/cancel-google-interaction.ts
6053
5936
  import {
6054
- combineHeaders as combineHeaders7,
5937
+ combineHeaders as combineHeaders6,
6055
5938
  getRuntimeEnvironmentUserAgent,
6056
5939
  withUserAgentSuffix
6057
5940
  } from "@ai-sdk/provider-utils";
@@ -6070,7 +5953,7 @@ async function cancelGoogleInteraction({
6070
5953
  const response = await fetch2(url, {
6071
5954
  method: "POST",
6072
5955
  headers: withUserAgentSuffix(
6073
- combineHeaders7({ "Content-Type": "application/json" }, headers),
5956
+ combineHeaders6({ "Content-Type": "application/json" }, headers),
6074
5957
  getRuntimeEnvironmentUserAgent()
6075
5958
  ),
6076
5959
  body: "{}"
@@ -6131,7 +6014,7 @@ async function pollGoogleInteractionUntilTerminal({
6131
6014
  validateUrl: false,
6132
6015
  headers,
6133
6016
  failedResponseHandler: googleFailedResponseHandler,
6134
- successfulResponseHandler: createJsonResponseHandler7(
6017
+ successfulResponseHandler: createJsonResponseHandler6(
6135
6018
  googleInteractionsResponseSchema
6136
6019
  ),
6137
6020
  abortSignal,
@@ -6907,16 +6790,16 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6907
6790
  var _a, _b, _c, _d, _e, _f;
6908
6791
  const { args, warnings, isAgent, pollingTimeoutMs } = await this.getArgs(options);
6909
6792
  const url = `${this.config.baseURL}/interactions`;
6910
- const mergedHeaders = combineHeaders8(
6911
- 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,
6912
6795
  options.headers
6913
6796
  );
6914
- const postResult = await postJsonToApi6({
6797
+ const postResult = await postJsonToApi5({
6915
6798
  url,
6916
6799
  headers: mergedHeaders,
6917
6800
  body: args,
6918
6801
  failedResponseHandler: googleFailedResponseHandler,
6919
- successfulResponseHandler: createJsonResponseHandler8(
6802
+ successfulResponseHandler: createJsonResponseHandler7(
6920
6803
  googleInteractionsResponseSchema
6921
6804
  ),
6922
6805
  abortSignal: options.abortSignal,
@@ -6991,8 +6874,8 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6991
6874
  var _a;
6992
6875
  const { args, warnings, isBackground, pollingTimeoutMs } = await this.getArgs(options);
6993
6876
  const url = `${this.config.baseURL}/interactions`;
6994
- const mergedHeaders = combineHeaders8(
6995
- 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,
6996
6879
  options.headers
6997
6880
  );
6998
6881
  if (isBackground) {
@@ -7006,7 +6889,7 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
7006
6889
  });
7007
6890
  }
7008
6891
  const body = { ...args, stream: true };
7009
- const { responseHeaders, value: response } = await postJsonToApi6({
6892
+ const { responseHeaders, value: response } = await postJsonToApi5({
7010
6893
  url,
7011
6894
  headers: mergedHeaders,
7012
6895
  body,
@@ -7057,12 +6940,12 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
7057
6940
  pollingTimeoutMs
7058
6941
  }) {
7059
6942
  var _a, _b;
7060
- const postResult = await postJsonToApi6({
6943
+ const postResult = await postJsonToApi5({
7061
6944
  url,
7062
6945
  headers: mergedHeaders,
7063
6946
  body: args,
7064
6947
  failedResponseHandler: googleFailedResponseHandler,
7065
- successfulResponseHandler: createJsonResponseHandler8(
6948
+ successfulResponseHandler: createJsonResponseHandler7(
7066
6949
  googleInteractionsResponseSchema
7067
6950
  ),
7068
6951
  abortSignal: options.abortSignal,
@@ -7549,7 +7432,7 @@ import {
7549
7432
  } from "@ai-sdk/provider";
7550
7433
  import {
7551
7434
  connectToWebSocket,
7552
- combineHeaders as combineHeaders9,
7435
+ combineHeaders as combineHeaders8,
7553
7436
  convertBase64ToUint8Array as convertBase64ToUint8Array2,
7554
7437
  convertToBase64 as convertToBase644,
7555
7438
  parseProviderOptions as parseProviderOptions8,
@@ -7562,18 +7445,18 @@ import {
7562
7445
 
7563
7446
  // src/speech-translation/google-speech-translation-model-options.ts
7564
7447
  import {
7565
- lazySchema as lazySchema20,
7566
- zodSchema as zodSchema20
7448
+ lazySchema as lazySchema19,
7449
+ zodSchema as zodSchema19
7567
7450
  } from "@ai-sdk/provider-utils";
7568
- import { z as z22 } from "zod/v4";
7569
- var googleSpeechTranslationModelOptions = lazySchema20(
7570
- () => zodSchema20(
7571
- z22.object({
7451
+ import { z as z21 } from "zod/v4";
7452
+ var googleSpeechTranslationModelOptions = lazySchema19(
7453
+ () => zodSchema19(
7454
+ z21.object({
7572
7455
  /**
7573
7456
  * Whether input audio already in the target language should be echoed
7574
7457
  * instead of producing silence.
7575
7458
  */
7576
- echoTargetLanguage: z22.boolean().optional()
7459
+ echoTargetLanguage: z21.boolean().optional()
7577
7460
  })
7578
7461
  )
7579
7462
  );
@@ -7636,7 +7519,7 @@ var GoogleSpeechTranslationModel = class _GoogleSpeechTranslationModel {
7636
7519
  details: "The Gemini Live API always outputs 24kHz 16-bit PCM audio and does not accept an output audio format."
7637
7520
  });
7638
7521
  }
7639
- const headers = combineHeaders9(this.config.headers(), options.headers);
7522
+ const headers = combineHeaders8(this.config.headers(), options.headers);
7640
7523
  let apiKey;
7641
7524
  for (const [key, value] of Object.entries(headers)) {
7642
7525
  if (key.toLowerCase() === "x-goog-api-key" && value != null) {
@@ -7699,8 +7582,8 @@ function createGoogleLiveSpeechTranslationStream({
7699
7582
  let audioReader;
7700
7583
  let connection;
7701
7584
  let resolveSetupComplete;
7702
- const setupComplete = new Promise((resolve7) => {
7703
- resolveSetupComplete = resolve7;
7585
+ const setupComplete = new Promise((resolve6) => {
7586
+ resolveSetupComplete = resolve6;
7704
7587
  });
7705
7588
  let turnCounter = 0;
7706
7589
  let sourceText = "";