@ai-sdk/google 4.0.29 → 4.0.31

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.31
4
+
5
+ ### Patch Changes
6
+
7
+ - 5fc7da5: chore: centralize empty language model usage creation in provider utilities.
8
+ - Updated dependencies [5fc7da5]
9
+ - Updated dependencies [93b2acd]
10
+ - @ai-sdk/provider-utils@5.0.18
11
+
12
+ ## 4.0.30
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [fa95504]
17
+ - @ai-sdk/provider-utils@5.0.17
18
+
3
19
  ## 4.0.29
4
20
 
5
21
  ### Patch Changes
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.29" : "0.0.0-test";
10
+ var VERSION = true ? "4.0.31" : "0.0.0-test";
11
11
 
12
12
  // src/google-embedding-model.ts
13
13
  import {
@@ -271,23 +271,11 @@ import {
271
271
  import { z as z5 } from "zod/v4";
272
272
 
273
273
  // src/convert-google-usage.ts
274
+ import { createNullLanguageModelUsage } from "@ai-sdk/provider-utils";
274
275
  function convertGoogleUsage(usage) {
275
276
  var _a, _b, _c, _d;
276
277
  if (usage == null) {
277
- return {
278
- inputTokens: {
279
- total: void 0,
280
- noCache: void 0,
281
- cacheRead: void 0,
282
- cacheWrite: void 0
283
- },
284
- outputTokens: {
285
- total: void 0,
286
- text: void 0,
287
- reasoning: void 0
288
- },
289
- raw: void 0
290
- };
278
+ return createNullLanguageModelUsage();
291
279
  }
292
280
  const promptTokens = (_a = usage.promptTokenCount) != null ? _a : 0;
293
281
  const candidatesTokens = (_b = usage.candidatesTokenCount) != null ? _b : 0;
@@ -4034,23 +4022,11 @@ import {
4034
4022
  } from "@ai-sdk/provider-utils";
4035
4023
 
4036
4024
  // src/interactions/convert-google-interactions-usage.ts
4025
+ import { createNullLanguageModelUsage as createNullLanguageModelUsage2 } from "@ai-sdk/provider-utils";
4037
4026
  function convertGoogleInteractionsUsage(usage) {
4038
4027
  var _a, _b, _c, _d, _e, _f, _g, _h;
4039
4028
  if (usage == null) {
4040
- return {
4041
- inputTokens: {
4042
- total: void 0,
4043
- noCache: void 0,
4044
- cacheRead: void 0,
4045
- cacheWrite: void 0
4046
- },
4047
- outputTokens: {
4048
- total: void 0,
4049
- text: void 0,
4050
- reasoning: void 0
4051
- },
4052
- raw: void 0
4053
- };
4029
+ return createNullLanguageModelUsage2();
4054
4030
  }
4055
4031
  const totalInput = (_a = usage.total_input_tokens) != null ? _a : 0;
4056
4032
  const totalOutput = (_b = usage.total_output_tokens) != null ? _b : 0;