mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 10:14:26 +00:00
Merge 596845726e
into b82af5b826
This commit is contained in:
commit
db7d23fb8b
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue