mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
[Fix] Tag Based Routing not work with wildcard routing (#5805)
* allow using tag routing for free * only enforce tags for teams / keys
This commit is contained in:
parent
3933fba41f
commit
036fce8f18
3 changed files with 21 additions and 9 deletions
|
@ -232,6 +232,12 @@ async def new_team(
|
|||
|
||||
# Set tags on the new team
|
||||
if data.tags is not None:
|
||||
from litellm.proxy.proxy_server import premium_user
|
||||
|
||||
if premium_user is not True:
|
||||
raise ValueError(
|
||||
f"Only premium users can add tags to teams. {CommonProxyErrors.not_premium_user.value}"
|
||||
)
|
||||
if complete_team_data.metadata is None:
|
||||
complete_team_data.metadata = {"tags": data.tags}
|
||||
else:
|
||||
|
@ -381,6 +387,12 @@ async def update_team(
|
|||
|
||||
# check if user is trying to update tags for team
|
||||
if "tags" in updated_kv and updated_kv["tags"] is not None:
|
||||
from litellm.proxy.proxy_server import premium_user
|
||||
|
||||
if premium_user is not True:
|
||||
raise ValueError(
|
||||
f"Only premium users can add tags to teams. {CommonProxyErrors.not_premium_user.value}"
|
||||
)
|
||||
# remove tags from updated_kv
|
||||
_tags = updated_kv.pop("tags")
|
||||
if "metadata" in updated_kv and updated_kv["metadata"] is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue