mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(Bug Fix + Better Observability) - BudgetResetJob: (#8562)
* use class ResetBudgetJob * refactor reset budget job * update reset_budget job * refactor reset budget job * fix LiteLLM_UserTable * refactor reset budget job * add telemetry for reset budget job * dd - log service success/failure on DD * add detailed reset budget reset info on DD * initialize_scheduled_background_jobs * refactor reset budget job * trigger service failure hook when fails to reset a budget for team, key, user * fix resetBudgetJob * unit testing for ResetBudgetJob * test_duration_in_seconds_basic * testing for triggering service logging * fix logs on test teams fail * remove unused imports * fix import duration in s * duration_in_seconds
This commit is contained in:
parent
a8717ea124
commit
c8d31a209b
11 changed files with 1107 additions and 87 deletions
|
@ -18,9 +18,7 @@ import pytest
|
|||
|
||||
import litellm
|
||||
from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, headers
|
||||
from litellm.proxy.utils import (
|
||||
duration_in_seconds,
|
||||
)
|
||||
from litellm.litellm_core_utils.duration_parser import duration_in_seconds
|
||||
from litellm.litellm_core_utils.duration_parser import (
|
||||
get_last_day_of_month,
|
||||
_extract_from_regex,
|
||||
|
@ -721,6 +719,14 @@ def test_duration_in_seconds():
|
|||
assert value - expected_duration < 2
|
||||
|
||||
|
||||
def test_duration_in_seconds_basic():
|
||||
assert duration_in_seconds(duration="3s") == 3
|
||||
assert duration_in_seconds(duration="3m") == 180
|
||||
assert duration_in_seconds(duration="3h") == 10800
|
||||
assert duration_in_seconds(duration="3d") == 259200
|
||||
assert duration_in_seconds(duration="3w") == 1814400
|
||||
|
||||
|
||||
def test_get_llm_provider_ft_models():
|
||||
"""
|
||||
All ft prefixed models should map to OpenAI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue