feat(router.py): add server cooldown logic

This commit is contained in:
Krrish Dholakia 2023-11-22 15:59:41 -08:00
parent 4ece219ec5
commit 3e76d4b422
5 changed files with 67 additions and 82 deletions

View file

@ -3579,7 +3579,7 @@ def exception_type(
)
elif custom_llm_provider == "anthropic": # one of the anthropics
if hasattr(original_exception, "message"):
if "prompt is too long" in original_exception.message:
if "prompt is too long" in original_exception.message or "prompt: length" in original_exception.message:
exception_mapping_worked = True
raise ContextWindowExceededError(
message=original_exception.message,