@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
|
@@ -196,6 +196,14 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
196
196
|
candidatesTokenCount?: number | null | undefined;
|
|
197
197
|
totalTokenCount?: number | null | undefined;
|
|
198
198
|
trafficType?: string | null | undefined;
|
|
199
|
+
promptTokensDetails?: {
|
|
200
|
+
modality: string;
|
|
201
|
+
tokenCount: number;
|
|
202
|
+
}[] | null | undefined;
|
|
203
|
+
candidatesTokensDetails?: {
|
|
204
|
+
modality: string;
|
|
205
|
+
tokenCount: number;
|
|
206
|
+
}[] | null | undefined;
|
|
199
207
|
} | null | undefined;
|
|
200
208
|
promptFeedback?: {
|
|
201
209
|
blockReason?: string | null | undefined;
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -196,6 +196,14 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
196
196
|
candidatesTokenCount?: number | null | undefined;
|
|
197
197
|
totalTokenCount?: number | null | undefined;
|
|
198
198
|
trafficType?: string | null | undefined;
|
|
199
|
+
promptTokensDetails?: {
|
|
200
|
+
modality: string;
|
|
201
|
+
tokenCount: number;
|
|
202
|
+
}[] | null | undefined;
|
|
203
|
+
candidatesTokensDetails?: {
|
|
204
|
+
modality: string;
|
|
205
|
+
tokenCount: number;
|
|
206
|
+
}[] | null | undefined;
|
|
199
207
|
} | null | undefined;
|
|
200
208
|
promptFeedback?: {
|
|
201
209
|
blockReason?: string | null | undefined;
|
package/dist/internal/index.js
CHANGED
|
@@ -630,11 +630,7 @@ var googleLanguageModelOptions = (0, import_provider_utils3.lazySchema)(
|
|
|
630
630
|
/**
|
|
631
631
|
* Optional. The service tier to use for the request.
|
|
632
632
|
*/
|
|
633
|
-
serviceTier: import_v42.z.enum([
|
|
634
|
-
"SERVICE_TIER_STANDARD",
|
|
635
|
-
"SERVICE_TIER_FLEX",
|
|
636
|
-
"SERVICE_TIER_PRIORITY"
|
|
637
|
-
]).optional()
|
|
633
|
+
serviceTier: import_v42.z.enum(["standard", "flex", "priority"]).optional()
|
|
638
634
|
})
|
|
639
635
|
)
|
|
640
636
|
);
|
|
@@ -1755,6 +1751,12 @@ var getSafetyRatingSchema = () => import_v43.z.object({
|
|
|
1755
1751
|
severityScore: import_v43.z.number().nullish(),
|
|
1756
1752
|
blocked: import_v43.z.boolean().nullish()
|
|
1757
1753
|
});
|
|
1754
|
+
var tokenDetailsSchema = import_v43.z.array(
|
|
1755
|
+
import_v43.z.object({
|
|
1756
|
+
modality: import_v43.z.string(),
|
|
1757
|
+
tokenCount: import_v43.z.number()
|
|
1758
|
+
})
|
|
1759
|
+
).nullish();
|
|
1758
1760
|
var usageSchema = import_v43.z.object({
|
|
1759
1761
|
cachedContentTokenCount: import_v43.z.number().nullish(),
|
|
1760
1762
|
thoughtsTokenCount: import_v43.z.number().nullish(),
|
|
@@ -1762,7 +1764,10 @@ var usageSchema = import_v43.z.object({
|
|
|
1762
1764
|
candidatesTokenCount: import_v43.z.number().nullish(),
|
|
1763
1765
|
totalTokenCount: import_v43.z.number().nullish(),
|
|
1764
1766
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
1765
|
-
trafficType: import_v43.z.string().nullish()
|
|
1767
|
+
trafficType: import_v43.z.string().nullish(),
|
|
1768
|
+
// https://ai.google.dev/api/generate-content#Modality
|
|
1769
|
+
promptTokensDetails: tokenDetailsSchema,
|
|
1770
|
+
candidatesTokensDetails: tokenDetailsSchema
|
|
1766
1771
|
});
|
|
1767
1772
|
var getUrlContextMetadataSchema = () => import_v43.z.object({
|
|
1768
1773
|
urlMetadata: import_v43.z.array(
|