@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.63
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e1a5ab: fix(google): fix `serviceTier` to be correctly formatted for Vertex API
8
+
3
9
  ## 3.0.62
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils16 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "3.0.62" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.63" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -837,6 +837,11 @@ var googleLanguageModelOptions = (0, import_provider_utils5.lazySchema)(
837
837
  })
838
838
  )
839
839
  );
840
+ var VertexServiceTierMap = {
841
+ standard: "SERVICE_TIER_STANDARD",
842
+ flex: "SERVICE_TIER_FLEX",
843
+ priority: "SERVICE_TIER_PRIORITY"
844
+ };
840
845
 
841
846
  // src/google-prepare-tools.ts
842
847
  var import_provider3 = require("@ai-sdk/provider");
@@ -1398,6 +1403,10 @@ var GoogleGenerativeAILanguageModel = class {
1398
1403
  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`
1399
1404
  });
1400
1405
  }
1406
+ let sanitizedServiceTier = googleOptions == null ? void 0 : googleOptions.serviceTier;
1407
+ if ((googleOptions == null ? void 0 : googleOptions.serviceTier) && isVertexProvider) {
1408
+ sanitizedServiceTier = VertexServiceTierMap[googleOptions.serviceTier];
1409
+ }
1401
1410
  const isGemmaModel = this.modelId.toLowerCase().startsWith("gemma-");
1402
1411
  const supportsFunctionResponseParts = this.modelId.startsWith("gemini-3");
1403
1412
  const { contents, systemInstruction } = convertToGoogleGenerativeAIMessages(
@@ -1468,7 +1477,7 @@ var GoogleGenerativeAILanguageModel = class {
1468
1477
  toolConfig,
1469
1478
  cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,
1470
1479
  labels: googleOptions == null ? void 0 : googleOptions.labels,
1471
- serviceTier: googleOptions == null ? void 0 : googleOptions.serviceTier
1480
+ serviceTier: sanitizedServiceTier
1472
1481
  },
1473
1482
  warnings: [...warnings, ...toolWarnings],
1474
1483
  providerOptionsName