fix_delta_get_default

This commit is contained in:
maxshatzkiinsait 2025-01-12 18:47:36 +02:00
parent baa528a102
commit a10106cd7b

View file

@ -543,7 +543,8 @@ class Delta(OpenAIObject):
def get(self, key, default=None):
# Custom .get() method to access attributes with a default value if the attribute doesn't exist
return getattr(self, key, default)
value = getattr(self, key, default)
return default if value is None else value
def __getitem__(self, key):
# Allow dictionary-style access to attributes