@ai-sdk/google 4.0.0-canary.74 → 4.0.0-canary.76

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.0-canary.74" : "0.0.0-test";
10
+ var VERSION = true ? "4.0.0-canary.76" : "0.0.0-test";
11
11
 
12
12
  // src/google-embedding-model.ts
13
13
  import {
@@ -1428,19 +1428,19 @@ var GoogleJSONAccumulator = class {
1428
1428
  let fragment = "";
1429
1429
  const startIdx = this.pathStack.length - 1;
1430
1430
  for (let i = startIdx; i < targetContainer.length; i++) {
1431
- const seg = targetContainer[i];
1431
+ const pathSegment = targetContainer[i];
1432
1432
  const parentEntry = this.pathStack[this.pathStack.length - 1];
1433
1433
  if (parentEntry.childCount > 0) {
1434
1434
  fragment += ",";
1435
1435
  }
1436
1436
  parentEntry.childCount++;
1437
- if (typeof seg === "string") {
1438
- fragment += `${JSON.stringify(seg)}:`;
1437
+ if (typeof pathSegment === "string") {
1438
+ fragment += `${JSON.stringify(pathSegment)}:`;
1439
1439
  }
1440
1440
  const childSeg = i + 1 < targetContainer.length ? targetContainer[i + 1] : leafSegment;
1441
1441
  const isArray = typeof childSeg === "number";
1442
1442
  fragment += isArray ? "[" : "{";
1443
- this.pathStack.push({ segment: seg, isArray, childCount: 0 });
1443
+ this.pathStack.push({ segment: pathSegment, isArray, childCount: 0 });
1444
1444
  }
1445
1445
  return fragment;
1446
1446
  }
@@ -1486,21 +1486,21 @@ function parsePath(rawPath) {
1486
1486
  }
1487
1487
  function getNestedValue(obj, segments) {
1488
1488
  let current = obj;
1489
- for (const seg of segments) {
1489
+ for (const pathSegment of segments) {
1490
1490
  if (current == null || typeof current !== "object") return void 0;
1491
- current = current[seg];
1491
+ current = current[pathSegment];
1492
1492
  }
1493
1493
  return current;
1494
1494
  }
1495
1495
  function setNestedValue(obj, segments, value) {
1496
1496
  let current = obj;
1497
1497
  for (let i = 0; i < segments.length - 1; i++) {
1498
- const seg = segments[i];
1498
+ const pathSegment = segments[i];
1499
1499
  const nextSeg = segments[i + 1];
1500
- if (current[seg] == null) {
1501
- current[seg] = typeof nextSeg === "number" ? [] : {};
1500
+ if (current[pathSegment] == null) {
1501
+ current[pathSegment] = typeof nextSeg === "number" ? [] : {};
1502
1502
  }
1503
- current = current[seg];
1503
+ current = current[pathSegment];
1504
1504
  }
1505
1505
  current[segments[segments.length - 1]] = value;
1506
1506
  }
@@ -3573,12 +3573,11 @@ var googleOperationSchema = z17.object({
3573
3573
  }).nullish()
3574
3574
  });
3575
3575
 
3576
- // src/interactions/google-interactions-language-model.ts
3576
+ // src/google-speech-model.ts
3577
3577
  import {
3578
- combineHeaders as combineHeaders7,
3579
- createEventSourceResponseHandler as createEventSourceResponseHandler3,
3580
- createJsonResponseHandler as createJsonResponseHandler7,
3581
- generateId as defaultGenerateId2,
3578
+ combineHeaders as combineHeaders6,
3579
+ convertBase64ToUint8Array,
3580
+ createJsonResponseHandler as createJsonResponseHandler6,
3582
3581
  parseProviderOptions as parseProviderOptions6,
3583
3582
  postJsonToApi as postJsonToApi5,
3584
3583
  resolve as resolve5,
@@ -3587,6 +3586,266 @@ import {
3587
3586
  WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE4
3588
3587
  } from "@ai-sdk/provider-utils";
3589
3588
 
3589
+ // src/google-speech-api.ts
3590
+ import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
3591
+ import { z as z18 } from "zod/v4";
3592
+ var googleSpeechResponseSchema = lazySchema16(
3593
+ () => zodSchema16(
3594
+ z18.object({
3595
+ candidates: z18.array(
3596
+ z18.object({
3597
+ content: z18.object({
3598
+ parts: z18.array(
3599
+ z18.object({
3600
+ inlineData: z18.object({
3601
+ mimeType: z18.string().nullish(),
3602
+ data: z18.string().nullish()
3603
+ }).nullish()
3604
+ })
3605
+ ).nullish()
3606
+ }).nullish()
3607
+ })
3608
+ ).nullish()
3609
+ })
3610
+ )
3611
+ );
3612
+
3613
+ // src/google-speech-model-options.ts
3614
+ import {
3615
+ lazySchema as lazySchema17,
3616
+ zodSchema as zodSchema17
3617
+ } from "@ai-sdk/provider-utils";
3618
+ import { z as z19 } from "zod/v4";
3619
+ var prebuiltVoiceConfigSchema = z19.object({
3620
+ voiceName: z19.string()
3621
+ });
3622
+ var voiceConfigSchema = z19.object({
3623
+ prebuiltVoiceConfig: prebuiltVoiceConfigSchema
3624
+ });
3625
+ var googleSpeechProviderOptionsSchema = lazySchema17(
3626
+ () => zodSchema17(
3627
+ z19.object({
3628
+ /**
3629
+ * Multi-speaker configuration for dialogue audio. When provided, this
3630
+ * overrides the top-level `voice`. The Gemini TTS API supports up to two
3631
+ * speakers; each speaker name must match a name used in the input text.
3632
+ *
3633
+ * https://ai.google.dev/gemini-api/docs/speech-generation#multi-speaker
3634
+ */
3635
+ multiSpeakerVoiceConfig: z19.object({
3636
+ speakerVoiceConfigs: z19.array(
3637
+ z19.object({
3638
+ speaker: z19.string(),
3639
+ voiceConfig: voiceConfigSchema
3640
+ })
3641
+ )
3642
+ }).optional()
3643
+ })
3644
+ )
3645
+ );
3646
+
3647
+ // src/google-speech-model.ts
3648
+ var DEFAULT_VOICE = "Kore";
3649
+ var DEFAULT_SAMPLE_RATE = 24e3;
3650
+ var GoogleSpeechModel = class _GoogleSpeechModel {
3651
+ constructor(modelId, config) {
3652
+ this.modelId = modelId;
3653
+ this.config = config;
3654
+ this.specificationVersion = "v4";
3655
+ }
3656
+ static [WORKFLOW_SERIALIZE4](model) {
3657
+ return serializeModelOptions4({
3658
+ modelId: model.modelId,
3659
+ config: model.config
3660
+ });
3661
+ }
3662
+ static [WORKFLOW_DESERIALIZE4](options) {
3663
+ return new _GoogleSpeechModel(options.modelId, options.config);
3664
+ }
3665
+ get provider() {
3666
+ return this.config.provider;
3667
+ }
3668
+ async getArgs({
3669
+ text,
3670
+ voice = DEFAULT_VOICE,
3671
+ outputFormat,
3672
+ instructions,
3673
+ speed,
3674
+ language,
3675
+ providerOptions
3676
+ }) {
3677
+ const warnings = [];
3678
+ const googleOptions = await parseProviderOptions6({
3679
+ provider: "google",
3680
+ providerOptions,
3681
+ schema: googleSpeechProviderOptionsSchema
3682
+ });
3683
+ const multiSpeakerVoiceConfig = googleOptions == null ? void 0 : googleOptions.multiSpeakerVoiceConfig;
3684
+ const speechConfig = multiSpeakerVoiceConfig ? { multiSpeakerVoiceConfig } : { voiceConfig: { prebuiltVoiceConfig: { voiceName: voice } } };
3685
+ let promptText = text;
3686
+ if (instructions != null) {
3687
+ if (multiSpeakerVoiceConfig) {
3688
+ warnings.push({
3689
+ type: "unsupported",
3690
+ feature: "instructions",
3691
+ details: "Google Gemini TTS ignores `instructions` when `multiSpeakerVoiceConfig` is set, because prepending them would break multi-speaker transcript parsing."
3692
+ });
3693
+ } else {
3694
+ promptText = `${instructions}: ${text}`;
3695
+ }
3696
+ }
3697
+ if (speed != null) {
3698
+ warnings.push({
3699
+ type: "unsupported",
3700
+ feature: "speed",
3701
+ details: "Google Gemini TTS models do not support the `speed` option. It was ignored."
3702
+ });
3703
+ }
3704
+ if (language != null) {
3705
+ warnings.push({
3706
+ type: "unsupported",
3707
+ feature: "language",
3708
+ details: "Google Gemini TTS models do not support the `language` option. Language is detected automatically from the input text."
3709
+ });
3710
+ }
3711
+ let resolvedOutputFormat = "wav";
3712
+ if (outputFormat === "pcm") {
3713
+ resolvedOutputFormat = "pcm";
3714
+ } else if (outputFormat != null && outputFormat !== "wav") {
3715
+ warnings.push({
3716
+ type: "unsupported",
3717
+ feature: "outputFormat",
3718
+ details: `Unsupported output format: ${outputFormat}. Using wav instead.`
3719
+ });
3720
+ }
3721
+ const requestBody = {
3722
+ contents: [{ parts: [{ text: promptText }] }],
3723
+ generationConfig: {
3724
+ responseModalities: ["AUDIO"],
3725
+ speechConfig
3726
+ }
3727
+ };
3728
+ return { requestBody, warnings, outputFormat: resolvedOutputFormat };
3729
+ }
3730
+ async doGenerate(options) {
3731
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
3732
+ const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
3733
+ const { requestBody, warnings, outputFormat } = await this.getArgs(options);
3734
+ const {
3735
+ value: response,
3736
+ responseHeaders,
3737
+ rawValue: rawResponse
3738
+ } = await postJsonToApi5({
3739
+ url: `${this.config.baseURL}/models/${this.modelId}:generateContent`,
3740
+ headers: combineHeaders6(
3741
+ this.config.headers ? await resolve5(this.config.headers) : void 0,
3742
+ options.headers
3743
+ ),
3744
+ body: requestBody,
3745
+ failedResponseHandler: googleFailedResponseHandler,
3746
+ successfulResponseHandler: createJsonResponseHandler6(
3747
+ googleSpeechResponseSchema
3748
+ ),
3749
+ abortSignal: options.abortSignal,
3750
+ fetch: this.config.fetch
3751
+ });
3752
+ let base64Audio;
3753
+ let mimeType;
3754
+ for (const candidate of (_d = response.candidates) != null ? _d : []) {
3755
+ for (const part of (_f = (_e = candidate.content) == null ? void 0 : _e.parts) != null ? _f : []) {
3756
+ if ((_g = part.inlineData) == null ? void 0 : _g.data) {
3757
+ base64Audio = part.inlineData.data;
3758
+ mimeType = (_h = part.inlineData.mimeType) != null ? _h : void 0;
3759
+ break;
3760
+ }
3761
+ }
3762
+ if (base64Audio != null) {
3763
+ break;
3764
+ }
3765
+ }
3766
+ const sampleRate = (_i = parseSampleRate(mimeType)) != null ? _i : DEFAULT_SAMPLE_RATE;
3767
+ const pcm = base64Audio != null ? convertBase64ToUint8Array(base64Audio) : new Uint8Array(0);
3768
+ const audio = outputFormat === "pcm" || pcm.length === 0 ? pcm : addWavHeader(pcm, sampleRate);
3769
+ if (outputFormat === "pcm" && pcm.length > 0) {
3770
+ warnings.push({
3771
+ type: "unsupported",
3772
+ feature: "outputFormat",
3773
+ details: `Returning raw PCM audio (signed 16-bit little-endian, mono, ${sampleRate} Hz). These bytes have no container header and are not directly playable; see providerMetadata.google for the sample rate and mime type.`
3774
+ });
3775
+ }
3776
+ return {
3777
+ audio,
3778
+ warnings,
3779
+ request: {
3780
+ body: JSON.stringify(requestBody)
3781
+ },
3782
+ response: {
3783
+ timestamp: currentDate,
3784
+ modelId: this.modelId,
3785
+ headers: responseHeaders,
3786
+ body: rawResponse
3787
+ },
3788
+ providerMetadata: {
3789
+ google: {
3790
+ sampleRate,
3791
+ mimeType: mimeType != null ? mimeType : null
3792
+ }
3793
+ }
3794
+ };
3795
+ }
3796
+ };
3797
+ function parseSampleRate(mimeType) {
3798
+ if (mimeType == null) {
3799
+ return void 0;
3800
+ }
3801
+ const match = /rate=(\d+)/.exec(mimeType);
3802
+ return match ? Number.parseInt(match[1], 10) : void 0;
3803
+ }
3804
+ function addWavHeader(pcm, sampleRate) {
3805
+ const numChannels = 1;
3806
+ const bitsPerSample = 16;
3807
+ const blockAlign = numChannels * bitsPerSample / 8;
3808
+ const byteRate = sampleRate * blockAlign;
3809
+ const dataSize = pcm.length;
3810
+ const buffer = new ArrayBuffer(44 + dataSize);
3811
+ const view = new DataView(buffer);
3812
+ writeAscii(view, 0, "RIFF");
3813
+ view.setUint32(4, 36 + dataSize, true);
3814
+ writeAscii(view, 8, "WAVE");
3815
+ writeAscii(view, 12, "fmt ");
3816
+ view.setUint32(16, 16, true);
3817
+ view.setUint16(20, 1, true);
3818
+ view.setUint16(22, numChannels, true);
3819
+ view.setUint32(24, sampleRate, true);
3820
+ view.setUint32(28, byteRate, true);
3821
+ view.setUint16(32, blockAlign, true);
3822
+ view.setUint16(34, bitsPerSample, true);
3823
+ writeAscii(view, 36, "data");
3824
+ view.setUint32(40, dataSize, true);
3825
+ const out = new Uint8Array(buffer);
3826
+ out.set(pcm, 44);
3827
+ return out;
3828
+ }
3829
+ function writeAscii(view, offset, text) {
3830
+ for (let i = 0; i < text.length; i++) {
3831
+ view.setUint8(offset + i, text.charCodeAt(i));
3832
+ }
3833
+ }
3834
+
3835
+ // src/interactions/google-interactions-language-model.ts
3836
+ import {
3837
+ combineHeaders as combineHeaders8,
3838
+ createEventSourceResponseHandler as createEventSourceResponseHandler3,
3839
+ createJsonResponseHandler as createJsonResponseHandler8,
3840
+ generateId as defaultGenerateId2,
3841
+ parseProviderOptions as parseProviderOptions7,
3842
+ postJsonToApi as postJsonToApi6,
3843
+ resolve as resolve6,
3844
+ serializeModelOptions as serializeModelOptions5,
3845
+ WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE5,
3846
+ WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE5
3847
+ } from "@ai-sdk/provider-utils";
3848
+
3590
3849
  // src/interactions/convert-google-interactions-usage.ts
3591
3850
  function convertGoogleInteractionsUsage(usage) {
3592
3851
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -3654,19 +3913,21 @@ function annotationToSource({
3654
3913
  var _a, _b, _c, _d, _e;
3655
3914
  switch (annotation.type) {
3656
3915
  case "url_citation": {
3657
- const a = annotation;
3658
- if (a.url == null || a.url.length === 0) return void 0;
3916
+ const urlCitation = annotation;
3917
+ if (urlCitation.url == null || urlCitation.url.length === 0) {
3918
+ return void 0;
3919
+ }
3659
3920
  return {
3660
3921
  type: "source",
3661
3922
  sourceType: "url",
3662
3923
  id: generateId3(),
3663
- url: a.url,
3664
- ...a.title != null ? { title: a.title } : {}
3924
+ url: urlCitation.url,
3925
+ ...urlCitation.title != null ? { title: urlCitation.title } : {}
3665
3926
  };
3666
3927
  }
3667
3928
  case "file_citation": {
3668
- const a = annotation;
3669
- const uri = (_b = (_a = a.url) != null ? _a : a.document_uri) != null ? _b : a.file_name;
3929
+ const fileCitation = annotation;
3930
+ const uri = (_b = (_a = fileCitation.url) != null ? _a : fileCitation.document_uri) != null ? _b : fileCitation.file_name;
3670
3931
  if (uri == null || uri.length === 0) return void 0;
3671
3932
  if (uri.startsWith("http://") || uri.startsWith("https://")) {
3672
3933
  return {
@@ -3674,29 +3935,31 @@ function annotationToSource({
3674
3935
  sourceType: "url",
3675
3936
  id: generateId3(),
3676
3937
  url: uri,
3677
- ...a.file_name != null ? { title: a.file_name } : {}
3938
+ ...fileCitation.file_name != null ? { title: fileCitation.file_name } : {}
3678
3939
  };
3679
3940
  }
3680
- const filename = (_c = a.file_name) != null ? _c : basename(uri);
3941
+ const filename = (_c = fileCitation.file_name) != null ? _c : basename(uri);
3681
3942
  const mediaType = inferDocMediaType(uri);
3682
3943
  return {
3683
3944
  type: "source",
3684
3945
  sourceType: "document",
3685
3946
  id: generateId3(),
3686
3947
  mediaType,
3687
- title: (_e = (_d = a.file_name) != null ? _d : filename) != null ? _e : uri,
3948
+ title: (_e = (_d = fileCitation.file_name) != null ? _d : filename) != null ? _e : uri,
3688
3949
  ...filename != null ? { filename } : {}
3689
3950
  };
3690
3951
  }
3691
3952
  case "place_citation": {
3692
- const a = annotation;
3693
- if (a.url == null || a.url.length === 0) return void 0;
3953
+ const placeCitation = annotation;
3954
+ if (placeCitation.url == null || placeCitation.url.length === 0) {
3955
+ return void 0;
3956
+ }
3694
3957
  return {
3695
3958
  type: "source",
3696
3959
  sourceType: "url",
3697
3960
  id: generateId3(),
3698
- url: a.url,
3699
- ...a.name != null ? { title: a.name } : {}
3961
+ url: placeCitation.url,
3962
+ ...placeCitation.name != null ? { title: placeCitation.name } : {}
3700
3963
  };
3701
3964
  }
3702
3965
  default:
@@ -4034,22 +4297,22 @@ function buildGoogleInteractionsStreamTransform({
4034
4297
  }
4035
4298
  }
4036
4299
  if (dtype === "image" && (open.kind === "pending_model_output" || open.kind === "text" || open.kind === "image")) {
4037
- const img = event.delta;
4300
+ const imageDelta = event.delta;
4038
4301
  const google2 = {};
4039
4302
  if (interactionId != null) google2.interactionId = interactionId;
4040
4303
  const providerMetadata = Object.keys(google2).length > 0 ? { google: google2 } : void 0;
4041
- if ((img == null ? void 0 : img.data) != null && img.data.length > 0) {
4304
+ if ((imageDelta == null ? void 0 : imageDelta.data) != null && imageDelta.data.length > 0) {
4042
4305
  controller.enqueue({
4043
4306
  type: "file",
4044
- mediaType: (_k = img.mime_type) != null ? _k : "image/png",
4045
- data: { type: "data", data: img.data },
4307
+ mediaType: (_k = imageDelta.mime_type) != null ? _k : "image/png",
4308
+ data: { type: "data", data: imageDelta.data },
4046
4309
  ...providerMetadata ? { providerMetadata } : {}
4047
4310
  });
4048
- } else if ((img == null ? void 0 : img.uri) != null && img.uri.length > 0) {
4311
+ } else if ((imageDelta == null ? void 0 : imageDelta.uri) != null && imageDelta.uri.length > 0) {
4049
4312
  controller.enqueue({
4050
4313
  type: "file",
4051
- mediaType: (_l = img.mime_type) != null ? _l : "image/png",
4052
- data: { type: "url", url: new URL(img.uri) },
4314
+ mediaType: (_l = imageDelta.mime_type) != null ? _l : "image/png",
4315
+ data: { type: "url", url: new URL(imageDelta.uri) },
4053
4316
  ...providerMetadata ? { providerMetadata } : {}
4054
4317
  });
4055
4318
  }
@@ -4682,33 +4945,33 @@ ${block.text}`
4682
4945
 
4683
4946
  // src/interactions/google-interactions-api.ts
4684
4947
  import {
4685
- lazySchema as lazySchema16,
4686
- zodSchema as zodSchema16
4948
+ lazySchema as lazySchema18,
4949
+ zodSchema as zodSchema18
4687
4950
  } from "@ai-sdk/provider-utils";
4688
- import { z as z18 } from "zod/v4";
4689
- var tokenByModalitySchema = () => z18.object({
4690
- modality: z18.string().nullish(),
4691
- tokens: z18.number().nullish()
4951
+ import { z as z20 } from "zod/v4";
4952
+ var tokenByModalitySchema = () => z20.object({
4953
+ modality: z20.string().nullish(),
4954
+ tokens: z20.number().nullish()
4692
4955
  }).loose();
4693
- var usageSchema2 = () => z18.object({
4694
- total_input_tokens: z18.number().nullish(),
4695
- total_output_tokens: z18.number().nullish(),
4696
- total_thought_tokens: z18.number().nullish(),
4697
- total_cached_tokens: z18.number().nullish(),
4698
- total_tool_use_tokens: z18.number().nullish(),
4699
- total_tokens: z18.number().nullish(),
4700
- input_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
4701
- output_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
4702
- cached_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
4703
- tool_use_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
4704
- grounding_tool_count: z18.array(
4705
- z18.object({
4706
- type: z18.string().nullish(),
4707
- count: z18.number().nullish()
4956
+ var usageSchema2 = () => z20.object({
4957
+ total_input_tokens: z20.number().nullish(),
4958
+ total_output_tokens: z20.number().nullish(),
4959
+ total_thought_tokens: z20.number().nullish(),
4960
+ total_cached_tokens: z20.number().nullish(),
4961
+ total_tool_use_tokens: z20.number().nullish(),
4962
+ total_tokens: z20.number().nullish(),
4963
+ input_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
4964
+ output_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
4965
+ cached_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
4966
+ tool_use_tokens_by_modality: z20.array(tokenByModalitySchema()).nullish(),
4967
+ grounding_tool_count: z20.array(
4968
+ z20.object({
4969
+ type: z20.string().nullish(),
4970
+ count: z20.number().nullish()
4708
4971
  }).loose()
4709
4972
  ).nullish()
4710
4973
  }).loose();
4711
- var interactionStatusSchema = () => z18.enum([
4974
+ var interactionStatusSchema = () => z20.enum([
4712
4975
  "in_progress",
4713
4976
  "requires_action",
4714
4977
  "completed",
@@ -4717,62 +4980,62 @@ var interactionStatusSchema = () => z18.enum([
4717
4980
  "incomplete"
4718
4981
  ]);
4719
4982
  var annotationSchema = () => {
4720
- const urlCitation = z18.object({
4721
- type: z18.literal("url_citation"),
4722
- url: z18.string().nullish(),
4723
- title: z18.string().nullish(),
4724
- start_index: z18.number().nullish(),
4725
- end_index: z18.number().nullish()
4983
+ const urlCitation = z20.object({
4984
+ type: z20.literal("url_citation"),
4985
+ url: z20.string().nullish(),
4986
+ title: z20.string().nullish(),
4987
+ start_index: z20.number().nullish(),
4988
+ end_index: z20.number().nullish()
4726
4989
  }).loose();
4727
- const fileCitation = z18.object({
4728
- type: z18.literal("file_citation"),
4729
- file_name: z18.string().nullish(),
4730
- document_uri: z18.string().nullish(),
4731
- url: z18.string().nullish(),
4732
- page_number: z18.number().nullish(),
4733
- media_id: z18.string().nullish(),
4734
- start_index: z18.number().nullish(),
4735
- end_index: z18.number().nullish(),
4736
- custom_metadata: z18.record(z18.string(), z18.unknown()).nullish()
4990
+ const fileCitation = z20.object({
4991
+ type: z20.literal("file_citation"),
4992
+ file_name: z20.string().nullish(),
4993
+ document_uri: z20.string().nullish(),
4994
+ url: z20.string().nullish(),
4995
+ page_number: z20.number().nullish(),
4996
+ media_id: z20.string().nullish(),
4997
+ start_index: z20.number().nullish(),
4998
+ end_index: z20.number().nullish(),
4999
+ custom_metadata: z20.record(z20.string(), z20.unknown()).nullish()
4737
5000
  }).loose();
4738
- const placeCitation = z18.object({
4739
- type: z18.literal("place_citation"),
4740
- name: z18.string().nullish(),
4741
- url: z18.string().nullish(),
4742
- place_id: z18.string().nullish(),
4743
- start_index: z18.number().nullish(),
4744
- end_index: z18.number().nullish()
5001
+ const placeCitation = z20.object({
5002
+ type: z20.literal("place_citation"),
5003
+ name: z20.string().nullish(),
5004
+ url: z20.string().nullish(),
5005
+ place_id: z20.string().nullish(),
5006
+ start_index: z20.number().nullish(),
5007
+ end_index: z20.number().nullish()
4745
5008
  }).loose();
4746
- return z18.union([
5009
+ return z20.union([
4747
5010
  urlCitation,
4748
5011
  fileCitation,
4749
5012
  placeCitation,
4750
- z18.object({ type: z18.string() }).loose()
5013
+ z20.object({ type: z20.string() }).loose()
4751
5014
  ]);
4752
5015
  };
4753
- var thoughtSummaryItemSchema = () => z18.object({
4754
- type: z18.string(),
4755
- text: z18.string().nullish(),
4756
- data: z18.string().nullish(),
4757
- mime_type: z18.string().nullish()
5016
+ var thoughtSummaryItemSchema = () => z20.object({
5017
+ type: z20.string(),
5018
+ text: z20.string().nullish(),
5019
+ data: z20.string().nullish(),
5020
+ mime_type: z20.string().nullish()
4758
5021
  }).loose();
4759
5022
  var contentBlockSchema = () => {
4760
- const textContent = z18.object({
4761
- type: z18.literal("text"),
4762
- text: z18.string(),
4763
- annotations: z18.array(annotationSchema()).nullish()
5023
+ const textContent = z20.object({
5024
+ type: z20.literal("text"),
5025
+ text: z20.string(),
5026
+ annotations: z20.array(annotationSchema()).nullish()
4764
5027
  }).loose();
4765
- const imageContent = z18.object({
4766
- type: z18.literal("image"),
4767
- data: z18.string().nullish(),
4768
- mime_type: z18.string().nullish(),
4769
- resolution: z18.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4770
- uri: z18.string().nullish()
5028
+ const imageContent = z20.object({
5029
+ type: z20.literal("image"),
5030
+ data: z20.string().nullish(),
5031
+ mime_type: z20.string().nullish(),
5032
+ resolution: z20.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5033
+ uri: z20.string().nullish()
4771
5034
  }).loose();
4772
- return z18.union([
5035
+ return z20.union([
4773
5036
  textContent,
4774
5037
  imageContent,
4775
- z18.object({ type: z18.string() }).loose()
5038
+ z20.object({ type: z20.string() }).loose()
4776
5039
  ]);
4777
5040
  };
4778
5041
  var BUILTIN_TOOL_CALL_STEP_TYPES = [
@@ -4792,152 +5055,152 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
4792
5055
  "mcp_server_tool_result"
4793
5056
  ];
4794
5057
  var stepSchema = () => {
4795
- const userInputStep = z18.object({
4796
- type: z18.literal("user_input"),
4797
- content: z18.array(contentBlockSchema()).nullish()
5058
+ const userInputStep = z20.object({
5059
+ type: z20.literal("user_input"),
5060
+ content: z20.array(contentBlockSchema()).nullish()
4798
5061
  }).loose();
4799
- const modelOutputStep = z18.object({
4800
- type: z18.literal("model_output"),
4801
- content: z18.array(contentBlockSchema()).nullish()
5062
+ const modelOutputStep = z20.object({
5063
+ type: z20.literal("model_output"),
5064
+ content: z20.array(contentBlockSchema()).nullish()
4802
5065
  }).loose();
4803
- const functionCallStep = z18.object({
4804
- type: z18.literal("function_call"),
4805
- id: z18.string(),
4806
- name: z18.string(),
4807
- arguments: z18.record(z18.string(), z18.unknown()).nullish(),
4808
- signature: z18.string().nullish()
5066
+ const functionCallStep = z20.object({
5067
+ type: z20.literal("function_call"),
5068
+ id: z20.string(),
5069
+ name: z20.string(),
5070
+ arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5071
+ signature: z20.string().nullish()
4809
5072
  }).loose();
4810
- const thoughtStep = z18.object({
4811
- type: z18.literal("thought"),
4812
- signature: z18.string().nullish(),
4813
- summary: z18.array(thoughtSummaryItemSchema()).nullish()
5073
+ const thoughtStep = z20.object({
5074
+ type: z20.literal("thought"),
5075
+ signature: z20.string().nullish(),
5076
+ summary: z20.array(thoughtSummaryItemSchema()).nullish()
4814
5077
  }).loose();
4815
- const builtinToolCallStep = z18.object({
4816
- type: z18.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4817
- id: z18.string(),
4818
- arguments: z18.record(z18.string(), z18.unknown()).nullish(),
4819
- name: z18.string().nullish(),
4820
- server_name: z18.string().nullish(),
4821
- search_type: z18.string().nullish(),
4822
- signature: z18.string().nullish()
5078
+ const builtinToolCallStep = z20.object({
5079
+ type: z20.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5080
+ id: z20.string(),
5081
+ arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5082
+ name: z20.string().nullish(),
5083
+ server_name: z20.string().nullish(),
5084
+ search_type: z20.string().nullish(),
5085
+ signature: z20.string().nullish()
4823
5086
  }).loose();
4824
- const builtinToolResultStep = z18.object({
4825
- type: z18.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4826
- call_id: z18.string(),
4827
- result: z18.unknown().nullish(),
4828
- is_error: z18.boolean().nullish(),
4829
- name: z18.string().nullish(),
4830
- server_name: z18.string().nullish(),
4831
- signature: z18.string().nullish()
5087
+ const builtinToolResultStep = z20.object({
5088
+ type: z20.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5089
+ call_id: z20.string(),
5090
+ result: z20.unknown().nullish(),
5091
+ is_error: z20.boolean().nullish(),
5092
+ name: z20.string().nullish(),
5093
+ server_name: z20.string().nullish(),
5094
+ signature: z20.string().nullish()
4832
5095
  }).loose();
4833
- return z18.union([
5096
+ return z20.union([
4834
5097
  userInputStep,
4835
5098
  modelOutputStep,
4836
5099
  functionCallStep,
4837
5100
  thoughtStep,
4838
5101
  builtinToolCallStep,
4839
5102
  builtinToolResultStep,
4840
- z18.object({ type: z18.string() }).loose()
5103
+ z20.object({ type: z20.string() }).loose()
4841
5104
  ]);
4842
5105
  };
4843
- var googleInteractionsResponseSchema = lazySchema16(
4844
- () => zodSchema16(
4845
- z18.object({
5106
+ var googleInteractionsResponseSchema = lazySchema18(
5107
+ () => zodSchema18(
5108
+ z20.object({
4846
5109
  /*
4847
5110
  * `id` is omitted from the response body when `store: false` (fully
4848
5111
  * stateless mode) — there is no server-side interaction record for the
4849
5112
  * client to reference. `nullish` lets the schema accept that shape.
4850
5113
  */
4851
- id: z18.string().nullish(),
4852
- created: z18.string().nullish(),
4853
- updated: z18.string().nullish(),
5114
+ id: z20.string().nullish(),
5115
+ created: z20.string().nullish(),
5116
+ updated: z20.string().nullish(),
4854
5117
  status: interactionStatusSchema(),
4855
- model: z18.string().nullish(),
4856
- agent: z18.string().nullish(),
4857
- steps: z18.array(stepSchema()).nullish(),
5118
+ model: z20.string().nullish(),
5119
+ agent: z20.string().nullish(),
5120
+ steps: z20.array(stepSchema()).nullish(),
4858
5121
  usage: usageSchema2().nullish(),
4859
- service_tier: z18.string().nullish(),
4860
- previous_interaction_id: z18.string().nullish(),
4861
- response_modalities: z18.array(z18.string()).nullish()
5122
+ service_tier: z20.string().nullish(),
5123
+ previous_interaction_id: z20.string().nullish(),
5124
+ response_modalities: z20.array(z20.string()).nullish()
4862
5125
  }).loose()
4863
5126
  )
4864
5127
  );
4865
- var googleInteractionsEventSchema = lazySchema16(
4866
- () => zodSchema16(
5128
+ var googleInteractionsEventSchema = lazySchema18(
5129
+ () => zodSchema18(
4867
5130
  (() => {
4868
5131
  const status = interactionStatusSchema();
4869
5132
  const annotation = annotationSchema();
4870
5133
  const thoughtSummaryItem = thoughtSummaryItemSchema();
4871
- const interactionCreatedEvent = z18.object({
4872
- event_type: z18.literal("interaction.created"),
4873
- event_id: z18.string().nullish(),
4874
- interaction: z18.object({
5134
+ const interactionCreatedEvent = z20.object({
5135
+ event_type: z20.literal("interaction.created"),
5136
+ event_id: z20.string().nullish(),
5137
+ interaction: z20.object({
4875
5138
  /*
4876
5139
  * `id` is omitted when `store: false` (fully stateless mode);
4877
5140
  * see the matching note on `googleInteractionsResponseSchema.id`.
4878
5141
  */
4879
- id: z18.string().nullish(),
4880
- created: z18.string().nullish(),
4881
- model: z18.string().nullish(),
4882
- agent: z18.string().nullish(),
5142
+ id: z20.string().nullish(),
5143
+ created: z20.string().nullish(),
5144
+ model: z20.string().nullish(),
5145
+ agent: z20.string().nullish(),
4883
5146
  status: status.nullish()
4884
5147
  }).loose()
4885
5148
  }).loose();
4886
- const stepStartEvent = z18.object({
4887
- event_type: z18.literal("step.start"),
4888
- event_id: z18.string().nullish(),
4889
- index: z18.number(),
5149
+ const stepStartEvent = z20.object({
5150
+ event_type: z20.literal("step.start"),
5151
+ event_id: z20.string().nullish(),
5152
+ index: z20.number(),
4890
5153
  step: stepSchema()
4891
5154
  }).loose();
4892
- const stepDeltaText = z18.object({
4893
- type: z18.literal("text"),
4894
- text: z18.string()
5155
+ const stepDeltaText = z20.object({
5156
+ type: z20.literal("text"),
5157
+ text: z20.string()
4895
5158
  }).loose();
4896
- const stepDeltaThoughtSummary = z18.object({
4897
- type: z18.literal("thought_summary"),
5159
+ const stepDeltaThoughtSummary = z20.object({
5160
+ type: z20.literal("thought_summary"),
4898
5161
  content: thoughtSummaryItem.nullish()
4899
5162
  }).loose();
4900
- const stepDeltaThoughtSignature = z18.object({
4901
- type: z18.literal("thought_signature"),
4902
- signature: z18.string().nullish()
5163
+ const stepDeltaThoughtSignature = z20.object({
5164
+ type: z20.literal("thought_signature"),
5165
+ signature: z20.string().nullish()
4903
5166
  }).loose();
4904
- const stepDeltaArgumentsDelta = z18.object({
4905
- type: z18.literal("arguments_delta"),
4906
- arguments: z18.string().nullish(),
4907
- id: z18.string().nullish(),
4908
- signature: z18.string().nullish()
5167
+ const stepDeltaArgumentsDelta = z20.object({
5168
+ type: z20.literal("arguments_delta"),
5169
+ arguments: z20.string().nullish(),
5170
+ id: z20.string().nullish(),
5171
+ signature: z20.string().nullish()
4909
5172
  }).loose();
4910
- const stepDeltaTextAnnotation = z18.object({
4911
- type: z18.enum(["text_annotation_delta", "text_annotation"]),
4912
- annotations: z18.array(annotation).nullish()
5173
+ const stepDeltaTextAnnotation = z20.object({
5174
+ type: z20.enum(["text_annotation_delta", "text_annotation"]),
5175
+ annotations: z20.array(annotation).nullish()
4913
5176
  }).loose();
4914
- const stepDeltaImage = z18.object({
4915
- type: z18.literal("image"),
4916
- data: z18.string().nullish(),
4917
- mime_type: z18.string().nullish(),
4918
- resolution: z18.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4919
- uri: z18.string().nullish()
5177
+ const stepDeltaImage = z20.object({
5178
+ type: z20.literal("image"),
5179
+ data: z20.string().nullish(),
5180
+ mime_type: z20.string().nullish(),
5181
+ resolution: z20.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5182
+ uri: z20.string().nullish()
4920
5183
  }).loose();
4921
- const stepDeltaBuiltinToolCall = z18.object({
4922
- type: z18.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4923
- id: z18.string().nullish(),
4924
- arguments: z18.record(z18.string(), z18.unknown()).nullish(),
4925
- name: z18.string().nullish(),
4926
- server_name: z18.string().nullish(),
4927
- search_type: z18.string().nullish(),
4928
- signature: z18.string().nullish()
5184
+ const stepDeltaBuiltinToolCall = z20.object({
5185
+ type: z20.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
5186
+ id: z20.string().nullish(),
5187
+ arguments: z20.record(z20.string(), z20.unknown()).nullish(),
5188
+ name: z20.string().nullish(),
5189
+ server_name: z20.string().nullish(),
5190
+ search_type: z20.string().nullish(),
5191
+ signature: z20.string().nullish()
4929
5192
  }).loose();
4930
- const stepDeltaBuiltinToolResult = z18.object({
4931
- type: z18.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4932
- call_id: z18.string().nullish(),
4933
- result: z18.unknown().nullish(),
4934
- is_error: z18.boolean().nullish(),
4935
- name: z18.string().nullish(),
4936
- server_name: z18.string().nullish(),
4937
- signature: z18.string().nullish()
5193
+ const stepDeltaBuiltinToolResult = z20.object({
5194
+ type: z20.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
5195
+ call_id: z20.string().nullish(),
5196
+ result: z20.unknown().nullish(),
5197
+ is_error: z20.boolean().nullish(),
5198
+ name: z20.string().nullish(),
5199
+ server_name: z20.string().nullish(),
5200
+ signature: z20.string().nullish()
4938
5201
  }).loose();
4939
- const stepDeltaUnknown = z18.object({ type: z18.string() }).loose();
4940
- const stepDeltaUnion = z18.union([
5202
+ const stepDeltaUnknown = z20.object({ type: z20.string() }).loose();
5203
+ const stepDeltaUnion = z20.union([
4941
5204
  stepDeltaText,
4942
5205
  stepDeltaImage,
4943
5206
  stepDeltaThoughtSummary,
@@ -4948,55 +5211,55 @@ var googleInteractionsEventSchema = lazySchema16(
4948
5211
  stepDeltaBuiltinToolResult,
4949
5212
  stepDeltaUnknown
4950
5213
  ]);
4951
- const stepDeltaEvent = z18.object({
4952
- event_type: z18.literal("step.delta"),
4953
- event_id: z18.string().nullish(),
4954
- index: z18.number(),
5214
+ const stepDeltaEvent = z20.object({
5215
+ event_type: z20.literal("step.delta"),
5216
+ event_id: z20.string().nullish(),
5217
+ index: z20.number(),
4955
5218
  delta: stepDeltaUnion
4956
5219
  }).loose();
4957
- const stepStopEvent = z18.object({
4958
- event_type: z18.literal("step.stop"),
4959
- event_id: z18.string().nullish(),
4960
- index: z18.number()
5220
+ const stepStopEvent = z20.object({
5221
+ event_type: z20.literal("step.stop"),
5222
+ event_id: z20.string().nullish(),
5223
+ index: z20.number()
4961
5224
  }).loose();
4962
- const interactionStatusUpdateEvent = z18.object({
4963
- event_type: z18.literal("interaction.status_update"),
4964
- event_id: z18.string().nullish(),
4965
- interaction_id: z18.string().nullish(),
5225
+ const interactionStatusUpdateEvent = z20.object({
5226
+ event_type: z20.literal("interaction.status_update"),
5227
+ event_id: z20.string().nullish(),
5228
+ interaction_id: z20.string().nullish(),
4966
5229
  status: status.nullish()
4967
5230
  }).loose();
4968
- const interactionInProgressEvent = z18.object({
4969
- event_type: z18.literal("interaction.in_progress"),
4970
- event_id: z18.string().nullish(),
4971
- interaction_id: z18.string().nullish(),
5231
+ const interactionInProgressEvent = z20.object({
5232
+ event_type: z20.literal("interaction.in_progress"),
5233
+ event_id: z20.string().nullish(),
5234
+ interaction_id: z20.string().nullish(),
4972
5235
  status: status.nullish()
4973
5236
  }).loose();
4974
- const interactionRequiresActionEvent = z18.object({
4975
- event_type: z18.literal("interaction.requires_action"),
4976
- event_id: z18.string().nullish(),
4977
- interaction_id: z18.string().nullish(),
5237
+ const interactionRequiresActionEvent = z20.object({
5238
+ event_type: z20.literal("interaction.requires_action"),
5239
+ event_id: z20.string().nullish(),
5240
+ interaction_id: z20.string().nullish(),
4978
5241
  status: status.nullish()
4979
5242
  }).loose();
4980
- const interactionCompletedEvent = z18.object({
4981
- event_type: z18.literal("interaction.completed"),
4982
- event_id: z18.string().nullish(),
4983
- interaction: z18.object({
4984
- id: z18.string().nullish(),
5243
+ const interactionCompletedEvent = z20.object({
5244
+ event_type: z20.literal("interaction.completed"),
5245
+ event_id: z20.string().nullish(),
5246
+ interaction: z20.object({
5247
+ id: z20.string().nullish(),
4985
5248
  status: status.nullish(),
4986
5249
  usage: usageSchema2().nullish(),
4987
- service_tier: z18.string().nullish()
5250
+ service_tier: z20.string().nullish()
4988
5251
  }).loose()
4989
5252
  }).loose();
4990
- const errorEvent = z18.object({
4991
- event_type: z18.literal("error"),
4992
- event_id: z18.string().nullish(),
4993
- error: z18.object({
4994
- code: z18.string().nullish(),
4995
- message: z18.string().nullish()
5253
+ const errorEvent = z20.object({
5254
+ event_type: z20.literal("error"),
5255
+ event_id: z20.string().nullish(),
5256
+ error: z20.object({
5257
+ code: z20.string().nullish(),
5258
+ message: z20.string().nullish()
4996
5259
  }).loose().nullish()
4997
5260
  }).loose();
4998
- const unknownEvent = z18.object({ event_type: z18.string() }).loose();
4999
- return z18.union([
5261
+ const unknownEvent = z20.object({ event_type: z20.string() }).loose();
5262
+ return z20.union([
5000
5263
  interactionCreatedEvent,
5001
5264
  stepStartEvent,
5002
5265
  stepDeltaEvent,
@@ -5014,29 +5277,29 @@ var googleInteractionsEventSchema = lazySchema16(
5014
5277
 
5015
5278
  // src/interactions/google-interactions-language-model-options.ts
5016
5279
  import {
5017
- lazySchema as lazySchema17,
5018
- zodSchema as zodSchema17
5280
+ lazySchema as lazySchema19,
5281
+ zodSchema as zodSchema19
5019
5282
  } from "@ai-sdk/provider-utils";
5020
- import { z as z19 } from "zod/v4";
5021
- var googleInteractionsLanguageModelOptions = lazySchema17(
5022
- () => zodSchema17(
5023
- z19.object({
5024
- previousInteractionId: z19.string().nullish(),
5025
- store: z19.boolean().nullish(),
5026
- agent: z19.string().nullish(),
5027
- agentConfig: z19.union([
5028
- z19.object({
5029
- type: z19.literal("dynamic")
5283
+ import { z as z21 } from "zod/v4";
5284
+ var googleInteractionsLanguageModelOptions = lazySchema19(
5285
+ () => zodSchema19(
5286
+ z21.object({
5287
+ previousInteractionId: z21.string().nullish(),
5288
+ store: z21.boolean().nullish(),
5289
+ agent: z21.string().nullish(),
5290
+ agentConfig: z21.union([
5291
+ z21.object({
5292
+ type: z21.literal("dynamic")
5030
5293
  }).loose(),
5031
- z19.object({
5032
- type: z19.literal("deep-research"),
5033
- thinkingSummaries: z19.enum(["auto", "none"]).nullish(),
5034
- visualization: z19.enum(["off", "auto"]).nullish(),
5035
- collaborativePlanning: z19.boolean().nullish()
5294
+ z21.object({
5295
+ type: z21.literal("deep-research"),
5296
+ thinkingSummaries: z21.enum(["auto", "none"]).nullish(),
5297
+ visualization: z21.enum(["off", "auto"]).nullish(),
5298
+ collaborativePlanning: z21.boolean().nullish()
5036
5299
  })
5037
5300
  ]).nullish(),
5038
- thinkingLevel: z19.enum(["minimal", "low", "medium", "high"]).nullish(),
5039
- thinkingSummaries: z19.enum(["auto", "none"]).nullish(),
5301
+ thinkingLevel: z21.enum(["minimal", "low", "medium", "high"]).nullish(),
5302
+ thinkingSummaries: z21.enum(["auto", "none"]).nullish(),
5040
5303
  /**
5041
5304
  * Output-format entries that map directly to the API's `response_format`
5042
5305
  * array. Use this to request image, audio, or non-JSON text outputs
@@ -5046,17 +5309,17 @@ var googleInteractionsLanguageModelOptions = lazySchema17(
5046
5309
  * type: 'json', schema }` still drives JSON-mode and adds a matching
5047
5310
  * text entry automatically; entries listed here are appended.
5048
5311
  */
5049
- responseFormat: z19.array(
5050
- z19.union([
5051
- z19.object({
5052
- type: z19.literal("text"),
5053
- mimeType: z19.string().nullish(),
5054
- schema: z19.unknown().nullish()
5312
+ responseFormat: z21.array(
5313
+ z21.union([
5314
+ z21.object({
5315
+ type: z21.literal("text"),
5316
+ mimeType: z21.string().nullish(),
5317
+ schema: z21.unknown().nullish()
5055
5318
  }).loose(),
5056
- z19.object({
5057
- type: z19.literal("image"),
5058
- mimeType: z19.string().nullish(),
5059
- aspectRatio: z19.enum([
5319
+ z21.object({
5320
+ type: z21.literal("image"),
5321
+ mimeType: z21.string().nullish(),
5322
+ aspectRatio: z21.enum([
5060
5323
  "1:1",
5061
5324
  "2:3",
5062
5325
  "3:2",
@@ -5072,11 +5335,11 @@ var googleInteractionsLanguageModelOptions = lazySchema17(
5072
5335
  "1:4",
5073
5336
  "4:1"
5074
5337
  ]).nullish(),
5075
- imageSize: z19.enum(["1K", "2K", "4K", "512"]).nullish()
5338
+ imageSize: z21.enum(["1K", "2K", "4K", "512"]).nullish()
5076
5339
  }).loose(),
5077
- z19.object({
5078
- type: z19.literal("audio"),
5079
- mimeType: z19.string().nullish()
5340
+ z21.object({
5341
+ type: z21.literal("audio"),
5342
+ mimeType: z21.string().nullish()
5080
5343
  }).loose()
5081
5344
  ])
5082
5345
  ).nullish(),
@@ -5086,8 +5349,8 @@ var googleInteractionsLanguageModelOptions = lazySchema17(
5086
5349
  * translates it into a matching `response_format` image entry and
5087
5350
  * emits a warning when set.
5088
5351
  */
5089
- imageConfig: z19.object({
5090
- aspectRatio: z19.enum([
5352
+ imageConfig: z21.object({
5353
+ aspectRatio: z21.enum([
5091
5354
  "1:1",
5092
5355
  "2:3",
5093
5356
  "3:2",
@@ -5103,35 +5366,35 @@ var googleInteractionsLanguageModelOptions = lazySchema17(
5103
5366
  "1:4",
5104
5367
  "4:1"
5105
5368
  ]).nullish(),
5106
- imageSize: z19.enum(["1K", "2K", "4K", "512"]).nullish()
5369
+ imageSize: z21.enum(["1K", "2K", "4K", "512"]).nullish()
5107
5370
  }).nullish(),
5108
- mediaResolution: z19.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5109
- responseModalities: z19.array(z19.enum(["text", "image", "audio", "video", "document"])).nullish(),
5110
- serviceTier: z19.enum(["flex", "standard", "priority"]).nullish(),
5371
+ mediaResolution: z21.enum(["low", "medium", "high", "ultra_high"]).nullish(),
5372
+ responseModalities: z21.array(z21.enum(["text", "image", "audio", "video", "document"])).nullish(),
5373
+ serviceTier: z21.enum(["flex", "standard", "priority"]).nullish(),
5111
5374
  /**
5112
5375
  * Alternative to AI SDK `system` message. If both are set, the AI SDK
5113
5376
  * `system` message wins and a warning is emitted.
5114
5377
  */
5115
- systemInstruction: z19.string().nullish(),
5378
+ systemInstruction: z21.string().nullish(),
5116
5379
  /**
5117
5380
  * Per-block signature for round-tripping `thought.signature` and
5118
5381
  * `function_call.signature` blocks. Set by the SDK on output reasoning /
5119
5382
  * tool-call parts; passed back unchanged on input parts so the API
5120
5383
  * accepts the prior turn.
5121
5384
  */
5122
- signature: z19.string().nullish(),
5385
+ signature: z21.string().nullish(),
5123
5386
  /**
5124
5387
  * Set by the SDK on output assistant messages. The converter uses it to
5125
5388
  * decide which messages to drop when compacting under
5126
5389
  * `previousInteractionId`.
5127
5390
  */
5128
- interactionId: z19.string().nullish(),
5391
+ interactionId: z21.string().nullish(),
5129
5392
  /**
5130
5393
  * Maximum time, in milliseconds, to poll a background interaction (agent
5131
5394
  * call) before giving up. Defaults to 30 minutes. Long-running agents
5132
5395
  * such as deep research can take tens of minutes — increase if needed.
5133
5396
  */
5134
- pollingTimeoutMs: z19.number().int().positive().nullish(),
5397
+ pollingTimeoutMs: z21.number().int().positive().nullish(),
5135
5398
  /**
5136
5399
  * Run the interaction in the background. Required for agents whose
5137
5400
  * server-side workflow cannot complete within a single request/response.
@@ -5140,7 +5403,7 @@ var googleInteractionsLanguageModelOptions = lazySchema17(
5140
5403
  * reject `true`; see the agent's documentation for which mode it
5141
5404
  * requires.
5142
5405
  */
5143
- background: z19.boolean().nullish(),
5406
+ background: z21.boolean().nullish(),
5144
5407
  /**
5145
5408
  * Environment configuration for the agent sandbox. Only applies to agent
5146
5409
  * calls (`google.interactions({ agent })`); ignored on model-id calls.
@@ -5150,36 +5413,36 @@ var googleInteractionsLanguageModelOptions = lazySchema17(
5150
5413
  * - object: provision a fresh sandbox and optionally preload `sources`
5151
5414
  * and/or constrain outbound traffic via `network`.
5152
5415
  */
5153
- environment: z19.union([
5154
- z19.string(),
5155
- z19.object({
5156
- type: z19.literal("remote"),
5157
- sources: z19.array(
5158
- z19.union([
5159
- z19.object({
5160
- type: z19.literal("gcs"),
5161
- source: z19.string(),
5162
- target: z19.string().nullish()
5416
+ environment: z21.union([
5417
+ z21.string(),
5418
+ z21.object({
5419
+ type: z21.literal("remote"),
5420
+ sources: z21.array(
5421
+ z21.union([
5422
+ z21.object({
5423
+ type: z21.literal("gcs"),
5424
+ source: z21.string(),
5425
+ target: z21.string().nullish()
5163
5426
  }),
5164
- z19.object({
5165
- type: z19.literal("repository"),
5166
- source: z19.string(),
5167
- target: z19.string().nullish()
5427
+ z21.object({
5428
+ type: z21.literal("repository"),
5429
+ source: z21.string(),
5430
+ target: z21.string().nullish()
5168
5431
  }),
5169
- z19.object({
5170
- type: z19.literal("inline"),
5171
- content: z19.string(),
5172
- target: z19.string()
5432
+ z21.object({
5433
+ type: z21.literal("inline"),
5434
+ content: z21.string(),
5435
+ target: z21.string()
5173
5436
  })
5174
5437
  ])
5175
5438
  ).nullish(),
5176
- network: z19.union([
5177
- z19.literal("disabled"),
5178
- z19.object({
5179
- allowlist: z19.array(
5180
- z19.object({
5181
- domain: z19.string(),
5182
- transform: z19.array(z19.record(z19.string(), z19.string())).nullish()
5439
+ network: z21.union([
5440
+ z21.literal("disabled"),
5441
+ z21.object({
5442
+ allowlist: z21.array(
5443
+ z21.object({
5444
+ domain: z21.string(),
5445
+ transform: z21.array(z21.record(z21.string(), z21.string())).nullish()
5183
5446
  })
5184
5447
  )
5185
5448
  })
@@ -5352,7 +5615,7 @@ function parseGoogleInteractionsOutputs({
5352
5615
 
5353
5616
  // src/interactions/poll-google-interactions.ts
5354
5617
  import {
5355
- createJsonResponseHandler as createJsonResponseHandler6,
5618
+ createJsonResponseHandler as createJsonResponseHandler7,
5356
5619
  delay as delay3,
5357
5620
  getFromApi as getFromApi3,
5358
5621
  isAbortError
@@ -5360,7 +5623,7 @@ import {
5360
5623
 
5361
5624
  // src/interactions/cancel-google-interaction.ts
5362
5625
  import {
5363
- combineHeaders as combineHeaders6,
5626
+ combineHeaders as combineHeaders7,
5364
5627
  getRuntimeEnvironmentUserAgent,
5365
5628
  withUserAgentSuffix
5366
5629
  } from "@ai-sdk/provider-utils";
@@ -5379,7 +5642,7 @@ async function cancelGoogleInteraction({
5379
5642
  const response = await fetch(url, {
5380
5643
  method: "POST",
5381
5644
  headers: withUserAgentSuffix(
5382
- combineHeaders6({ "Content-Type": "application/json" }, headers),
5645
+ combineHeaders7({ "Content-Type": "application/json" }, headers),
5383
5646
  getRuntimeEnvironmentUserAgent()
5384
5647
  ),
5385
5648
  body: "{}"
@@ -5439,7 +5702,7 @@ async function pollGoogleInteractionUntilTerminal({
5439
5702
  url,
5440
5703
  headers,
5441
5704
  failedResponseHandler: googleFailedResponseHandler,
5442
- successfulResponseHandler: createJsonResponseHandler6(
5705
+ successfulResponseHandler: createJsonResponseHandler7(
5443
5706
  googleInteractionsResponseSchema
5444
5707
  ),
5445
5708
  abortSignal,
@@ -5720,11 +5983,11 @@ function streamGoogleInteractionEvents({
5720
5983
  }
5721
5984
  receivedAnyEventThisAttempt = true;
5722
5985
  if (value.success) {
5723
- const ev = value.value;
5724
- if (typeof ev.event_id === "string" && ev.event_id.length > 0) {
5725
- lastEventId = ev.event_id;
5986
+ const streamEvent = value.value;
5987
+ if (typeof streamEvent.event_id === "string" && streamEvent.event_id.length > 0) {
5988
+ lastEventId = streamEvent.event_id;
5726
5989
  }
5727
- if (ev.event_type === "interaction.completed" || ev.event_type === "error") {
5990
+ if (streamEvent.event_type === "interaction.completed" || streamEvent.event_type === "error") {
5728
5991
  complete = true;
5729
5992
  }
5730
5993
  }
@@ -5931,16 +6194,16 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
5931
6194
  }
5932
6195
  this.config = config;
5933
6196
  }
5934
- static [WORKFLOW_SERIALIZE4](model) {
6197
+ static [WORKFLOW_SERIALIZE5](model) {
5935
6198
  return {
5936
- ...serializeModelOptions4({
6199
+ ...serializeModelOptions5({
5937
6200
  modelId: model.modelId,
5938
6201
  config: model.config
5939
6202
  }),
5940
6203
  agent: model.agent
5941
6204
  };
5942
6205
  }
5943
- static [WORKFLOW_DESERIALIZE4](options) {
6206
+ static [WORKFLOW_DESERIALIZE5](options) {
5944
6207
  return new _GoogleInteractionsLanguageModel(
5945
6208
  options.agent != null ? { agent: options.agent } : options.modelId,
5946
6209
  options.config
@@ -5967,7 +6230,7 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
5967
6230
  async getArgs(options) {
5968
6231
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
5969
6232
  const warnings = [];
5970
- const opts = await parseProviderOptions6({
6233
+ const googleOptions = await parseProviderOptions7({
5971
6234
  provider: "google",
5972
6235
  providerOptions: options.providerOptions,
5973
6236
  schema: googleInteractionsLanguageModelOptions
@@ -6006,8 +6269,8 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6006
6269
  responseFormatEntries.push(entry);
6007
6270
  }
6008
6271
  }
6009
- if ((opts == null ? void 0 : opts.responseFormat) != null) {
6010
- for (const entry of opts.responseFormat) {
6272
+ if ((googleOptions == null ? void 0 : googleOptions.responseFormat) != null) {
6273
+ for (const entry of googleOptions.responseFormat) {
6011
6274
  if (entry.type === "text") {
6012
6275
  responseFormatEntries.push(
6013
6276
  pruneUndefined({
@@ -6041,13 +6304,13 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6041
6304
  warnings: convWarnings
6042
6305
  } = convertToGoogleInteractionsInput({
6043
6306
  prompt: options.prompt,
6044
- previousInteractionId: (_h = opts == null ? void 0 : opts.previousInteractionId) != null ? _h : void 0,
6045
- store: (_i = opts == null ? void 0 : opts.store) != null ? _i : void 0,
6046
- mediaResolution: (_j = opts == null ? void 0 : opts.mediaResolution) != null ? _j : void 0
6307
+ previousInteractionId: (_h = googleOptions == null ? void 0 : googleOptions.previousInteractionId) != null ? _h : void 0,
6308
+ store: (_i = googleOptions == null ? void 0 : googleOptions.store) != null ? _i : void 0,
6309
+ mediaResolution: (_j = googleOptions == null ? void 0 : googleOptions.mediaResolution) != null ? _j : void 0
6047
6310
  });
6048
6311
  warnings.push(...convWarnings);
6049
6312
  let systemInstruction = convertedSystemInstruction;
6050
- const optionSystemInstruction = (_k = opts == null ? void 0 : opts.systemInstruction) != null ? _k : void 0;
6313
+ const optionSystemInstruction = (_k = googleOptions == null ? void 0 : googleOptions.systemInstruction) != null ? _k : void 0;
6051
6314
  if (systemInstruction != null && optionSystemInstruction != null) {
6052
6315
  warnings.push({
6053
6316
  type: "other",
@@ -6067,11 +6330,12 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6067
6330
  }
6068
6331
  if (options.maxOutputTokens != null)
6069
6332
  droppedFields.push("maxOutputTokens");
6070
- if ((opts == null ? void 0 : opts.thinkingLevel) != null) droppedFields.push("thinkingLevel");
6071
- if ((opts == null ? void 0 : opts.thinkingSummaries) != null) {
6333
+ if ((googleOptions == null ? void 0 : googleOptions.thinkingLevel) != null)
6334
+ droppedFields.push("thinkingLevel");
6335
+ if ((googleOptions == null ? void 0 : googleOptions.thinkingSummaries) != null) {
6072
6336
  droppedFields.push("thinkingSummaries");
6073
6337
  }
6074
- if ((opts == null ? void 0 : opts.imageConfig) != null) droppedFields.push("imageConfig");
6338
+ if ((googleOptions == null ? void 0 : googleOptions.imageConfig) != null) droppedFields.push("imageConfig");
6075
6339
  if (droppedFields.length > 0) {
6076
6340
  warnings.push({
6077
6341
  type: "other",
@@ -6086,11 +6350,11 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6086
6350
  seed: (_n = options.seed) != null ? _n : void 0,
6087
6351
  stop_sequences: options.stopSequences != null && options.stopSequences.length > 0 ? options.stopSequences : void 0,
6088
6352
  max_output_tokens: (_o = options.maxOutputTokens) != null ? _o : void 0,
6089
- thinking_level: (_p = opts == null ? void 0 : opts.thinkingLevel) != null ? _p : void 0,
6090
- thinking_summaries: (_q = opts == null ? void 0 : opts.thinkingSummaries) != null ? _q : void 0,
6353
+ thinking_level: (_p = googleOptions == null ? void 0 : googleOptions.thinkingLevel) != null ? _p : void 0,
6354
+ thinking_summaries: (_q = googleOptions == null ? void 0 : googleOptions.thinkingSummaries) != null ? _q : void 0,
6091
6355
  tool_choice: toolChoiceForBody
6092
6356
  });
6093
- if ((opts == null ? void 0 : opts.imageConfig) != null) {
6357
+ if ((googleOptions == null ? void 0 : googleOptions.imageConfig) != null) {
6094
6358
  const alreadyHasImageEntry = responseFormatEntries.some(
6095
6359
  (entry) => entry.type === "image"
6096
6360
  );
@@ -6102,58 +6366,58 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6102
6366
  responseFormatEntries.push({
6103
6367
  type: "image",
6104
6368
  mime_type: "image/png",
6105
- ...opts.imageConfig.aspectRatio != null ? { aspect_ratio: opts.imageConfig.aspectRatio } : {},
6106
- ...opts.imageConfig.imageSize != null ? { image_size: opts.imageConfig.imageSize } : {}
6369
+ ...googleOptions.imageConfig.aspectRatio != null ? { aspect_ratio: googleOptions.imageConfig.aspectRatio } : {},
6370
+ ...googleOptions.imageConfig.imageSize != null ? { image_size: googleOptions.imageConfig.imageSize } : {}
6107
6371
  });
6108
6372
  }
6109
6373
  }
6110
6374
  }
6111
6375
  let agentConfig;
6112
- if (isAgent && (opts == null ? void 0 : opts.agentConfig) != null) {
6113
- const ac = opts.agentConfig;
6114
- if (ac.type === "deep-research") {
6376
+ if (isAgent && (googleOptions == null ? void 0 : googleOptions.agentConfig) != null) {
6377
+ const agentConfigOptions = googleOptions.agentConfig;
6378
+ if (agentConfigOptions.type === "deep-research") {
6115
6379
  agentConfig = pruneUndefined({
6116
6380
  type: "deep-research",
6117
- thinking_summaries: (_r = ac.thinkingSummaries) != null ? _r : void 0,
6118
- visualization: (_s = ac.visualization) != null ? _s : void 0,
6119
- collaborative_planning: (_t = ac.collaborativePlanning) != null ? _t : void 0
6381
+ thinking_summaries: (_r = agentConfigOptions.thinkingSummaries) != null ? _r : void 0,
6382
+ visualization: (_s = agentConfigOptions.visualization) != null ? _s : void 0,
6383
+ collaborative_planning: (_t = agentConfigOptions.collaborativePlanning) != null ? _t : void 0
6120
6384
  });
6121
- } else if (ac.type === "dynamic") {
6385
+ } else if (agentConfigOptions.type === "dynamic") {
6122
6386
  agentConfig = { type: "dynamic" };
6123
6387
  }
6124
6388
  }
6125
6389
  let environment;
6126
- if ((opts == null ? void 0 : opts.environment) != null) {
6390
+ if ((googleOptions == null ? void 0 : googleOptions.environment) != null) {
6127
6391
  if (!isAgent) {
6128
6392
  warnings.push({
6129
6393
  type: "other",
6130
6394
  message: "google.interactions: environment is only supported when an agent is set; environment will be omitted from the request body."
6131
6395
  });
6132
- } else if (typeof opts.environment === "string") {
6133
- environment = opts.environment;
6396
+ } else if (typeof googleOptions.environment === "string") {
6397
+ environment = googleOptions.environment;
6134
6398
  } else {
6135
- const env = opts.environment;
6136
- const sources = (_u = env.sources) == null ? void 0 : _u.map((s) => {
6399
+ const environmentOptions = googleOptions.environment;
6400
+ const sources = (_u = environmentOptions.sources) == null ? void 0 : _u.map((source) => {
6137
6401
  var _a2;
6138
- if (s.type === "inline") {
6402
+ if (source.type === "inline") {
6139
6403
  return {
6140
6404
  type: "inline",
6141
- content: s.content,
6142
- target: s.target
6405
+ content: source.content,
6406
+ target: source.target
6143
6407
  };
6144
6408
  }
6145
6409
  return pruneUndefined({
6146
- type: s.type,
6147
- source: s.source,
6148
- target: (_a2 = s.target) != null ? _a2 : void 0
6410
+ type: source.type,
6411
+ source: source.source,
6412
+ target: (_a2 = source.target) != null ? _a2 : void 0
6149
6413
  });
6150
6414
  });
6151
6415
  let network;
6152
- if (env.network === "disabled") {
6416
+ if (environmentOptions.network === "disabled") {
6153
6417
  network = "disabled";
6154
- } else if (env.network != null) {
6418
+ } else if (environmentOptions.network != null) {
6155
6419
  network = {
6156
- allowlist: env.network.allowlist.map(
6420
+ allowlist: environmentOptions.network.allowlist.map(
6157
6421
  (entry) => {
6158
6422
  var _a2;
6159
6423
  return pruneUndefined({
@@ -6177,38 +6441,38 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6177
6441
  system_instruction: systemInstruction,
6178
6442
  tools: toolsForBody,
6179
6443
  response_format: responseFormatEntries.length > 0 ? responseFormatEntries : void 0,
6180
- response_modalities: (opts == null ? void 0 : opts.responseModalities) != null ? opts.responseModalities : void 0,
6181
- previous_interaction_id: (_v = opts == null ? void 0 : opts.previousInteractionId) != null ? _v : void 0,
6182
- service_tier: (_w = opts == null ? void 0 : opts.serviceTier) != null ? _w : void 0,
6183
- store: (_x = opts == null ? void 0 : opts.store) != null ? _x : void 0,
6444
+ response_modalities: (googleOptions == null ? void 0 : googleOptions.responseModalities) != null ? googleOptions.responseModalities : void 0,
6445
+ previous_interaction_id: (_v = googleOptions == null ? void 0 : googleOptions.previousInteractionId) != null ? _v : void 0,
6446
+ service_tier: (_w = googleOptions == null ? void 0 : googleOptions.serviceTier) != null ? _w : void 0,
6447
+ store: (_x = googleOptions == null ? void 0 : googleOptions.store) != null ? _x : void 0,
6184
6448
  generation_config: generationConfig != null && Object.keys(generationConfig).length > 0 ? generationConfig : void 0,
6185
6449
  agent_config: agentConfig,
6186
6450
  environment,
6187
- background: (_y = opts == null ? void 0 : opts.background) != null ? _y : void 0
6451
+ background: (_y = googleOptions == null ? void 0 : googleOptions.background) != null ? _y : void 0
6188
6452
  });
6189
6453
  return {
6190
6454
  args,
6191
6455
  warnings,
6192
6456
  isAgent,
6193
- isBackground: (opts == null ? void 0 : opts.background) === true,
6194
- pollingTimeoutMs: (_z = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _z : void 0
6457
+ isBackground: (googleOptions == null ? void 0 : googleOptions.background) === true,
6458
+ pollingTimeoutMs: (_z = googleOptions == null ? void 0 : googleOptions.pollingTimeoutMs) != null ? _z : void 0
6195
6459
  };
6196
6460
  }
6197
6461
  async doGenerate(options) {
6198
6462
  var _a, _b, _c, _d, _e, _f;
6199
6463
  const { args, warnings, isAgent, pollingTimeoutMs } = await this.getArgs(options);
6200
6464
  const url = `${this.config.baseURL}/interactions`;
6201
- const mergedHeaders = combineHeaders7(
6465
+ const mergedHeaders = combineHeaders8(
6202
6466
  INTERACTIONS_API_REVISION_HEADER,
6203
- this.config.headers ? await resolve5(this.config.headers) : void 0,
6467
+ this.config.headers ? await resolve6(this.config.headers) : void 0,
6204
6468
  options.headers
6205
6469
  );
6206
- const postResult = await postJsonToApi5({
6470
+ const postResult = await postJsonToApi6({
6207
6471
  url,
6208
6472
  headers: mergedHeaders,
6209
6473
  body: args,
6210
6474
  failedResponseHandler: googleFailedResponseHandler,
6211
- successfulResponseHandler: createJsonResponseHandler7(
6475
+ successfulResponseHandler: createJsonResponseHandler8(
6212
6476
  googleInteractionsResponseSchema
6213
6477
  ),
6214
6478
  abortSignal: options.abortSignal,
@@ -6279,9 +6543,9 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6279
6543
  var _a;
6280
6544
  const { args, warnings, isBackground, pollingTimeoutMs } = await this.getArgs(options);
6281
6545
  const url = `${this.config.baseURL}/interactions`;
6282
- const mergedHeaders = combineHeaders7(
6546
+ const mergedHeaders = combineHeaders8(
6283
6547
  INTERACTIONS_API_REVISION_HEADER,
6284
- this.config.headers ? await resolve5(this.config.headers) : void 0,
6548
+ this.config.headers ? await resolve6(this.config.headers) : void 0,
6285
6549
  options.headers
6286
6550
  );
6287
6551
  if (isBackground) {
@@ -6295,7 +6559,7 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6295
6559
  });
6296
6560
  }
6297
6561
  const body = { ...args, stream: true };
6298
- const { responseHeaders, value: response } = await postJsonToApi5({
6562
+ const { responseHeaders, value: response } = await postJsonToApi6({
6299
6563
  url,
6300
6564
  headers: mergedHeaders,
6301
6565
  body,
@@ -6346,12 +6610,12 @@ var GoogleInteractionsLanguageModel = class _GoogleInteractionsLanguageModel {
6346
6610
  pollingTimeoutMs
6347
6611
  }) {
6348
6612
  var _a, _b;
6349
- const postResult = await postJsonToApi5({
6613
+ const postResult = await postJsonToApi6({
6350
6614
  url,
6351
6615
  headers: mergedHeaders,
6352
6616
  body: args,
6353
6617
  failedResponseHandler: googleFailedResponseHandler,
6354
- successfulResponseHandler: createJsonResponseHandler7(
6618
+ successfulResponseHandler: createJsonResponseHandler8(
6355
6619
  googleInteractionsResponseSchema
6356
6620
  ),
6357
6621
  abortSignal: options.abortSignal,
@@ -6478,6 +6742,12 @@ function createGoogle(options = {}) {
6478
6742
  generateId: (_a2 = options.generateId) != null ? _a2 : generateId2
6479
6743
  });
6480
6744
  };
6745
+ const createSpeechModel = (modelId) => new GoogleSpeechModel(modelId, {
6746
+ provider: `${providerName}.speech`,
6747
+ baseURL,
6748
+ headers: getHeaders,
6749
+ fetch: options.fetch
6750
+ });
6481
6751
  const createInteractionsModel = (modelIdOrAgent) => {
6482
6752
  var _a2;
6483
6753
  return new GoogleInteractionsLanguageModel(
@@ -6512,6 +6782,8 @@ function createGoogle(options = {}) {
6512
6782
  provider.video = createVideoModel;
6513
6783
  provider.videoModel = createVideoModel;
6514
6784
  provider.files = createFiles;
6785
+ provider.speech = createSpeechModel;
6786
+ provider.speechModel = createSpeechModel;
6515
6787
  provider.interactions = createInteractionsModel;
6516
6788
  provider.tools = googleTools;
6517
6789
  return provider;