From fc1eb36f244352f28d616354f62e6d9d8ff8c996 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 18 Jan 2024 09:32:56 -0800 Subject: [PATCH] (fix) /key/update overwriting metadata --- litellm/proxy/_types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 6e858831411..ad90173a44e 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -134,6 +134,8 @@ class GenerateKeyRequest(LiteLLMBase): class UpdateKeyRequest(LiteLLMBase): + # Note: the defaults of all Params here MUST BE NONE + # else they will get overwritten key: str duration: Optional[str] = None models: Optional[list] = None @@ -142,7 +144,7 @@ class UpdateKeyRequest(LiteLLMBase): spend: Optional[float] = None user_id: Optional[str] = None max_parallel_requests: Optional[int] = None - metadata: Optional[dict] = {} + metadata: Optional[dict] = None class UserAPIKeyAuth(LiteLLMBase): # the expected response object for user api key auth