-
Notifications
You must be signed in to change notification settings - Fork 16k
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
Support for Pydantic v2 #6841
Comments
Answer generated by a 🤖 AnswerThank you for your interest in contributing to LangChain! We greatly appreciate your support. It's fantastic to hear that you're willing to write a pull request to facilitate the support for Pydantic v2 in LangChain. Your contribution will be valuable in enhancing the framework's functionality and performance. Please feel free to proceed with creating the pull request whenever you're ready. The maintainers will review it and determine if it aligns with the project's goals and requirements. If you have any questions or need any assistance during the process, don't hesitate to ask. We're here to help. Happy coding! This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
Yes, I just saw that pydantic v2 has been officially released. I am curious about the improvements and the extent of the upgrade in the context of langchain |
+1 We are creating new projects with pydantic v2 and would like to use langchain as well |
Latest version of FastAPI uses pydantic 2.0 It would be great to use latest versions of langchain and pydantic |
+1 |
2 similar comments
+1 |
+1 |
Second! Pydantic 2 is really great and lots of langchain's python developers are using FastAPI that bumps to Pydantic 2 recently. |
Guys, python-llama-cpp requires pydantic v2, when I install it langchain does not work anymore. Please, upgrade to prepare Pydantic 2 |
In the meantime, before a release that supports Pydantic v2 is released, is there a walkaround? |
As suggested by Pydantic's README
I suppose it is safe to upgrade to Pydantic v2 in no time by replacing all old usage of Pydantic with this so that to be compatible with other packages such as fastapi that has switched to Pydantic v2. |
+1 |
1 similar comment
+1 |
+1 here too. This is impossible to achieve because langchain depends on langsmith which is closed source (???) and depends on pydantic v1 as well. |
I am facing this issue in my project please provide the support for pydantic 2 , i am stucked in dependency confict hell otherwise |
+1 here. |
Bump. Would be good to have, when installing the updated llama-cpp-python it requires pydantic2 to use their server. |
Bump |
It seems this feature request isn't top priority ATM.
So, if anyone will like to collaborate to work with me on it, please let me
know.
…On Fri, 4 Aug 2023, 11:27 Felipe Mendonça, ***@***.***> wrote:
Bump
—
Reply to this email directly, view it on GitHub
<#6841 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABPDWE2K4QIHSD5J4GN5Y3XTTFBZANCNFSM6AAAAAAZWDICUU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
bump :) |
Guys! |
aiogram 3 also switched to Pydantic v2 |
+1 |
It seems that langchain is not compatible with supabase v1.0.4(depends on gotrue~=1.0.3).
|
It works with my solution https://github.com/bleschunov/langchain-with-pydantic-v2 |
Related #9123 |
We must update to Pydantic 2.0 to maintain compatibility with several essential libraries and frameworks. For instance:
All of these require Pydantic 2.0 or higher, and I suspect the list will only grow longer. We will get these libraries' latest features and improvements if we update them. It's essential to assess the potential impact on the Langchain project and make an informed decision about the update. |
Closing this issue as there's a whole migration planned by the maintainers. #9337 |
Hi all! As of We'd love to hear if the latest version unblocks your use cases or if you're still running into issues! |
Feature request
Currently,
langchain 0.0.217 depends on pydantic<2 and >=1
. Pydantic v2 is re-written in Rust and is between 5-50x faster than v1 depending on the use case. Given how much LangChain relies on Pydantic for both modeling and functional components, and given that FastAPI is now supporting (in beta) Pydantic v2, it'd be great to see LangChain handle a user-specified installation of Pydantic above v2.The following is an example of what happens when a user specifies installing Pydantic above v2.
Motivation
Pydantic v2 is re-written in Rust and is between 5-50x faster than v1 depending on the use case. Given how much LangChain relies on Pydantic for both modeling and functional components, and given that FastAPI is now supporting (in beta) Pydantic v2, it'd be great to see LangChain handle a user-specified installation of Pydantic above v2.
Your contribution
Yes! I'm currently opening just an issue to document my request, and because I'm fairly backlogged. But I have contributed to LangChain in the past and would love to write a pull request to facilitate this in full.
The text was updated successfully, but these errors were encountered: