Make zod a peer dependency in the autoevals sdk#155
Draft
Conversation
60fce6c to
1184016
Compare
Braintrust eval reportAutoevals (caitlin/update-zod4-1768420083)
|
Use native toJSONSchema() method from Zod v4 instead of relying on zod-to-json-schema library which is not compatible with Zod v4. Fixes "Invalid schema for function" errors where schemas had 'type: "None"' instead of 'type: "object"'. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replace direct zodToJsonSchema call with schemaToJson helper for classify_statements function to properly use Zod v4's native toJSONSchema() method - Format JSON dataset files and pnpm-lock.yaml with prettier This completes the Zod v4 compatibility fixes for OpenAI function calling schemas. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
cpinn
commented
Dec 29, 2025
.github/workflows/python.yaml
Outdated
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] |
Author
There was a problem hiding this comment.
issue with sdk tuple behavior in 3.8, 3.8 has been end of life since 2024
4d528b9 to
947418a
Compare
Upgrade to zod 4.2.1 in preparation of zod 4+ migration. Export from zod/v3 until everything is ready in the braintrust backend
Added Zod as a peer dependency accepting both v3 and v4 (^3.0.0 || ^4.0.0). This ensures consumers have a compatible Zod version installed while allowing flexibility for projects using either Zod 3 or 4. Zod remains in dependencies for build/test purposes, but declaring it as a peer dependency prevents version conflicts when autoevals is used in projects with their own Zod version.
e1137b0 to
2be0919
Compare
cef27af to
7d36c10
Compare
cpinn
commented
Dec 29, 2025
| "openai": "^6.3.0", | ||
| "zod": "^3.25.76", | ||
| "zod-to-json-schema": "^3.24.6" | ||
| "openai": "^6.7.0", |
Author
There was a problem hiding this comment.
6.7.0 version is necessary in order to properly support zod 4 with fallbacks to zod 3
Qard
approved these changes
Jan 13, 2026
Author
|
Sadly this change is still failing some internal integration tests and I hadn't been able to figure out why yet. There is still a lot more to be done on the overall zod upgrade. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The typescript sdk was updated to allow zod to be a peer dependency in order to work with either zod 3 or zod 4.
This PR attempts to do a similar update to the autoevals package.