-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
Pydantic includes URLs with validation errors which aren't useful for the LLM #509
Comments
Totally agree. Throwing data+garbage to the Model is not very smart/economical. I tried to open the discussion here regarding that, but it seems like only Issues are attended (or maybe I don't know how to use Github :o) |
happy to take a PR |
ssonal
added a commit
to ssonal/instructor
that referenced
this issue
May 12, 2024
Fixes jxnl#509 Pydantic includes error URLs in ValidationErrors which means extra tokens used in LLM calls. Pydantic relies on an environment variable to control this setting and is on by default. https://github.com/pydantic/pydantic-core/blob/e1fc99dd3207157aad77defc20ab6873fd268b5b/python/pydantic_core/_pydantic_core.pyi#L818 This change sets the environment variable dynamically when the package is invoked.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Pydantic includes a URL by default to look up more information on the error which isn't useful for the LLM and also takes up token space.
Describe the solution you'd like
It'd be nice to have more control over what happens here. Pydantic let's you dump the errors if you catch the exception via
errors(
and then specifyinclude_url
. It feels like the default should be to not include that.Describe alternatives you've considered
Just giving more control over the reask flow could let people solve this themselves.
The text was updated successfully, but these errors were encountered: