-
Notifications
You must be signed in to change notification settings - Fork 445
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
feat: refactor validators and fields to support pydantic v2 #967
base: develop
Are you sure you want to change the base?
Conversation
@xiaobo8204 thanks for your contribution to NeMo Guardrails 👍🏻 would you please sign all your commits following the contributing guidelines. You should see a Verified tag for all your commits. |
@@ -65,7 +65,7 @@ langchain-community = ">=0.0.16,<0.4.0" | |||
lark = ">=1.1.7" | |||
nest-asyncio = ">=1.5.6," | |||
prompt-toolkit = ">=3.0" | |||
pydantic = ">=1.10" |
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.
we should relax it a bit, probably >= 2.0
And I still need to see the reasons we were still supporting Pydantic 1.0, I'll get back to this later.
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.
removed the extra log.text and hidden file, changed the version to >= 2.0, and signed the commit, thanks...
c5a4d19
to
8581787
Compare
- Refactored code to use `@model_validator` instead of `@root_validator` - Updated `Field` usage to align with Pydantic v2 standards - Modified validation logic to comply with the new API - Updated `poetry.lock` and dependencies in `pyproject.toml`
8581787
to
bb87907
Compare
Description
This PR aims to update Pydantic to the latest v2.10.6, and switch to use the new model_validator/Field/field_validator in the new Pydantic version.
Related Issue(s)
Checklist