@ai-sdk/google 3.0.53 → 3.0.54

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.
@@ -194,6 +194,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
194
194
  blocked?: boolean | null | undefined;
195
195
  }[] | null | undefined;
196
196
  } | null | undefined;
197
+ serviceTier?: string | null | undefined;
197
198
  }>;
198
199
  type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
199
200
  type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
@@ -194,6 +194,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
194
194
  blocked?: boolean | null | undefined;
195
195
  }[] | null | undefined;
196
196
  } | null | undefined;
197
+ serviceTier?: string | null | undefined;
197
198
  }>;
198
199
  type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
199
200
  type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
@@ -579,7 +579,15 @@ var googleLanguageModelOptions = (0, import_provider_utils3.lazySchema)(
579
579
  latitude: import_v42.z.number(),
580
580
  longitude: import_v42.z.number()
581
581
  }).optional()
582
- }).optional()
582
+ }).optional(),
583
+ /**
584
+ * Optional. The service tier to use for the request.
585
+ */
586
+ serviceTier: import_v42.z.enum([
587
+ "SERVICE_TIER_STANDARD",
588
+ "SERVICE_TIER_FLEX",
589
+ "SERVICE_TIER_PRIORITY"
590
+ ]).optional()
583
591
  })
584
592
  )
585
593
  );
@@ -933,14 +941,15 @@ var GoogleGenerativeAILanguageModel = class {
933
941
  retrievalConfig: googleOptions.retrievalConfig
934
942
  } : googleToolConfig,
935
943
  cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,
936
- labels: googleOptions == null ? void 0 : googleOptions.labels
944
+ labels: googleOptions == null ? void 0 : googleOptions.labels,
945
+ serviceTier: googleOptions == null ? void 0 : googleOptions.serviceTier
937
946
  },
938
947
  warnings: [...warnings, ...toolWarnings],
939
948
  providerOptionsName
940
949
  };
941
950
  }
942
951
  async doGenerate(options) {
943
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
952
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
944
953
  const { args, warnings, providerOptionsName } = await this.getArgs(options);
945
954
  const mergedHeaders = (0, import_provider_utils4.combineHeaders)(
946
955
  await (0, import_provider_utils4.resolve)(this.config.headers),
@@ -1063,7 +1072,8 @@ var GoogleGenerativeAILanguageModel = class {
1063
1072
  urlContextMetadata: (_i = candidate.urlContextMetadata) != null ? _i : null,
1064
1073
  safetyRatings: (_j = candidate.safetyRatings) != null ? _j : null,
1065
1074
  usageMetadata: usageMetadata != null ? usageMetadata : null,
1066
- finishMessage: (_k = candidate.finishMessage) != null ? _k : null
1075
+ finishMessage: (_k = candidate.finishMessage) != null ? _k : null,
1076
+ serviceTier: (_l = response.serviceTier) != null ? _l : null
1067
1077
  }
1068
1078
  },
1069
1079
  request: { body: args },
@@ -1099,6 +1109,7 @@ var GoogleGenerativeAILanguageModel = class {
1099
1109
  let providerMetadata = void 0;
1100
1110
  let lastGroundingMetadata = null;
1101
1111
  let lastUrlContextMetadata = null;
1112
+ let serviceTier = null;
1102
1113
  const generateId2 = this.config.generateId;
1103
1114
  let hasToolCalls = false;
1104
1115
  let currentTextBlockId = null;
@@ -1126,6 +1137,9 @@ var GoogleGenerativeAILanguageModel = class {
1126
1137
  if (usageMetadata != null) {
1127
1138
  usage = usageMetadata;
1128
1139
  }
1140
+ if (value.serviceTier != null) {
1141
+ serviceTier = value.serviceTier;
1142
+ }
1129
1143
  const candidate = (_a = value.candidates) == null ? void 0 : _a[0];
1130
1144
  if (candidate == null) {
1131
1145
  return;
@@ -1317,7 +1331,8 @@ var GoogleGenerativeAILanguageModel = class {
1317
1331
  urlContextMetadata: lastUrlContextMetadata,
1318
1332
  safetyRatings: (_f = candidate.safetyRatings) != null ? _f : null,
1319
1333
  usageMetadata: usageMetadata != null ? usageMetadata : null,
1320
- finishMessage: (_g = candidate.finishMessage) != null ? _g : null
1334
+ finishMessage: (_g = candidate.finishMessage) != null ? _g : null,
1335
+ serviceTier
1321
1336
  }
1322
1337
  };
1323
1338
  }
@@ -1589,7 +1604,8 @@ var responseSchema = (0, import_provider_utils4.lazySchema)(
1589
1604
  promptFeedback: import_v43.z.object({
1590
1605
  blockReason: import_v43.z.string().nullish(),
1591
1606
  safetyRatings: import_v43.z.array(getSafetyRatingSchema()).nullish()
1592
- }).nullish()
1607
+ }).nullish(),
1608
+ serviceTier: import_v43.z.string().nullish()
1593
1609
  })
1594
1610
  )
1595
1611
  );
@@ -1610,7 +1626,8 @@ var chunkSchema = (0, import_provider_utils4.lazySchema)(
1610
1626
  promptFeedback: import_v43.z.object({
1611
1627
  blockReason: import_v43.z.string().nullish(),
1612
1628
  safetyRatings: import_v43.z.array(getSafetyRatingSchema()).nullish()
1613
- }).nullish()
1629
+ }).nullish(),
1630
+ serviceTier: import_v43.z.string().nullish()
1614
1631
  })
1615
1632
  )
1616
1633
  );