fix: support pydantic v2 for the FastAPI docs page (compatible with v1)#819
fix: support pydantic v2 for the FastAPI docs page (compatible with v1)#819CuberMessenger (CuberMessenger) wants to merge 2 commits intolangchain-ai:mainfrom
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the username CuberMessenger (@CuberMessenger) on file. In order for us to review and merge your code, please complete the Individual Contributor License Agreement here https://forms.gle/AQFbtkWRoHXUgipM6 . This process is done manually on our side, so after signing the form one of the maintainers will add you to the contributors list. For more details about why we have a CLA and other contribution guidelines please see: https://github.com/langchain-ai/langserve/blob/main/CONTRIBUTING.md. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the username CuberMessenger (@CuberMessenger) on file. In order for us to review and merge your code, please complete the Individual Contributor License Agreement here https://forms.gle/AQFbtkWRoHXUgipM6 . This process is done manually on our side, so after signing the form one of the maintainers will add you to the contributors list. For more details about why we have a CLA and other contribution guidelines please see: https://github.com/langchain-ai/langserve/blob/main/CONTRIBUTING.md. |
This fix adds support for showing the FastAPI docs with pydantic v2; the code is also compatible with pydantic v1.
See langchain-ai/langchain#32097 for the details of the problem.
In short, pydantic v1 uses
Annotated[Model, Model]style, while the new version (v2) prefersAnnotated[Model, Body(...)]for optional fields.