@ai-sdk/google 4.0.30 → 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 +9 -0
- package/dist/index.js +5 -29
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +4 -28
- package/dist/internal/index.js.map +1 -1
- package/package.json +2 -2
- package/src/convert-google-usage.ts +2 -14
- package/src/interactions/convert-google-interactions-usage.ts +2 -14
package/dist/internal/index.js
CHANGED
|
@@ -19,23 +19,11 @@ import {
|
|
|
19
19
|
import { z as z3 } from "zod/v4";
|
|
20
20
|
|
|
21
21
|
// src/convert-google-usage.ts
|
|
22
|
+
import { createNullLanguageModelUsage } from "@ai-sdk/provider-utils";
|
|
22
23
|
function convertGoogleUsage(usage) {
|
|
23
24
|
var _a, _b, _c, _d;
|
|
24
25
|
if (usage == null) {
|
|
25
|
-
return
|
|
26
|
-
inputTokens: {
|
|
27
|
-
total: void 0,
|
|
28
|
-
noCache: void 0,
|
|
29
|
-
cacheRead: void 0,
|
|
30
|
-
cacheWrite: void 0
|
|
31
|
-
},
|
|
32
|
-
outputTokens: {
|
|
33
|
-
total: void 0,
|
|
34
|
-
text: void 0,
|
|
35
|
-
reasoning: void 0
|
|
36
|
-
},
|
|
37
|
-
raw: void 0
|
|
38
|
-
};
|
|
26
|
+
return createNullLanguageModelUsage();
|
|
39
27
|
}
|
|
40
28
|
const promptTokens = (_a = usage.promptTokenCount) != null ? _a : 0;
|
|
41
29
|
const candidatesTokens = (_b = usage.candidatesTokenCount) != null ? _b : 0;
|
|
@@ -3004,23 +2992,11 @@ import {
|
|
|
3004
2992
|
} from "@ai-sdk/provider-utils";
|
|
3005
2993
|
|
|
3006
2994
|
// src/interactions/convert-google-interactions-usage.ts
|
|
2995
|
+
import { createNullLanguageModelUsage as createNullLanguageModelUsage2 } from "@ai-sdk/provider-utils";
|
|
3007
2996
|
function convertGoogleInteractionsUsage(usage) {
|
|
3008
2997
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3009
2998
|
if (usage == null) {
|
|
3010
|
-
return
|
|
3011
|
-
inputTokens: {
|
|
3012
|
-
total: void 0,
|
|
3013
|
-
noCache: void 0,
|
|
3014
|
-
cacheRead: void 0,
|
|
3015
|
-
cacheWrite: void 0
|
|
3016
|
-
},
|
|
3017
|
-
outputTokens: {
|
|
3018
|
-
total: void 0,
|
|
3019
|
-
text: void 0,
|
|
3020
|
-
reasoning: void 0
|
|
3021
|
-
},
|
|
3022
|
-
raw: void 0
|
|
3023
|
-
};
|
|
2999
|
+
return createNullLanguageModelUsage2();
|
|
3024
3000
|
}
|
|
3025
3001
|
const totalInput = (_a = usage.total_input_tokens) != null ? _a : 0;
|
|
3026
3002
|
const totalOutput = (_b = usage.total_output_tokens) != null ? _b : 0;
|