fix(utils.py): add together ai exception mapping

This commit is contained in:
Krrish Dholakia 2024-06-20 11:29:39 -07:00
parent 3d90b25005
commit d6eb986b8e
2 changed files with 18 additions and 1 deletions

View file

@ -865,7 +865,7 @@
},
"deepseek-coder": {
"max_tokens": 4096,
"max_input_tokens": 16000,
"max_input_tokens": 32000,
"max_output_tokens": 4096,
"input_cost_per_token": 0.00000014,
"output_cost_per_token": 0.00000028,
@ -1984,6 +1984,15 @@
"litellm_provider": "replicate",
"mode": "chat"
},
"openrouter/deepseek/deepseek-coder": {
"max_tokens": 4096,
"max_input_tokens": 32000,
"max_output_tokens": 4096,
"input_cost_per_token": 0.00000014,
"output_cost_per_token": 0.00000028,
"litellm_provider": "openrouter",
"mode": "chat"
},
"openrouter/microsoft/wizardlm-2-8x22b:nitro": {
"max_tokens": 65536,
"input_cost_per_token": 0.000001,

View file

@ -5741,7 +5741,15 @@ def exception_type(
response=original_exception.response,
litellm_debug_info=extra_information,
)
elif "Web server is returning an unknown error" in error_str:
exception_mapping_worked = True
raise litellm.InternalServerError(
message=f"{exception_provider} - {message}",
model=model,
llm_provider=custom_llm_provider,
)
elif "Request too large" in error_str:
exception_mapping_worked = True
raise RateLimitError(
message=f"RateLimitError: {exception_provider} - {message}",
model=model,