diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 895ca0ea4..d5443bfe4 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -15,6 +15,13 @@ class LiteLLMBase(BaseModel): except: # if using pydantic v1 return self.dict() + + def fields_set(self): + try: + return self.model_fields_set # noqa + except: + # if using pydantic v1 + return self.__fields_set__ ######### Request Class Definition ###### diff --git a/litellm/proxy/db/dynamo_db.py b/litellm/proxy/db/dynamo_db.py index c752d2de5..fec22ea47 100644 --- a/litellm/proxy/db/dynamo_db.py +++ b/litellm/proxy/db/dynamo_db.py @@ -128,7 +128,7 @@ class DynamoDBWrapper(CustomDB): actions: List = [] - for field in data_obj.model_fields_set: + for field in data_obj.fields_set(): field_value = getattr(data_obj, field) # Convert datetime object to ISO8601 string