@ai-sdk/google 4.0.0-beta.16 → 4.0.0-beta.18

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.
@@ -584,7 +584,15 @@ var googleLanguageModelOptions = lazySchema2(
584
584
  latitude: z2.number(),
585
585
  longitude: z2.number()
586
586
  }).optional()
587
- }).optional()
587
+ }).optional(),
588
+ /**
589
+ * Optional. The service tier to use for the request.
590
+ */
591
+ serviceTier: z2.enum([
592
+ "SERVICE_TIER_STANDARD",
593
+ "SERVICE_TIER_FLEX",
594
+ "SERVICE_TIER_PRIORITY"
595
+ ]).optional()
588
596
  })
589
597
  )
590
598
  );
@@ -947,14 +955,15 @@ var GoogleGenerativeAILanguageModel = class {
947
955
  retrievalConfig: googleOptions.retrievalConfig
948
956
  } : googleToolConfig,
949
957
  cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,
950
- labels: googleOptions == null ? void 0 : googleOptions.labels
958
+ labels: googleOptions == null ? void 0 : googleOptions.labels,
959
+ serviceTier: googleOptions == null ? void 0 : googleOptions.serviceTier
951
960
  },
952
961
  warnings: [...warnings, ...toolWarnings],
953
962
  providerOptionsName
954
963
  };
955
964
  }
956
965
  async doGenerate(options) {
957
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
966
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
958
967
  const { args, warnings, providerOptionsName } = await this.getArgs(options);
959
968
  const mergedHeaders = combineHeaders(
960
969
  await resolve(this.config.headers),
@@ -1076,7 +1085,8 @@ var GoogleGenerativeAILanguageModel = class {
1076
1085
  urlContextMetadata: (_i = candidate.urlContextMetadata) != null ? _i : null,
1077
1086
  safetyRatings: (_j = candidate.safetyRatings) != null ? _j : null,
1078
1087
  usageMetadata: usageMetadata != null ? usageMetadata : null,
1079
- finishMessage: (_k = candidate.finishMessage) != null ? _k : null
1088
+ finishMessage: (_k = candidate.finishMessage) != null ? _k : null,
1089
+ serviceTier: (_l = response.serviceTier) != null ? _l : null
1080
1090
  }
1081
1091
  },
1082
1092
  request: { body: args },
@@ -1112,6 +1122,7 @@ var GoogleGenerativeAILanguageModel = class {
1112
1122
  let providerMetadata = void 0;
1113
1123
  let lastGroundingMetadata = null;
1114
1124
  let lastUrlContextMetadata = null;
1125
+ let serviceTier = null;
1115
1126
  const generateId2 = this.config.generateId;
1116
1127
  let hasToolCalls = false;
1117
1128
  let currentTextBlockId = null;
@@ -1139,6 +1150,9 @@ var GoogleGenerativeAILanguageModel = class {
1139
1150
  if (usageMetadata != null) {
1140
1151
  usage = usageMetadata;
1141
1152
  }
1153
+ if (value.serviceTier != null) {
1154
+ serviceTier = value.serviceTier;
1155
+ }
1142
1156
  const candidate = (_a = value.candidates) == null ? void 0 : _a[0];
1143
1157
  if (candidate == null) {
1144
1158
  return;
@@ -1329,7 +1343,8 @@ var GoogleGenerativeAILanguageModel = class {
1329
1343
  urlContextMetadata: lastUrlContextMetadata,
1330
1344
  safetyRatings: (_f = candidate.safetyRatings) != null ? _f : null,
1331
1345
  usageMetadata: usageMetadata != null ? usageMetadata : null,
1332
- finishMessage: (_g = candidate.finishMessage) != null ? _g : null
1346
+ finishMessage: (_g = candidate.finishMessage) != null ? _g : null,
1347
+ serviceTier
1333
1348
  }
1334
1349
  };
1335
1350
  }
@@ -1670,7 +1685,8 @@ var responseSchema = lazySchema3(
1670
1685
  promptFeedback: z3.object({
1671
1686
  blockReason: z3.string().nullish(),
1672
1687
  safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
1673
- }).nullish()
1688
+ }).nullish(),
1689
+ serviceTier: z3.string().nullish()
1674
1690
  })
1675
1691
  )
1676
1692
  );
@@ -1691,7 +1707,8 @@ var chunkSchema = lazySchema3(
1691
1707
  promptFeedback: z3.object({
1692
1708
  blockReason: z3.string().nullish(),
1693
1709
  safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
1694
- }).nullish()
1710
+ }).nullish(),
1711
+ serviceTier: z3.string().nullish()
1695
1712
  })
1696
1713
  )
1697
1714
  );