-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support ZodObject schemas in tool method #1310
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?
Support ZodObject schemas in tool method #1310
Conversation
commit: |
502d9c1 to
526b97d
Compare
526b97d to
9bf5ad5
Compare
|
|
Hi @felixweinberger, could you take a look at this PR when you have a chance? Thanks! |
|
Hello, |
|
Hi @KKonstantinov, I don't think |
9bf5ad5 to
fae2e6b
Compare
Fixes #1291
Motivation and Context
When using the
tool()method with a ZodObject schema likez.object({ message: z.string() }), the SDK was silently treating the schema as annotations instead of a parameter schema.How Has This Been Tested?
Added some tests to verify that the
tool()method handles ZodObject schemas as expected.Breaking Changes
No breaking changes. This is a backward-compatible bug fix.
Types of changes
Checklist
Additional context