fix(utils.py): watsonx ai exception mapping fix

This commit is contained in:
Krrish Dholakia 2024-05-13 17:11:33 -07:00
parent af9489bbfd
commit d7c28509d7

View file

@ -8513,6 +8513,15 @@ def exception_type(
model=model, model=model,
request=original_exception.request, 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": elif custom_llm_provider == "bedrock":
if ( if (
"too many tokens" in error_str "too many tokens" in error_str