can_user_call_model (#10170)
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 51s
Helm unit test / unit-test (push) Successful in 51s

This commit is contained in:
Ishaan Jaff 2025-04-19 16:46:00 -07:00 committed by GitHub
parent 431b230f07
commit 7c3df984da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,7 +88,7 @@ async def common_checks(
9. Check if request body is safe
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
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)
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(
model=_model,
llm_router=llm_router,