From fdcab2cafa24a761fa2f28b5c760295ba2907bc7 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 26 Sep 2024 18:37:19 -0700 Subject: [PATCH] fix import UserAPIKeyCacheTTLEnum --- litellm/proxy/_types.py | 4 ++++ litellm/proxy/proxy_server.py | 4 ---- litellm/proxy/utils.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 9b2bfbe24..84e415950 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1913,3 +1913,7 @@ class TeamInfoResponseObject(TypedDict): team_info: LiteLLM_TeamTable keys: List team_memberships: List[LiteLLM_TeamMembership] + + +class UserAPIKeyCacheTTLEnum(enum.Enum): + in_memory_cache_ttl = 60 # 1 min ttl ## configure via `general_settings::user_api_key_cache_ttl: ` diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 03ba2e839..c581ccd99 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -382,10 +382,6 @@ if os.getenv("DOCS_FILTERED", "False") == "True" and premium_user: app.openapi = custom_openapi # type: ignore -class UserAPIKeyCacheTTLEnum(enum.Enum): - in_memory_cache_ttl = 60 # 1 min ttl ## configure via `general_settings::user_api_key_cache_ttl: ` - - @app.exception_handler(ProxyException) async def openai_exception_handler(request: Request, exc: ProxyException): # NOTE: DO NOT MODIFY THIS, its crucial to map to Openai exceptions diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 61448f4bb..6182f0678 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -60,6 +60,7 @@ from litellm.proxy._types import ( SpendLogsMetadata, SpendLogsPayload, UserAPIKeyAuth, + UserAPIKeyCacheTTLEnum, ) from litellm.proxy.db.create_views import ( create_missing_views, @@ -70,7 +71,6 @@ from litellm.proxy.hooks.max_budget_limiter import _PROXY_MaxBudgetLimiter from litellm.proxy.hooks.parallel_request_limiter import ( _PROXY_MaxParallelRequestsHandler, ) -from litellm.proxy.proxy_server import UserAPIKeyCacheTTLEnum from litellm.types.utils import CallTypes, LoggedLiteLLMParams if TYPE_CHECKING: