@ai-sdk/google 3.0.57 → 3.0.58
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 +6 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +8 -0
- package/dist/internal/index.d.ts +8 -0
- package/dist/internal/index.js +10 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +10 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/convert-google-generative-ai-usage.ts +7 -0
- package/src/google-generative-ai-language-model.ts +12 -0
package/dist/internal/index.mjs
CHANGED
|
@@ -1740,6 +1740,12 @@ var getSafetyRatingSchema = () => z3.object({
|
|
|
1740
1740
|
severityScore: z3.number().nullish(),
|
|
1741
1741
|
blocked: z3.boolean().nullish()
|
|
1742
1742
|
});
|
|
1743
|
+
var tokenDetailsSchema = z3.array(
|
|
1744
|
+
z3.object({
|
|
1745
|
+
modality: z3.string(),
|
|
1746
|
+
tokenCount: z3.number()
|
|
1747
|
+
})
|
|
1748
|
+
).nullish();
|
|
1743
1749
|
var usageSchema = z3.object({
|
|
1744
1750
|
cachedContentTokenCount: z3.number().nullish(),
|
|
1745
1751
|
thoughtsTokenCount: z3.number().nullish(),
|
|
@@ -1747,7 +1753,10 @@ var usageSchema = z3.object({
|
|
|
1747
1753
|
candidatesTokenCount: z3.number().nullish(),
|
|
1748
1754
|
totalTokenCount: z3.number().nullish(),
|
|
1749
1755
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
1750
|
-
trafficType: z3.string().nullish()
|
|
1756
|
+
trafficType: z3.string().nullish(),
|
|
1757
|
+
// https://ai.google.dev/api/generate-content#Modality
|
|
1758
|
+
promptTokensDetails: tokenDetailsSchema,
|
|
1759
|
+
candidatesTokensDetails: tokenDetailsSchema
|
|
1751
1760
|
});
|
|
1752
1761
|
var getUrlContextMetadataSchema = () => z3.object({
|
|
1753
1762
|
urlMetadata: z3.array(
|