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_DEFER_BUILD causes issues #1306
Comments
Can you share a full example script to reproduce this? I can't reproduce this. |
Yep, let me try and pry it loose from our code and create a standalone repro. |
Thanks, even just a full stack trace would be helpful :) |
That's easier. I manually elided some file paths to non-library code.
We got around this by rewriting our code to not do direct model_dump on the returned object, but that was pretty unintuitive behavior. Let me know if you'd like me to try and isolate a repro for you. |
What version of In the meantime you could probably fix this by setting |
Ooh quite possible. We're on pydantic We did fix this by Ultimately, the bug doesn't block us, but it's possible that others will run into the same issue and start to see strange stacks in production. FWIW, the name |
Sure, it was never intended to be public, it was just planned for internal use. But renaming it makes sense. |
Thanks for listening. Selfishly, we are fine with whatever y’all choose to
do here including closing as “working as intended”, since we got around
this already.
…On Wed, Apr 10, 2024 at 4:31 AM Robert Craigie ***@***.***> wrote:
Sure, it was never intended to be public, it was just planned for internal
use. But renaming it makes sense.
—
Reply to this email directly, view it on GitHub
<#1306 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACQQVAID4Z7Z5IZJHLBVWDY4UPIZAVCNFSM6AAAAABF63YZJOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGI4DOMJSGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
Release 1.16.1 broke clients by deferring the build if pydantic models. As a result, doing a
model_dump()
on an object returned by the library can fail.bc6866e
While this speeds up build times, it should be considered a breaking change and ideally, avoided.
If the speedup is significant, we would request not using a generic envvar like
PYDANTIC_DEFER_BUILD
to revert the change, instead using something likeOPENAI_PYDANTIC_DEFER_BUILD
.We noticed this issue with a streaming tool call message, and are not sure if other deep classes exhibit this behaviour.
To Reproduce
model_dump()
on the object.Code snippets
No response
OS
macOS, Linux
Python version
Python v3.11.8
Library version
openai v1.16.1
The text was updated successfully, but these errors were encountered: