mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
feat(team_endpoints.py): return team member budgets in /team/info call
Fixes https://github.com/BerriAI/litellm/issues/5390
This commit is contained in:
parent
f0fb8bdf45
commit
18689c25e9
5 changed files with 53 additions and 25 deletions
|
@ -120,7 +120,11 @@ async def add_new_member(
|
|||
)
|
||||
|
||||
# Check if trying to set a budget for team member
|
||||
if max_budget_in_team is not None and new_member.user_id is not None:
|
||||
if (
|
||||
max_budget_in_team is not None
|
||||
and returned_user is not None
|
||||
and returned_user.user_id is not None
|
||||
):
|
||||
# create a new budget item for this member
|
||||
response = await prisma_client.db.litellm_budgettable.create(
|
||||
data={
|
||||
|
@ -135,7 +139,7 @@ async def add_new_member(
|
|||
await prisma_client.db.litellm_teammembership.create(
|
||||
data={
|
||||
"team_id": team_id,
|
||||
"user_id": new_member.user_id,
|
||||
"user_id": returned_user.user_id,
|
||||
"budget_id": _budget_id,
|
||||
},
|
||||
include={"litellm_budget_table": True},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue