forked from phoenix/litellm-mirror
Merge pull request #2942 from BerriAI/litellm_fix_router_loading
Router Async Improvements
This commit is contained in:
commit
83e7ed94ce
10 changed files with 746 additions and 60 deletions
|
@ -1990,9 +1990,6 @@ class Logging:
|
|||
else:
|
||||
litellm.cache.add_cache(result, **kwargs)
|
||||
if isinstance(callback, CustomLogger): # custom logger class
|
||||
print_verbose(
|
||||
f"Running Async success callback: {callback}; self.stream: {self.stream}; async_complete_streaming_response: {self.model_call_details.get('async_complete_streaming_response', None)} result={result}"
|
||||
)
|
||||
if self.stream == True:
|
||||
if (
|
||||
"async_complete_streaming_response"
|
||||
|
@ -2376,7 +2373,6 @@ def client(original_function):
|
|||
if litellm.use_client or (
|
||||
"use_client" in kwargs and kwargs["use_client"] == True
|
||||
):
|
||||
print_verbose(f"litedebugger initialized")
|
||||
if "lite_debugger" not in litellm.input_callback:
|
||||
litellm.input_callback.append("lite_debugger")
|
||||
if "lite_debugger" not in litellm.success_callback:
|
||||
|
@ -5912,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