From 1413fdfc06f94e93350bed21b7e60d9108fceb2c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 26 Nov 2024 00:05:09 +0530 Subject: [PATCH] fix(teams.tsx): fix member add when role is 'user' --- litellm/proxy/_new_secret_config.yaml | 15 ++++++++++++++- litellm/proxy/_types.py | 1 - ui/litellm-dashboard/src/components/teams.tsx | 7 ++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index a968e80d4..86ece3788 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -12,7 +12,20 @@ model_list: vertex_ai_project: "adroit-crow-413218" vertex_ai_location: "us-east5" -# litellm_settings: +router_settings: + routing_strategy: usage-based-routing-v2 + #redis_url: "os.environ/REDIS_URL" + redis_host: "os.environ/REDIS_HOST" + redis_port: "os.environ/REDIS_PORT" + +litellm_settings: + cache: true + cache_params: + type: redis + host: "os.environ/REDIS_HOST" + port: "os.environ/REDIS_PORT" + namespace: "litellm.caching" + ttl: 600 # key_generation_settings: # team_key_generation: # allowed_team_member_roles: ["admin"] diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 74e82b0ea..09cbe7cc9 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1982,7 +1982,6 @@ class MemberAddRequest(LiteLLMBase): # Replace member_data with the single Member object data["member"] = member # Call the superclass __init__ method to initialize the object - traceback.print_stack() super().__init__(**data) diff --git a/ui/litellm-dashboard/src/components/teams.tsx b/ui/litellm-dashboard/src/components/teams.tsx index 0364245be..db83fd532 100644 --- a/ui/litellm-dashboard/src/components/teams.tsx +++ b/ui/litellm-dashboard/src/components/teams.tsx @@ -413,6 +413,7 @@ const Team: React.FC = ({ selectedTeam["team_id"], user_role ); + message.success("Member added"); console.log(`response for team create call: ${response["data"]}`); // Checking if the team exists in the list and updating or adding accordingly const foundIndex = teams.findIndex((team) => { @@ -430,6 +431,7 @@ const Team: React.FC = ({ setSelectedTeam(response.data); } setIsAddMemberModalVisible(false); + } } catch (error) { console.error("Error creating the team:", error); @@ -825,6 +827,9 @@ const Team: React.FC = ({ labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left" + initialValues={{ + role: "user", + }} > <> @@ -842,8 +847,8 @@ const Team: React.FC = ({ - user admin + user