forked from phoenix/litellm-mirror
fix(router.py): fix datetime object
This commit is contained in:
parent
2531701a2a
commit
37ac17aebd
3 changed files with 33 additions and 15 deletions
|
@ -5908,6 +5908,16 @@ def get_api_key(llm_provider: str, dynamic_api_key: Optional[str]):
|
|||
return api_key
|
||||
|
||||
|
||||
def get_utc_datetime():
|
||||
import datetime as dt
|
||||
from datetime import datetime
|
||||
|
||||
if hasattr(dt, "UTC"):
|
||||
return datetime.now(dt.UTC) # type: ignore
|
||||
else:
|
||||
return datetime.utcnow() # type: ignore
|
||||
|
||||
|
||||
def get_max_tokens(model: str):
|
||||
"""
|
||||
Get the maximum number of output tokens allowed for a given model.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue