@ai-sdk/google 3.0.118 → 3.0.119
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 +8 -0
- package/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +14 -0
- package/dist/internal/index.d.ts +14 -0
- package/dist/internal/index.js +6 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +6 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/convert-google-generative-ai-usage.ts +3 -0
- package/src/google-generative-ai-language-model.ts +24 -17
package/dist/internal/index.mjs
CHANGED
|
@@ -2518,21 +2518,24 @@ var tokenDetailsSchema = z3.array(
|
|
|
2518
2518
|
z3.object({
|
|
2519
2519
|
modality: z3.string(),
|
|
2520
2520
|
tokenCount: z3.number()
|
|
2521
|
-
})
|
|
2521
|
+
}).catchall(z3.json())
|
|
2522
2522
|
).nullish();
|
|
2523
2523
|
var usageSchema = z3.object({
|
|
2524
2524
|
cachedContentTokenCount: z3.number().nullish(),
|
|
2525
2525
|
thoughtsTokenCount: z3.number().nullish(),
|
|
2526
2526
|
promptTokenCount: z3.number().nullish(),
|
|
2527
2527
|
candidatesTokenCount: z3.number().nullish(),
|
|
2528
|
+
toolUsePromptTokenCount: z3.number().nullish(),
|
|
2528
2529
|
totalTokenCount: z3.number().nullish(),
|
|
2529
2530
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
2530
2531
|
trafficType: z3.string().nullish(),
|
|
2531
2532
|
serviceTier: z3.string().nullish(),
|
|
2532
2533
|
// https://ai.google.dev/api/generate-content#Modality
|
|
2533
2534
|
promptTokensDetails: tokenDetailsSchema,
|
|
2534
|
-
|
|
2535
|
-
|
|
2535
|
+
cacheTokensDetails: tokenDetailsSchema,
|
|
2536
|
+
candidatesTokensDetails: tokenDetailsSchema,
|
|
2537
|
+
toolUsePromptTokensDetails: tokenDetailsSchema
|
|
2538
|
+
}).catchall(z3.json());
|
|
2536
2539
|
var getUrlContextMetadataSchema = () => z3.object({
|
|
2537
2540
|
urlMetadata: z3.array(
|
|
2538
2541
|
z3.object({
|