-
-
Notifications
You must be signed in to change notification settings - Fork 172
feat(core): support valibot
and other schema libraries via xsschema
, not just zod
#157
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0d3cfe1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
4fffe9e
to
a98cdd5
Compare
Hey @baseballyama , thanks a lot for the contribution! There are a few conflicts. Would you like to resolve them, or should I take care of it? Just let me know! |
@omeraplak Thank you for the reminder. I plan to come back to this PR tomorrow and will rebase it then! |
@baseballyama |
I’m currently studying both xsschema and voltagent at the same time, making incremental changes while maintaining compatibility. While it may end up that way in the end, I’m not sure yet. That’s one of the reasons why this PR is still a work in progress. I have other priorities at the moment, but I plan to come back to this PR right after that. |
I also recommend using The main feature of xsSchema is the |
a98cdd5
to
08c4fe1
Compare
@kwaa I’m back to working on this PR. Since VoltAgent converts schemas like zod/valibot to JSON Schema for LLM providers, I’m convinced that |
You only need to use asynchronous methods. only synchronous methods need init |
I need to call e.g. voltagent/packages/anthropic-ai/src/index.ts Lines 82 to 88 in e0b1c7a
|
I found this issue. It seems we might have to implement things manually for each validation library. |
Currently, |
Ah, that’s a tough blocker. Thanks for flagging it. I agree, this might take some time to land on the MCP side. Appreciate you pushing this forward |
btw, I also wrote the "xs" version of the MCP SDK: https://github.com/moeru-ai/xsmcp |
You can get the vendor name from |
related: #143
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
We can use only
zod
.What is the new behavior?
We can use
valibot
and other schema libraries also.Notes for reviewers
This PR is the first step to support schema libraries other than zod in voltagent.
I plan to split the work by package, adding support for schema libraries like valibot to each package one by one.
Finally, I will update the documentation in the last PR.
This PR is not complete yet, but I would like to confirm if the direction of these changes is correct, so I am opening it as a WIP PR.