docs(proxy): refresh get_user_key_counts docstring after group_by switch

This commit is contained in:
lengkejun 2026-05-21 14:55:09 +08:00
parent 4eeefbaf0c
commit f2799d4e87

View file

@ -1763,14 +1763,16 @@ async def get_user_key_counts(
user_ids: Optional[List[str]] = None,
):
"""
Helper function to get the count of keys for each user using Prisma's count method.
Get the count of (non-UI-session) keys for each user via a single
Prisma ``group_by`` query, avoiding an N+1 per-user ``count`` loop.
Args:
prisma_client: The Prisma client instance
user_ids: List of user IDs to get key counts for
Returns:
Dictionary mapping user_id to key count
Dictionary mapping user_id to key count. Users in ``user_ids`` with no
keys are present with a value of ``0``.
"""
from litellm.constants import UI_SESSION_TOKEN_TEAM_ID