Skip to content
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 V1 support #636

Closed
maxschulz-COL opened this issue Apr 30, 2024 · 2 comments
Closed

Pydantic V1 support #636

maxschulz-COL opened this issue Apr 30, 2024 · 2 comments

Comments

@maxschulz-COL
Copy link

Is your feature request related to a problem? Please describe.
First of all, I love this library, it's just SO cool!!

I would love to implement it in conjunction with the OS library I am helping to develop (https://github.com/mckinsey/vizro), which still uses Pydantic V1 for the near future...

Describe the solution you'd like
Instructor also work with Pydantic V1 base models

Describe alternatives you've considered
We should upgrade to V2, and eventually we will :) Just cannot do it just yet

I didn't check the source code on whether this is a crazy effort or even feasible, but thought I'd better ask :)!

@jxnl
Copy link
Owner

jxnl commented May 1, 2024

Yeah, there's no way to go backwards. We use a lot of the newer features

@maxschulz-COL
Copy link
Author

@jxnl One more question that I am wondering: What would be other key differences of instructor vs e.g. using the langchain pydantic output parser.

The main difference visible to me is the retry capability, which can be maybe added to a langchain approach.

I am wondering e.g. what the additional features of V2 are that you are using. Would V2 also be more powerful to parse more complex nested outputs? Or would it be better at using OS models that do not reliable even return a valid JSON?

In our case, we are still thinking of whether it's easier to use langchain (as it support pydantic V1) or upgrade to pydantic V2 to make use of instructor.

Any quick notes would be much appreciated 🙏 !

@maxschulz-COL maxschulz-COL reopened this May 12, 2024
@jxnl jxnl closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants