@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.
@@ -170,6 +170,11 @@ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
170
170
  const nonNullTypes = type.filter((t) => t !== "null");
171
171
  if (nonNullTypes.length === 0) {
172
172
  result.type = "null";
173
+ } else if (nonNullTypes.length === 1) {
174
+ result.type = nonNullTypes[0];
175
+ if (hasNull) {
176
+ result.nullable = true;
177
+ }
173
178
  } else {
174
179
  result.anyOf = nonNullTypes.map((t) => ({ type: t }));
175
180
  if (hasNull) {