@ai-sdk/google 3.0.137 → 3.0.138

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.138
4
+
5
+ ### Patch Changes
6
+
7
+ - 2b59d8a: fix(google): convert `type: [X, "null"]` to a plain nullable node so `items` and `format` beside it stay valid for Gemini
8
+
3
9
  ## 3.0.137
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -244,7 +244,7 @@ var googleInteractionsTranscriptionResponseSchema = (0, import_provider_utils3.l
244
244
  var import_provider_utils26 = require("@ai-sdk/provider-utils");
245
245
 
246
246
  // src/version.ts
247
- var VERSION = true ? "3.0.137" : "0.0.0-test";
247
+ var VERSION = true ? "3.0.138" : "0.0.0-test";
248
248
 
249
249
  // src/google-generative-ai-embedding-model.ts
250
250
  var import_provider2 = require("@ai-sdk/provider");
@@ -674,6 +674,11 @@ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
674
674
  const nonNullTypes = type.filter((t) => t !== "null");
675
675
  if (nonNullTypes.length === 0) {
676
676
  result.type = "null";
677
+ } else if (nonNullTypes.length === 1) {
678
+ result.type = nonNullTypes[0];
679
+ if (hasNull) {
680
+ result.nullable = true;
681
+ }
677
682
  } else {
678
683
  result.anyOf = nonNullTypes.map((t) => ({ type: t }));
679
684
  if (hasNull) {