@ai-sdk/google 3.0.52 → 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.
@@ -566,7 +566,15 @@ var googleLanguageModelOptions = lazySchema2(
566
566
  latitude: z2.number(),
567
567
  longitude: z2.number()
568
568
  }).optional()
569
- }).optional()
569
+ }).optional(),
570
+ /**
571
+ * Optional. The service tier to use for the request.
572
+ */
573
+ serviceTier: z2.enum([
574
+ "SERVICE_TIER_STANDARD",
575
+ "SERVICE_TIER_FLEX",
576
+ "SERVICE_TIER_PRIORITY"
577
+ ]).optional()
570
578
  })
571
579
  )
572
580
  );
@@ -922,14 +930,15 @@ var GoogleGenerativeAILanguageModel = class {
922
930
  retrievalConfig: googleOptions.retrievalConfig
923
931
  } : googleToolConfig,
924
932
  cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,
925
- labels: googleOptions == null ? void 0 : googleOptions.labels
933
+ labels: googleOptions == null ? void 0 : googleOptions.labels,
934
+ serviceTier: googleOptions == null ? void 0 : googleOptions.serviceTier
926
935
  },
927
936
  warnings: [...warnings, ...toolWarnings],
928
937
  providerOptionsName
929
938
  };
930
939
  }
931
940
  async doGenerate(options) {
932
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
941
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
933
942
  const { args, warnings, providerOptionsName } = await this.getArgs(options);
934
943
  const mergedHeaders = combineHeaders(
935
944
  await resolve(this.config.headers),
@@ -1052,7 +1061,8 @@ var GoogleGenerativeAILanguageModel = class {
1052
1061
  urlContextMetadata: (_i = candidate.urlContextMetadata) != null ? _i : null,
1053
1062
  safetyRatings: (_j = candidate.safetyRatings) != null ? _j : null,
1054
1063
  usageMetadata: usageMetadata != null ? usageMetadata : null,
1055
- finishMessage: (_k = candidate.finishMessage) != null ? _k : null
1064
+ finishMessage: (_k = candidate.finishMessage) != null ? _k : null,
1065
+ serviceTier: (_l = response.serviceTier) != null ? _l : null
1056
1066
  }
1057
1067
  },
1058
1068
  request: { body: args },
@@ -1088,6 +1098,7 @@ var GoogleGenerativeAILanguageModel = class {
1088
1098
  let providerMetadata = void 0;
1089
1099
  let lastGroundingMetadata = null;
1090
1100
  let lastUrlContextMetadata = null;
1101
+ let serviceTier = null;
1091
1102
  const generateId2 = this.config.generateId;
1092
1103
  let hasToolCalls = false;
1093
1104
  let currentTextBlockId = null;
@@ -1115,6 +1126,9 @@ var GoogleGenerativeAILanguageModel = class {
1115
1126
  if (usageMetadata != null) {
1116
1127
  usage = usageMetadata;
1117
1128
  }
1129
+ if (value.serviceTier != null) {
1130
+ serviceTier = value.serviceTier;
1131
+ }
1118
1132
  const candidate = (_a = value.candidates) == null ? void 0 : _a[0];
1119
1133
  if (candidate == null) {
1120
1134
  return;
@@ -1306,7 +1320,8 @@ var GoogleGenerativeAILanguageModel = class {
1306
1320
  urlContextMetadata: lastUrlContextMetadata,
1307
1321
  safetyRatings: (_f = candidate.safetyRatings) != null ? _f : null,
1308
1322
  usageMetadata: usageMetadata != null ? usageMetadata : null,
1309
- finishMessage: (_g = candidate.finishMessage) != null ? _g : null
1323
+ finishMessage: (_g = candidate.finishMessage) != null ? _g : null,
1324
+ serviceTier
1310
1325
  }
1311
1326
  };
1312
1327
  }
@@ -1578,7 +1593,8 @@ var responseSchema = lazySchema3(
1578
1593
  promptFeedback: z3.object({
1579
1594
  blockReason: z3.string().nullish(),
1580
1595
  safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
1581
- }).nullish()
1596
+ }).nullish(),
1597
+ serviceTier: z3.string().nullish()
1582
1598
  })
1583
1599
  )
1584
1600
  );
@@ -1599,7 +1615,8 @@ var chunkSchema = lazySchema3(
1599
1615
  promptFeedback: z3.object({
1600
1616
  blockReason: z3.string().nullish(),
1601
1617
  safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
1602
- }).nullish()
1618
+ }).nullish(),
1619
+ serviceTier: z3.string().nullish()
1603
1620
  })
1604
1621
  )
1605
1622
  );