-
Notifications
You must be signed in to change notification settings - Fork 53.4k
Change structured output error to Zod message #22681
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: master
Are you sure you want to change the base?
Change structured output error to Zod message #22681
Conversation
|
Hey @robbie-thompson, Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request. Before we can proceed, please ensure the following: Regarding new nodes: If your node integrates with an AI service that you own or represent, please email [email protected] and we will be happy to discuss the best approach. About review timelines: Thank you again for contributing to n8n. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
Confirming that tests are included, and PR aligns with contribution guidelines. |
Summary
Currently the error message for all structured output parsing errors is "Model output doesn't fit required format". This is generic and doesn't surface any details of the underlying error - which is usually Zod erroring on the schema validation. In the case of Cloud hosting, this error isn't accessible anywhere.
This PR changes this, so that in the instance of a Zod error, the underlying schema error is shown to the user - so that the user has more info to go on.
Before:

After:

Related Linear tickets, Github issues, and Community forum posts
N/A
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)