@ai-sdk/google 3.0.62 → 3.0.63
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.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.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/google-generative-ai-language-model.ts +8 -1
- package/src/google-generative-ai-options.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/google",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.63",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "
|
|
40
|
-
"@ai-sdk/provider
|
|
39
|
+
"@ai-sdk/provider-utils": "4.0.23",
|
|
40
|
+
"@ai-sdk/provider": "3.0.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -38,6 +38,7 @@ import { googleFailedResponseHandler } from './google-error';
|
|
|
38
38
|
import {
|
|
39
39
|
GoogleGenerativeAIModelId,
|
|
40
40
|
googleLanguageModelOptions,
|
|
41
|
+
VertexServiceTierMap,
|
|
41
42
|
} from './google-generative-ai-options';
|
|
42
43
|
import {
|
|
43
44
|
GoogleGenerativeAIContentPart,
|
|
@@ -151,6 +152,12 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
154
|
|
|
155
|
+
// Vertex API requires another service tier format.
|
|
156
|
+
let sanitizedServiceTier: string | undefined = googleOptions?.serviceTier;
|
|
157
|
+
if (googleOptions?.serviceTier && isVertexProvider) {
|
|
158
|
+
sanitizedServiceTier = VertexServiceTierMap[googleOptions.serviceTier];
|
|
159
|
+
}
|
|
160
|
+
|
|
154
161
|
const isGemmaModel = this.modelId.toLowerCase().startsWith('gemma-');
|
|
155
162
|
const supportsFunctionResponseParts = this.modelId.startsWith('gemini-3');
|
|
156
163
|
|
|
@@ -242,7 +249,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV3 {
|
|
|
242
249
|
toolConfig,
|
|
243
250
|
cachedContent: googleOptions?.cachedContent,
|
|
244
251
|
labels: googleOptions?.labels,
|
|
245
|
-
serviceTier:
|
|
252
|
+
serviceTier: sanitizedServiceTier,
|
|
246
253
|
},
|
|
247
254
|
warnings: [...warnings, ...toolWarnings],
|
|
248
255
|
providerOptionsName,
|
|
@@ -212,3 +212,10 @@ export const googleLanguageModelOptions = lazySchema(() =>
|
|
|
212
212
|
export type GoogleLanguageModelOptions = InferSchema<
|
|
213
213
|
typeof googleLanguageModelOptions
|
|
214
214
|
>;
|
|
215
|
+
|
|
216
|
+
// Vertex API requires another service tier format.
|
|
217
|
+
export const VertexServiceTierMap = {
|
|
218
|
+
standard: 'SERVICE_TIER_STANDARD',
|
|
219
|
+
flex: 'SERVICE_TIER_FLEX',
|
|
220
|
+
priority: 'SERVICE_TIER_PRIORITY',
|
|
221
|
+
} as const;
|