feature: Update Pydantic to v2.10.5 and remove Deprecated validators #929
Labels
enhancement
New feature or request
good first issue
Good for newcomers
status: help wanted
Issues where external contributions are encouraged.
Did you check the docs?
Is your feature request related to a problem? Please describe.
I suggest to keep up with the latest Pydantic versions since the model_validators that are used inside the library (e.g. nemoguardrails /rails/llm/config.py:975) are deprecated.
Here is an example of the warnings when using the latest Pydantic version (v2.10.5):
nemoguardrails/rails/llm/config.py:975: PydanticDeprecatedSince20: Pydantic V1 style @root_validator validators are deprecated. You should migrate to Pydantic V2 style @model_validator validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/ @root_validator(pre=True, allow_reuse=True)
Describe the solution you'd like
Update the
@root_validator
to Pydantic V2 style@model_validator
validators.Describe alternatives you've considered
No relevant alternatives, just update the library.
Additional context
No response
The text was updated successfully, but these errors were encountered: