@ai-sdk/provider-utils 5.0.28 → 5.0.30
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/provider-utils",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@ai-sdk/provider": "4.0.8",
|
|
35
36
|
"@standard-schema/spec": "^1.1.0",
|
|
36
37
|
"@workflow/serde": "4.1.0",
|
|
37
38
|
"eventsource-parser": "^3.0.8",
|
|
38
|
-
"undici": "^7.28.0"
|
|
39
|
-
"@ai-sdk/provider": "4.0.7"
|
|
39
|
+
"undici": "^7.28.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "22.19.19",
|
|
43
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
43
44
|
"msw": "2.7.0",
|
|
44
45
|
"tsup": "^8.5.1",
|
|
45
46
|
"typescript": "5.8.3",
|
|
46
|
-
"zod": "3.25.76"
|
|
47
|
-
"@vercel/ai-tsconfig": "0.0.0"
|
|
47
|
+
"zod": "3.25.76"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { JSONSchema7, JSONSchema7Definition } from '@ai-sdk/provider';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Recursively adds additionalProperties: false to
|
|
4
|
+
* Recursively adds additionalProperties: false to object schemas that do not
|
|
5
|
+
* define a schema for their additional properties. This is necessary because
|
|
6
|
+
* some providers (e.g. OpenAI) do not support additionalProperties: true.
|
|
5
7
|
*/
|
|
6
8
|
export function addAdditionalPropertiesToJsonSchema(
|
|
7
9
|
jsonSchema: JSONSchema7,
|
|
@@ -10,7 +12,12 @@ export function addAdditionalPropertiesToJsonSchema(
|
|
|
10
12
|
jsonSchema.type === 'object' ||
|
|
11
13
|
(Array.isArray(jsonSchema.type) && jsonSchema.type.includes('object'))
|
|
12
14
|
) {
|
|
13
|
-
|
|
15
|
+
const { additionalProperties } = jsonSchema;
|
|
16
|
+
jsonSchema.additionalProperties =
|
|
17
|
+
additionalProperties != null && typeof additionalProperties !== 'boolean'
|
|
18
|
+
? visit(additionalProperties)
|
|
19
|
+
: false;
|
|
20
|
+
|
|
14
21
|
const { properties } = jsonSchema;
|
|
15
22
|
if (properties != null) {
|
|
16
23
|
for (const key of Object.keys(properties)) {
|