mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
feat(proxy_server.py): return all teams, user is a member of in /user/info
https://github.com/BerriAI/litellm/issues/2014
This commit is contained in:
parent
045d84e167
commit
d0813fd27f
2 changed files with 15 additions and 13 deletions
|
@ -3981,6 +3981,10 @@ async def user_info(
|
|||
user_info = await prisma_client.get_data(user_id=user_id)
|
||||
else:
|
||||
user_info = None
|
||||
## GET ALL TEAMS ##
|
||||
teams = await prisma_client.get_data(
|
||||
user_id=user_id, table_name="team", query_type="find_all"
|
||||
)
|
||||
## GET ALL KEYS ##
|
||||
keys = await prisma_client.get_data(
|
||||
user_id=user_id,
|
||||
|
@ -4004,7 +4008,12 @@ async def user_info(
|
|||
# if using pydantic v1
|
||||
key = key.dict()
|
||||
key.pop("token", None)
|
||||
return {"user_id": user_id, "user_info": user_info, "keys": keys}
|
||||
return {
|
||||
"user_id": user_id,
|
||||
"user_info": user_info,
|
||||
"keys": keys,
|
||||
"teams": teams,
|
||||
}
|
||||
except Exception as e:
|
||||
if isinstance(e, HTTPException):
|
||||
raise ProxyException(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue