This commit is contained in:
Mikhail Plavskiy 2025-04-24 01:02:44 -07:00 committed by GitHub
commit db7d23fb8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -426,6 +426,18 @@ class ChatCompletionDeltaToolCall(OpenAIObject):
type: Optional[str] = None
index: int
def __contains__(self, key):
# Define custom behavior for the 'in' operator
return hasattr(self, key)
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)
def __getitem__(self, key):
# Allow dictionary-style access to attributes
return getattr(self, key)
class HiddenParams(OpenAIObject):
original_response: Optional[Union[str, Any]] = None