@ai-sdk/google 3.0.0-beta.82 → 3.0.0-beta.83
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 +6 -0
- package/dist/index.js +27 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -10
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +26 -9
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +26 -9
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.83
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 166b6d7: fix(provider/google): preserve nested empty object schemas in tool parameters to fix "property is not defined" validation errors when using required properties with empty object types
|
|
8
|
+
|
|
3
9
|
## 3.0.0-beta.82
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "3.0.0-beta.
|
|
33
|
+
var VERSION = true ? "3.0.0-beta.83" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -247,10 +247,16 @@ function convertGoogleGenerativeAIUsage(usage) {
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
// src/convert-json-schema-to-openapi-schema.ts
|
|
250
|
-
function convertJSONSchemaToOpenAPISchema(jsonSchema) {
|
|
251
|
-
if (jsonSchema == null
|
|
250
|
+
function convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {
|
|
251
|
+
if (jsonSchema == null) {
|
|
252
252
|
return void 0;
|
|
253
253
|
}
|
|
254
|
+
if (isEmptyObjectSchema(jsonSchema)) {
|
|
255
|
+
if (isRoot) {
|
|
256
|
+
return void 0;
|
|
257
|
+
}
|
|
258
|
+
return { type: "object" };
|
|
259
|
+
}
|
|
254
260
|
if (typeof jsonSchema === "boolean") {
|
|
255
261
|
return { type: "boolean", properties: {} };
|
|
256
262
|
}
|
|
@@ -297,17 +303,19 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema) {
|
|
|
297
303
|
if (properties != null) {
|
|
298
304
|
result.properties = Object.entries(properties).reduce(
|
|
299
305
|
(acc, [key, value]) => {
|
|
300
|
-
acc[key] = convertJSONSchemaToOpenAPISchema(value);
|
|
306
|
+
acc[key] = convertJSONSchemaToOpenAPISchema(value, false);
|
|
301
307
|
return acc;
|
|
302
308
|
},
|
|
303
309
|
{}
|
|
304
310
|
);
|
|
305
311
|
}
|
|
306
312
|
if (items) {
|
|
307
|
-
result.items = Array.isArray(items) ? items.map(convertJSONSchemaToOpenAPISchema) : convertJSONSchemaToOpenAPISchema(items);
|
|
313
|
+
result.items = Array.isArray(items) ? items.map((item) => convertJSONSchemaToOpenAPISchema(item, false)) : convertJSONSchemaToOpenAPISchema(items, false);
|
|
308
314
|
}
|
|
309
315
|
if (allOf) {
|
|
310
|
-
result.allOf = allOf.map(
|
|
316
|
+
result.allOf = allOf.map(
|
|
317
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
318
|
+
);
|
|
311
319
|
}
|
|
312
320
|
if (anyOf) {
|
|
313
321
|
if (anyOf.some(
|
|
@@ -317,21 +325,30 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema) {
|
|
|
317
325
|
(schema) => !(typeof schema === "object" && (schema == null ? void 0 : schema.type) === "null")
|
|
318
326
|
);
|
|
319
327
|
if (nonNullSchemas.length === 1) {
|
|
320
|
-
const converted = convertJSONSchemaToOpenAPISchema(
|
|
328
|
+
const converted = convertJSONSchemaToOpenAPISchema(
|
|
329
|
+
nonNullSchemas[0],
|
|
330
|
+
false
|
|
331
|
+
);
|
|
321
332
|
if (typeof converted === "object") {
|
|
322
333
|
result.nullable = true;
|
|
323
334
|
Object.assign(result, converted);
|
|
324
335
|
}
|
|
325
336
|
} else {
|
|
326
|
-
result.anyOf = nonNullSchemas.map(
|
|
337
|
+
result.anyOf = nonNullSchemas.map(
|
|
338
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
339
|
+
);
|
|
327
340
|
result.nullable = true;
|
|
328
341
|
}
|
|
329
342
|
} else {
|
|
330
|
-
result.anyOf = anyOf.map(
|
|
343
|
+
result.anyOf = anyOf.map(
|
|
344
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
345
|
+
);
|
|
331
346
|
}
|
|
332
347
|
}
|
|
333
348
|
if (oneOf) {
|
|
334
|
-
result.oneOf = oneOf.map(
|
|
349
|
+
result.oneOf = oneOf.map(
|
|
350
|
+
(item) => convertJSONSchemaToOpenAPISchema(item, false)
|
|
351
|
+
);
|
|
335
352
|
}
|
|
336
353
|
if (minLength !== void 0) {
|
|
337
354
|
result.minLength = minLength;
|