mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
can_user_call_model (#10170)
This commit is contained in:
parent
d7c37fd68d
commit
d6b45ba143
1 changed files with 2 additions and 2 deletions
|
@ -88,7 +88,7 @@ async def common_checks(
|
||||||
9. Check if request body is safe
|
9. Check if request body is safe
|
||||||
10. [OPTIONAL] Organization checks - is user_object.organization_id is set, run these checks
|
10. [OPTIONAL] Organization checks - is user_object.organization_id is set, run these checks
|
||||||
"""
|
"""
|
||||||
_model = request_body.get("model", None)
|
_model: Optional[str] = cast(Optional[str], request_body.get("model", None))
|
||||||
|
|
||||||
# 1. If team is blocked
|
# 1. If team is blocked
|
||||||
if team_object is not None and team_object.blocked is True:
|
if team_object is not None and team_object.blocked is True:
|
||||||
|
@ -112,7 +112,7 @@ async def common_checks(
|
||||||
)
|
)
|
||||||
|
|
||||||
## 2.1 If user can call model (if personal key)
|
## 2.1 If user can call model (if personal key)
|
||||||
if team_object is None and user_object is not None:
|
if _model and team_object is None and user_object is not None:
|
||||||
await can_user_call_model(
|
await can_user_call_model(
|
||||||
model=_model,
|
model=_model,
|
||||||
llm_router=llm_router,
|
llm_router=llm_router,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue