mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
fix(memory): preserve rate-limit codes in generic stream errors
This commit is contained in:
parent
5f61a5110b
commit
6d05a83f0e
1 changed files with 4 additions and 1 deletions
|
|
@ -35,7 +35,10 @@ class ServerToolStreamError(ValueError):
|
|||
int(code)
|
||||
if code.isascii() and code.isdecimal() and len(code) == 3 and 400 <= int(code) < 600
|
||||
else 429
|
||||
if (error.get("type") or code) in ("rate_limit_error", "rate_limit_exceeded", "insufficient_quota")
|
||||
if any(
|
||||
value in ("rate_limit_error", "rate_limit_exceeded", "insufficient_quota")
|
||||
for value in (error.get("type"), code)
|
||||
)
|
||||
else 503
|
||||
if error.get("type") == "overloaded_error"
|
||||
else 502
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue