-
Notifications
You must be signed in to change notification settings - Fork 522
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
486 support for pydantic v2 v1 compatible #490
486 support for pydantic v2 v1 compatible #490
Conversation
@CodiumAI-Agent /review |
PR Analysis(review updated until commit a8e85ae)
PR Feedback💡 General suggestions: The PR is well-structured and the changes are clearly explained in the description. However, it would be beneficial to add tests to ensure that the changes do not break existing functionality and that the codebase works as expected with both Pydantic v1 and v2. Additionally, it would be helpful to include a rollback plan in case issues arise after the changes are merged. 🤖 Code feedback:
✨ Usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
Persistent review updated to latest commit a8e85ae |
abae92f
to
6210ea7
Compare
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.
can we consolidate style in a Prettier config? much of this PR is changing formatting
I'm aware of the formatting changes in this PR because I've used Black, as stated in our contribution guide. In fact, now it's mandatory to do this as part of our process, which includes running
I believe it's important to discuss how we can further align our code formatting processes to ensure consistency and efficiency in our future contributions. I'm open to suggestions and would like to hear everyone's thoughts on this |
I'm currently working on a PR that updates our codebase to support both Pydantic v1 and v2 compatibility. This is a significant change as it involves updates to import statements, formatting, and some logic adjustments across multiple files and modules.
The migration to Pydantic v2 is being done progressively. The first step is to make the codebase compatible with both Pydantic v1 and v2. This is achieved by importing from pydantic.v1 instead of pydantic.
Once the codebase is compatible with both versions, the next step is to fully migrate to Pydantic v2. This will be a major change as it will require adapting the polymorphism used in the base classes throughout the project to the new code pattern in Pydantic v2.
During this migration process, I suggest having two versions of the project, similar to what was done in Langchain. For instance, version 112 could be compatible with Pydantic v1, and a subsequent version could be fully migrated to Pydantic v2.
I will also update the documentation to reflect these changes and provide a clear migration guide for users. This will help them understand why this change is necessary and how it impacts the project.