change
from pydantic import BaseModel
to
from pydantic_settings import BaseModel
and install pydantic_settings like so:
pip install pydantic_settings