@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/dist/internal/index.js
CHANGED
|
@@ -645,6 +645,11 @@ var googleLanguageModelOptions = (0, import_provider_utils3.lazySchema)(
|
|
|
645
645
|
})
|
|
646
646
|
)
|
|
647
647
|
);
|
|
648
|
+
var VertexServiceTierMap = {
|
|
649
|
+
standard: "SERVICE_TIER_STANDARD",
|
|
650
|
+
flex: "SERVICE_TIER_FLEX",
|
|
651
|
+
priority: "SERVICE_TIER_PRIORITY"
|
|
652
|
+
};
|
|
648
653
|
|
|
649
654
|
// src/google-prepare-tools.ts
|
|
650
655
|
var import_provider2 = require("@ai-sdk/provider");
|
|
@@ -1206,6 +1211,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1206
1211
|
message: `'streamFunctionCallArguments' is only supported on the Vertex AI API and will be ignored with the current Google provider (${this.config.provider}). See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc`
|
|
1207
1212
|
});
|
|
1208
1213
|
}
|
|
1214
|
+
let sanitizedServiceTier = googleOptions == null ? void 0 : googleOptions.serviceTier;
|
|
1215
|
+
if ((googleOptions == null ? void 0 : googleOptions.serviceTier) && isVertexProvider) {
|
|
1216
|
+
sanitizedServiceTier = VertexServiceTierMap[googleOptions.serviceTier];
|
|
1217
|
+
}
|
|
1209
1218
|
const isGemmaModel = this.modelId.toLowerCase().startsWith("gemma-");
|
|
1210
1219
|
const supportsFunctionResponseParts = this.modelId.startsWith("gemini-3");
|
|
1211
1220
|
const { contents, systemInstruction } = convertToGoogleGenerativeAIMessages(
|
|
@@ -1276,7 +1285,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1276
1285
|
toolConfig,
|
|
1277
1286
|
cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,
|
|
1278
1287
|
labels: googleOptions == null ? void 0 : googleOptions.labels,
|
|
1279
|
-
serviceTier:
|
|
1288
|
+
serviceTier: sanitizedServiceTier
|
|
1280
1289
|
},
|
|
1281
1290
|
warnings: [...warnings, ...toolWarnings],
|
|
1282
1291
|
providerOptionsName
|