From a10106cd7ba5e43e1aaceca1a2613f40068f5c70 Mon Sep 17 00:00:00 2001 From: maxshatzkiinsait Date: Sun, 12 Jan 2025 18:47:36 +0200 Subject: [PATCH] fix_delta_get_default --- litellm/types/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 5cc99131ae..111e062870 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -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