mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
is_error_str_rate_limit
This commit is contained in:
parent
59f3771799
commit
e66898828c
1 changed files with 11 additions and 2 deletions
|
|
@ -42,8 +42,17 @@ class ExceptionCheckers:
|
|||
"""
|
||||
if not isinstance(error_str, str):
|
||||
return False
|
||||
|
||||
return "429" in error_str or "rate limit" in error_str.lower()
|
||||
|
||||
if "429" in error_str or "rate limit" in error_str.lower():
|
||||
return True
|
||||
|
||||
#######################################
|
||||
# Mistral API returns this error string
|
||||
#########################################
|
||||
if "service tier capacity exceeded" in error_str.lower():
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def is_error_str_context_window_exceeded(error_str: str) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue