From 349724a6301777757f71e2d2ea4b2c7a4010014c Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 15 Jun 2024 13:35:21 -0700 Subject: [PATCH] use directories for importing new endpoints --- .../proxy/{ => health_endpoints}/health_endpoints.py | 0 .../proxy/{ => management_endpoints}/team_endpoints.py | 0 litellm/proxy/proxy_server.py | 10 ++++++---- .../spend_management_endpoints.py | 0 litellm/tests/test_key_generate_prisma.py | 8 ++++++-- 5 files changed, 12 insertions(+), 6 deletions(-) rename litellm/proxy/{ => health_endpoints}/health_endpoints.py (100%) rename litellm/proxy/{ => management_endpoints}/team_endpoints.py (100%) rename litellm/proxy/{ => spend_reporting_endpoints}/spend_management_endpoints.py (100%) diff --git a/litellm/proxy/health_endpoints.py b/litellm/proxy/health_endpoints/health_endpoints.py similarity index 100% rename from litellm/proxy/health_endpoints.py rename to litellm/proxy/health_endpoints/health_endpoints.py diff --git a/litellm/proxy/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.py similarity index 100% rename from litellm/proxy/team_endpoints.py rename to litellm/proxy/management_endpoints/team_endpoints.py diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index fa82ac75c2e..38072bb72df 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -168,9 +168,11 @@ from litellm.scheduler import Scheduler, FlowItem, DefaultPriorities ## Import All Misc routes here ## from litellm.proxy.caching_routes import router as caching_router -from litellm.proxy.team_endpoints import router as team_router -from litellm.proxy.spend_management_endpoints import router as spend_management_router -from litellm.proxy.health_endpoints import router as health_router +from litellm.proxy.management_endpoints.team_endpoints import router as team_router +from litellm.proxy.spend_reporting_endpoints.spend_management_endpoints import ( + router as spend_management_router, +) +from litellm.proxy.health_endpoints.health_endpoints import router as health_router try: from litellm._version import version @@ -5748,7 +5750,7 @@ async def new_user(data: NewUserRequest): # Admin UI Logic # if team_id passed add this user to the team if data_json.get("team_id", None) is not None: - from litellm.proxy.team_endpoints import team_member_add + from litellm.proxy.management_endpoints.team_endpoints import team_member_add await team_member_add( data=TeamMemberAddRequest( diff --git a/litellm/proxy/spend_management_endpoints.py b/litellm/proxy/spend_reporting_endpoints/spend_management_endpoints.py similarity index 100% rename from litellm/proxy/spend_management_endpoints.py rename to litellm/proxy/spend_reporting_endpoints/spend_management_endpoints.py diff --git a/litellm/tests/test_key_generate_prisma.py b/litellm/tests/test_key_generate_prisma.py index 56d27bb2032..37d21db8923 100644 --- a/litellm/tests/test_key_generate_prisma.py +++ b/litellm/tests/test_key_generate_prisma.py @@ -57,8 +57,12 @@ from litellm.proxy.proxy_server import ( model_list, LitellmUserRoles, ) -from litellm.proxy.team_endpoints import team_info, new_team, update_team -from litellm.proxy.spend_management_endpoints import ( +from litellm.proxy.management_endpoints.team_endpoints import ( + team_info, + new_team, + update_team, +) +from litellm.proxy.spend_reporting_endpoints.spend_management_endpoints import ( spend_user_fn, spend_key_fn, view_spend_logs,