@ai-sdk/google 3.0.50 → 3.0.51

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.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "@ai-sdk/provider-utils";
8
8
 
9
9
  // src/version.ts
10
- var VERSION = true ? "3.0.50" : "0.0.0-test";
10
+ var VERSION = true ? "3.0.51" : "0.0.0-test";
11
11
 
12
12
  // src/google-generative-ai-embedding-model.ts
13
13
  import {
@@ -1056,7 +1056,7 @@ var GoogleGenerativeAILanguageModel = class {
1056
1056
  };
1057
1057
  }
1058
1058
  async doGenerate(options) {
1059
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
1059
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
1060
1060
  const { args, warnings, providerOptionsName } = await this.getArgs(options);
1061
1061
  const mergedHeaders = combineHeaders2(
1062
1062
  await resolve2(this.config.headers),
@@ -1178,7 +1178,8 @@ var GoogleGenerativeAILanguageModel = class {
1178
1178
  groundingMetadata: (_h = candidate.groundingMetadata) != null ? _h : null,
1179
1179
  urlContextMetadata: (_i = candidate.urlContextMetadata) != null ? _i : null,
1180
1180
  safetyRatings: (_j = candidate.safetyRatings) != null ? _j : null,
1181
- usageMetadata: usageMetadata != null ? usageMetadata : null
1181
+ usageMetadata: usageMetadata != null ? usageMetadata : null,
1182
+ finishMessage: (_k = candidate.finishMessage) != null ? _k : null
1182
1183
  }
1183
1184
  },
1184
1185
  request: { body: args },
@@ -1228,7 +1229,7 @@ var GoogleGenerativeAILanguageModel = class {
1228
1229
  controller.enqueue({ type: "stream-start", warnings });
1229
1230
  },
1230
1231
  transform(chunk, controller) {
1231
- var _a, _b, _c, _d, _e, _f;
1232
+ var _a, _b, _c, _d, _e, _f, _g;
1232
1233
  if (options.includeRawChunks) {
1233
1234
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
1234
1235
  }
@@ -1430,12 +1431,11 @@ var GoogleGenerativeAILanguageModel = class {
1430
1431
  promptFeedback: (_e = value.promptFeedback) != null ? _e : null,
1431
1432
  groundingMetadata: lastGroundingMetadata,
1432
1433
  urlContextMetadata: lastUrlContextMetadata,
1433
- safetyRatings: (_f = candidate.safetyRatings) != null ? _f : null
1434
+ safetyRatings: (_f = candidate.safetyRatings) != null ? _f : null,
1435
+ usageMetadata: usageMetadata != null ? usageMetadata : null,
1436
+ finishMessage: (_g = candidate.finishMessage) != null ? _g : null
1434
1437
  }
1435
1438
  };
1436
- if (usageMetadata != null) {
1437
- providerMetadata[providerOptionsName].usageMetadata = usageMetadata;
1438
- }
1439
1439
  }
1440
1440
  },
1441
1441
  flush(controller) {
@@ -1695,6 +1695,7 @@ var responseSchema = lazySchema5(
1695
1695
  z5.object({
1696
1696
  content: getContentSchema().nullish().or(z5.object({}).strict()),
1697
1697
  finishReason: z5.string().nullish(),
1698
+ finishMessage: z5.string().nullish(),
1698
1699
  safetyRatings: z5.array(getSafetyRatingSchema()).nullish(),
1699
1700
  groundingMetadata: getGroundingMetadataSchema().nullish(),
1700
1701
  urlContextMetadata: getUrlContextMetadataSchema().nullish()
@@ -1715,6 +1716,7 @@ var chunkSchema = lazySchema5(
1715
1716
  z5.object({
1716
1717
  content: getContentSchema().nullish(),
1717
1718
  finishReason: z5.string().nullish(),
1719
+ finishMessage: z5.string().nullish(),
1718
1720
  safetyRatings: z5.array(getSafetyRatingSchema()).nullish(),
1719
1721
  groundingMetadata: getGroundingMetadataSchema().nullish(),
1720
1722
  urlContextMetadata: getUrlContextMetadataSchema().nullish()