mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(QOL improvement) Provider budget routing - allow using 1s, 1d, 1mo, 2mo etc (#6885)
* use 1 file for duration_in_seconds * add to readme.md * re use duration_in_seconds * fix importing _extract_from_regex, get_last_day_of_month * fix import * update provider budget routing * fix - remove dup test
This commit is contained in:
parent
e69678a9b3
commit
34bfebe470
12 changed files with 149 additions and 142 deletions
|
@ -17,7 +17,7 @@ import pytest
|
|||
import litellm
|
||||
from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, headers
|
||||
from litellm.proxy.utils import (
|
||||
_duration_in_seconds,
|
||||
duration_in_seconds,
|
||||
_extract_from_regex,
|
||||
get_last_day_of_month,
|
||||
)
|
||||
|
@ -593,7 +593,7 @@ def test_duration_in_seconds():
|
|||
duration_until_next_month = next_month - current_time
|
||||
expected_duration = int(duration_until_next_month.total_seconds())
|
||||
|
||||
value = _duration_in_seconds(duration="1mo")
|
||||
value = duration_in_seconds(duration="1mo")
|
||||
|
||||
assert value - expected_duration < 2
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue