Marik1337's picture
Add application file
6059138
raw
history blame contribute delete
394 Bytes
from __future__ import annotations
RATE_LIMIT_MESSAGE = "Mistral API rate limit exceeded. Please wait a few seconds and try again."
def is_rate_limit_error(error: Exception) -> bool:
text = str(error).lower()
return (
"429" in text
or "rate limit" in text
or "rate_limited" in text
or '"code":"1300"' in text
or "'code': '1300'" in text
)