Replace deprecated Pydantic Config class with model_config BerriAI/litellm#6902 (#6903) (#7300)

Co-authored-by: Dan Siwiec <daniel.siwiec@gmail.com>
This commit is contained in:
Ishaan Jaff 2024-12-18 15:30:08 -08:00 committed by GitHub
parent 2f08341a08
commit bcf2420e6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1431,6 +1431,8 @@ class UserAPIKeyAuth(
user_tpm_limit: Optional[int] = None
user_rpm_limit: Optional[int] = None
model_config = ConfigDict(arbitrary_types_allowed=True)
@model_validator(mode="before")
@classmethod
def check_api_key(cls, values):
@ -1442,9 +1444,6 @@ class UserAPIKeyAuth(
values.update({"api_key": hash_token(values.get("api_key"))})
return values
class Config:
arbitrary_types_allowed = True
class UserInfoResponse(LiteLLMPydanticObjectBase):
user_id: Optional[str]