mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 10:14:26 +00:00
fix(main.py): fix linting errors
This commit is contained in:
parent
e8331a4647
commit
be9fa06da6
2 changed files with 3 additions and 2 deletions
|
@ -2108,6 +2108,7 @@ def stream_chunk_builder(chunks: list, messages: Optional[list]=None):
|
|||
# Extract the "content" strings from the nested dictionaries within "choices"
|
||||
content_list = []
|
||||
combined_content = ""
|
||||
combined_arguments = ""
|
||||
|
||||
if "tool_calls" in chunks[0]["choices"][0]["delta"] and chunks[0]["choices"][0]["delta"]["tool_calls"] is not None:
|
||||
argument_list = []
|
||||
|
|
|
@ -87,7 +87,7 @@ class Router:
|
|||
self.routing_strategy = routing_strategy
|
||||
self.fallbacks = fallbacks or litellm.fallbacks
|
||||
self.context_window_fallbacks = context_window_fallbacks or litellm.context_window_fallbacks
|
||||
self.model_exception_map = {} # dict to store model: list exceptions. self.exceptions = {"gpt-3.5": ["API KEY Error", "Rate Limit Error", "good morning error"]}
|
||||
self.model_exception_map: dict = {} # dict to store model: list exceptions. self.exceptions = {"gpt-3.5": ["API KEY Error", "Rate Limit Error", "good morning error"]}
|
||||
|
||||
# make Router.chat.completions.create compatible for openai.chat.completions.create
|
||||
self.chat = litellm.Chat(params=default_litellm_params)
|
||||
|
@ -364,7 +364,7 @@ class Router:
|
|||
original_exception = e
|
||||
### CHECK IF RATE LIMIT / CONTEXT WINDOW ERROR
|
||||
if ((isinstance(original_exception, litellm.ContextWindowExceededError) and context_window_fallbacks is None)
|
||||
or (openai.RateLimitError and fallbacks is not None)):
|
||||
or (isinstance(original_exception, openai.RateLimitError) and fallbacks is not None)):
|
||||
raise original_exception
|
||||
### RETRY
|
||||
for current_attempt in range(num_retries):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue