This commit is contained in:
Maxim Shatzki 2025-04-24 01:01:41 -07:00 committed by GitHub
commit be174107a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -730,7 +730,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