Skip to content

chore (provider-utils): replace zod with standard-schema where possible #6184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d1427e7
wip
gr2m May 7, 2025
5cf9e1e
wip
gr2m May 7, 2025
0b60713
Implement standard-schema in `packages/provider-utils/src/validator.ts`
lgrammel May 7, 2025
5f155ab
Merge branch 'v5' into v5-gr2m/5766-replace-zod-with-standard-schema
gr2m May 7, 2025
4178db1
wip
gr2m May 13, 2025
0ae0198
Merge branch 'v5' into v5-gr2m/5766-replace-zod-with-standard-schema
gr2m May 13, 2025
f9c6496
wip
gr2m May 13, 2025
1863dfd
wip
gr2m May 13, 2025
6a17b21
wip
gr2m May 13, 2025
9b95f49
wip
gr2m May 13, 2025
049e376
wip
gr2m May 13, 2025
351182f
wip
gr2m May 13, 2025
83be4e6
wip
gr2m May 13, 2025
a770a76
wip
gr2m May 13, 2025
0cac1bd
wip
gr2m May 13, 2025
3395c3d
wip
gr2m May 13, 2025
fd960ef
wip
gr2m May 13, 2025
71ea96e
wip
gr2m May 13, 2025
3edd3e7
wip
gr2m May 14, 2025
7b3d1f2
Merge branch 'v5' into v5-gr2m/5766-replace-zod-with-standard-schema
gr2m May 14, 2025
1d4bb39
revert `OBJECT` back to `ELEMENT`
gr2m May 14, 2025
3ce7553
reverse changes to `schema.ts` and `zod-schema.ts`
gr2m May 15, 2025
b41723d
remove `T_` prefix from type generics
gr2m May 15, 2025
1d0ba87
style: prettier
gr2m May 15, 2025
dad65b2
wip
gr2m May 15, 2025
a59486b
revert more changes
gr2m May 15, 2025
5f020ca
revert more changes
gr2m May 15, 2025
fa0f0d1
gca revert more changes
gr2m May 15, 2025
15b28ce
make `validate` async in `schema.ts`
gr2m May 15, 2025
446415a
undo debug changes in test
gr2m May 15, 2025
1cc03ca
make `validate` async in `zod-schema.ts` - we might want to allow a s…
gr2m May 15, 2025
bcb9690
undo formatting changes
gr2m May 15, 2025
8e9bd55
revert formatting changes and type generic name
gr2m May 15, 2025
7dd4d9e
make `validate` async in `valibot-schema`
gr2m May 15, 2025
94c9668
re-export `zodSchema` from `@ai-sdk/provider-utils`
gr2m May 15, 2025
6932097
revert changes to packages/provider-utils/src/parse-json.ts
gr2m May 15, 2025
7bdb620
revert changes to packages/provider-utils/src/parse-json.ts
gr2m May 15, 2025
a706a80
make `validate()` method optionally async
gr2m May 15, 2025
23ff810
style: prettier
gr2m May 15, 2025
732b9f3
adapt packages/provider-utils/src/validate-types.test.ts
gr2m May 15, 2025
cc0a0cd
add todo comment
gr2m May 15, 2025
5720b01
adapt tests
gr2m May 15, 2025
5e27626
use `ts-expect-error` instead of `ts-ignore`
gr2m May 15, 2025
430f527
fx
lgrammel May 15, 2025
b4ba863
Merge branch 'v5-gr2m/5766-replace-zod-with-standard-schema' of https…
lgrammel May 15, 2025
9592c8b
cs
lgrammel May 15, 2025
f284b6d
Merge branch 'v5' into v5-gr2m/5766-replace-zod-with-standard-schema
lgrammel May 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sour-rockets-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ai-sdk/provider-utils': patch
---

chore (provider-utils): switch to standard-schema
2 changes: 1 addition & 1 deletion examples/ai-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"mathjs": "14.0.0",
"sharp": "^0.33.5",
"terminal-image": "^2.0.0",
"zod": "3.23.8",
"zod": "3.24.4",
"zod-to-json-schema": "3.23.5",
"valibot": "^1.0.0-rc.0 || ^1.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ai": "workspace:*",
"dotenv": "16.4.5",
"express": "5.0.1",
"zod": "3.23.8"
"zod": "3.24.4"
},
"devDependencies": {
"@types/express": "5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/next-openai-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"next": "latest",
"react": "^18",
"react-dom": "^18",
"zod": "3.23.8"
"zod": "3.24.4"
},
"devDependencies": {
"@types/node": "20.17.24",
Expand Down
2 changes: 1 addition & 1 deletion examples/next-openai-telemetry-sentry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"next": "latest",
"react": "^18",
"react-dom": "^18",
"zod": "3.23.8"
"zod": "3.24.4"
},
"devDependencies": {
"@types/node": "20.17.24",
Expand Down
2 changes: 1 addition & 1 deletion examples/next-openai-telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"next": "latest",
"react": "^18",
"react-dom": "^18",
"zod": "3.23.8"
"zod": "3.24.4"
},
"devDependencies": {
"@types/node": "20.17.24",
Expand Down
2 changes: 1 addition & 1 deletion examples/next-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"react-markdown": "9.0.1",
"redis": "^4.7.0",
"resumable-stream": "^2.0.0",
"zod": "3.23.8"
"zod": "3.24.4"
},
"devDependencies": {
"@types/node": "20.17.24",
Expand Down
2 changes: 1 addition & 1 deletion examples/node-http-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@ai-sdk/openai": "workspace:*",
"ai": "workspace:*",
"dotenv": "16.4.5",
"zod": "3.23.8",
"zod": "3.24.4",
"zod-to-json-schema": "3.23.5"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@ai-sdk/vue": "workspace:*",
"@ai-sdk/openai": "workspace:*",
"ai": "workspace:*",
"zod": "3.23.8"
"zod": "3.24.4"
},
"devDependencies": {
"@nuxt/devtools": "1.6.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/sveltekit-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"typescript": "^5.0.0",
"typescript-eslint": "^8.20.0",
"vite": "^6.0.0",
"zod": "3.23.8",
"zod": "3.24.4",
"@vercel/ai-tsconfig": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"eslint-config-vercel-ai": "workspace:*",
"tsup": "^7.2.0",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.23.8"
Expand Down
4 changes: 2 additions & 2 deletions packages/amazon-bedrock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8.3.0",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/anthropic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/assemblyai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.6.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/azure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/cerebras/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/cohere/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/deepgram/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.6.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/deepinfra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/deepseek/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/elevenlabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.6.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/fal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/fireworks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/gladia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.6.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/google-vertex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/google/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/groq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/hume/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.6.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/lmnt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.6.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/luma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/mistral/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/openai-compatible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/perplexity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@vercel/ai-tsconfig": "workspace:*",
"tsup": "^8",
"typescript": "5.8.3",
"zod": "3.23.8"
"zod": "3.24.4"
},
"peerDependencies": {
"zod": "^3.0.0"
"zod": "^3.24.0"
},
"engines": {
"node": ">=18"
Expand Down
Loading
Loading