crewAI
crewAI copied to clipboard
Deprecation Warnings for Pydantic V1 Usage
When using crewAI, I'm encountering deprecation warnings related to Pydantic V1 usage. These warnings suggest that the library is using some deprecated Pydantic V1 features that will be removed in Pydantic V3.0.
Warnings
- Support for class-based
configis deprecated:
PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/
This warning appears to be coming from crewai/task.py.
- Pydantic V1 style
@validatoris deprecated:
PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_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.8/migration/
This warning appears to be coming from crewai_tools/tools/base_tool.py.
Suggested Action
It would be beneficial to update the codebase to use Pydantic V2 features instead of the deprecated V1 features. This will ensure compatibility with future versions of Pydantic and remove these deprecation warnings.
Additional Information
crewai version: 0.35.8
Though this is not recommended, we can ignore these specific warnings with the following code:
import warnings
from pydantic import PydanticDeprecatedSince20
warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20)
warnings.filterwarnings("ignore", message="Pydantic V1 style `@validator` validators are deprecated")
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
I'm using crewai v0.74.2 (with Python 3.12.7) and I'm seeing the same warnings.
This issue has been fixed, please upgrade to latest version