forked from phoenix/litellm-mirror
fix - allow setting budget duration and reset at
This commit is contained in:
parent
bf0c0c08c8
commit
a03d13fedd
1 changed files with 10 additions and 1 deletions
|
@ -8033,7 +8033,16 @@ async def new_team(
|
||||||
|
|
||||||
_model_id = model_dict.id
|
_model_id = model_dict.id
|
||||||
|
|
||||||
## ADD TO TEAM TABLE -> the user api key settings are overriding the data we passed i
|
## ADD TO TEAM TABLE
|
||||||
|
# Check budget_duration and budget_reset_at
|
||||||
|
if data.budget_duration:
|
||||||
|
duration_s = _duration_in_seconds(duration=data.budget_duration)
|
||||||
|
reset_at = datetime.now(timezone.utc) + timedelta(seconds=duration_s)
|
||||||
|
|
||||||
|
# set the budget duration and budget_reset_at in DB
|
||||||
|
data.budget_duration = duration_s
|
||||||
|
data.budget_reset_at = reset_at
|
||||||
|
|
||||||
complete_team_data = LiteLLM_TeamTable(
|
complete_team_data = LiteLLM_TeamTable(
|
||||||
**data.json(),
|
**data.json(),
|
||||||
model_id=_model_id,
|
model_id=_model_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue