@ai-sdk/google 3.0.56 → 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 +12 -0
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -7
- 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 +11 -6
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +11 -6
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +3 -3
- package/package.json +1 -1
- package/src/convert-google-generative-ai-usage.ts +7 -0
- package/src/google-generative-ai-language-model.ts +12 -0
- package/src/google-generative-ai-options.ts +1 -7
package/dist/internal/index.mjs
CHANGED
|
@@ -617,11 +617,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
617
617
|
/**
|
|
618
618
|
* Optional. The service tier to use for the request.
|
|
619
619
|
*/
|
|
620
|
-
serviceTier: z2.enum([
|
|
621
|
-
"SERVICE_TIER_STANDARD",
|
|
622
|
-
"SERVICE_TIER_FLEX",
|
|
623
|
-
"SERVICE_TIER_PRIORITY"
|
|
624
|
-
]).optional()
|
|
620
|
+
serviceTier: z2.enum(["standard", "flex", "priority"]).optional()
|
|
625
621
|
})
|
|
626
622
|
)
|
|
627
623
|
);
|
|
@@ -1744,6 +1740,12 @@ var getSafetyRatingSchema = () => z3.object({
|
|
|
1744
1740
|
severityScore: z3.number().nullish(),
|
|
1745
1741
|
blocked: z3.boolean().nullish()
|
|
1746
1742
|
});
|
|
1743
|
+
var tokenDetailsSchema = z3.array(
|
|
1744
|
+
z3.object({
|
|
1745
|
+
modality: z3.string(),
|
|
1746
|
+
tokenCount: z3.number()
|
|
1747
|
+
})
|
|
1748
|
+
).nullish();
|
|
1747
1749
|
var usageSchema = z3.object({
|
|
1748
1750
|
cachedContentTokenCount: z3.number().nullish(),
|
|
1749
1751
|
thoughtsTokenCount: z3.number().nullish(),
|
|
@@ -1751,7 +1753,10 @@ var usageSchema = z3.object({
|
|
|
1751
1753
|
candidatesTokenCount: z3.number().nullish(),
|
|
1752
1754
|
totalTokenCount: z3.number().nullish(),
|
|
1753
1755
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
1754
|
-
trafficType: z3.string().nullish()
|
|
1756
|
+
trafficType: z3.string().nullish(),
|
|
1757
|
+
// https://ai.google.dev/api/generate-content#Modality
|
|
1758
|
+
promptTokensDetails: tokenDetailsSchema,
|
|
1759
|
+
candidatesTokensDetails: tokenDetailsSchema
|
|
1755
1760
|
});
|
|
1756
1761
|
var getUrlContextMetadataSchema = () => z3.object({
|
|
1757
1762
|
urlMetadata: z3.array(
|