mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(feat) return team alias in keys
This commit is contained in:
parent
7f793246c2
commit
beb72f94e0
1 changed files with 5 additions and 2 deletions
|
@ -5282,6 +5282,7 @@ async def user_info(
|
|||
user_info = {"spend": spend}
|
||||
|
||||
## REMOVE HASHED TOKEN INFO before returning ##
|
||||
returned_keys = []
|
||||
for key in keys:
|
||||
try:
|
||||
key = key.model_dump() # noqa
|
||||
|
@ -5298,14 +5299,16 @@ async def user_info(
|
|||
team_info = await prisma_client.get_data(
|
||||
team_id=key["team_id"], table_name="team"
|
||||
)
|
||||
key["team_alias"] = team_info["team_alias"]
|
||||
team_alias = getattr(team_info, "team_alias", None)
|
||||
key["team_alias"] = team_alias
|
||||
else:
|
||||
key["team_alias"] = "None"
|
||||
returned_keys.append(key)
|
||||
|
||||
response_data = {
|
||||
"user_id": user_id,
|
||||
"user_info": user_info,
|
||||
"keys": keys,
|
||||
"keys": returned_keys,
|
||||
"teams": team_list,
|
||||
}
|
||||
return response_data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue