From d7c28509d70e7610e59b1c986c74a94f3ef3af5d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 13 May 2024 17:11:33 -0700 Subject: [PATCH] fix(utils.py): watsonx ai exception mapping fix --- litellm/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/litellm/utils.py b/litellm/utils.py index 5d7cf63456f..14534147bb5 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -8513,6 +8513,15 @@ def exception_type( model=model, request=original_exception.request, ) + elif custom_llm_provider == "watsonx": + if "token_quota_reached" in error_response: + exception_mapping_worked = True + raise RateLimitError( + message=f"WatsonxException: Rate Limit Errror - {error_str}", + llm_provider="watsonx", + model=model, + response=original_exception.response, + ) elif custom_llm_provider == "bedrock": if ( "too many tokens" in error_str