@ai-sdk/google 4.0.0-beta.34 → 4.0.0-beta.36

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,19 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 4.0.0-beta.36
4
+
5
+ ### Patch Changes
6
+
7
+ - 9a0a618: fix(google): fix `serviceTier` to be correctly formatted for Vertex API
8
+
9
+ ## 4.0.0-beta.35
10
+
11
+ ### Patch Changes
12
+
13
+ - 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
14
+ - Updated dependencies [90e2d8a]
15
+ - @ai-sdk/provider-utils@5.0.0-beta.18
16
+
3
17
  ## 4.0.0-beta.34
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils17 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "4.0.0-beta.34" : "0.0.0-test";
33
+ var VERSION = true ? "4.0.0-beta.36" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -887,6 +887,11 @@ var googleLanguageModelOptions = (0, import_provider_utils5.lazySchema)(
887
887
  })
888
888
  )
889
889
  );
890
+ var VertexServiceTierMap = {
891
+ standard: "SERVICE_TIER_STANDARD",
892
+ flex: "SERVICE_TIER_FLEX",
893
+ priority: "SERVICE_TIER_PRIORITY"
894
+ };
890
895
 
891
896
  // src/google-prepare-tools.ts
892
897
  var import_provider3 = require("@ai-sdk/provider");
@@ -1449,6 +1454,10 @@ var GoogleGenerativeAILanguageModel = class {
1449
1454
  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`
1450
1455
  });
1451
1456
  }
1457
+ let sanitizedServiceTier = googleOptions == null ? void 0 : googleOptions.serviceTier;
1458
+ if ((googleOptions == null ? void 0 : googleOptions.serviceTier) && isVertexProvider) {
1459
+ sanitizedServiceTier = VertexServiceTierMap[googleOptions.serviceTier];
1460
+ }
1452
1461
  const isGemmaModel = this.modelId.toLowerCase().startsWith("gemma-");
1453
1462
  const supportsFunctionResponseParts = this.modelId.startsWith("gemini-3");
1454
1463
  const { contents, systemInstruction } = convertToGoogleGenerativeAIMessages(
@@ -1525,7 +1534,7 @@ var GoogleGenerativeAILanguageModel = class {
1525
1534
  toolConfig,
1526
1535
  cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,
1527
1536
  labels: googleOptions == null ? void 0 : googleOptions.labels,
1528
- serviceTier: googleOptions == null ? void 0 : googleOptions.serviceTier
1537
+ serviceTier: sanitizedServiceTier
1529
1538
  },
1530
1539
  warnings: [...warnings, ...toolWarnings],
1531
1540
  providerOptionsName