@ai-sdk/google 2.0.105 → 2.0.107

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,18 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 2.0.107
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a1a772f]
8
+ - @ai-sdk/provider-utils@3.0.43
9
+
10
+ ## 2.0.106
11
+
12
+ ### Patch Changes
13
+
14
+ - 0cc3740: fix(google): convert `type: [X, "null"]` to a plain nullable node so `items` and `format` beside it stay valid for Gemini
15
+
3
16
  ## 2.0.105
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils15 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "2.0.105" : "0.0.0-test";
33
+ var VERSION = true ? "2.0.107" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -397,6 +397,11 @@ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
397
397
  const nonNullTypes = type.filter((t) => t !== "null");
398
398
  if (nonNullTypes.length === 0) {
399
399
  result.type = "null";
400
+ } else if (nonNullTypes.length === 1) {
401
+ result.type = nonNullTypes[0];
402
+ if (hasNull) {
403
+ result.nullable = true;
404
+ }
400
405
  } else {
401
406
  result.anyOf = nonNullTypes.map((t) => ({ type: t }));
402
407
  if (hasNull) {