forked from phoenix/litellm-mirror
fix(utils.py): improved togetherai exception mapping
This commit is contained in:
parent
804d58eb20
commit
e1679a44da
3 changed files with 18 additions and 17 deletions
BIN
dist/litellm-1.14.5.dev1-py3-none-any.whl
vendored
Normal file
BIN
dist/litellm-1.14.5.dev1-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
dist/litellm-1.14.5.dev1.tar.gz
vendored
Normal file
BIN
dist/litellm-1.14.5.dev1.tar.gz
vendored
Normal file
Binary file not shown.
|
@ -4858,29 +4858,30 @@ def exception_type(
|
||||||
llm_provider="together_ai",
|
llm_provider="together_ai",
|
||||||
response=original_exception.response
|
response=original_exception.response
|
||||||
)
|
)
|
||||||
elif original_exception.status_code == 408:
|
if hasattr(original_exception, "status_code"):
|
||||||
|
if original_exception.status_code == 408:
|
||||||
|
exception_mapping_worked = True
|
||||||
|
raise Timeout(
|
||||||
|
message=f"TogetherAIException - {original_exception.message}",
|
||||||
|
model=model,
|
||||||
|
llm_provider="together_ai",
|
||||||
|
request=original_exception.request
|
||||||
|
)
|
||||||
|
elif original_exception.status_code == 429:
|
||||||
|
exception_mapping_worked = True
|
||||||
|
raise RateLimitError(
|
||||||
|
message=f"TogetherAIException - {original_exception.message}",
|
||||||
|
llm_provider="together_ai",
|
||||||
|
model=model,
|
||||||
|
response=original_exception.response
|
||||||
|
)
|
||||||
|
elif original_exception.status_code == 524:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise Timeout(
|
raise Timeout(
|
||||||
message=f"TogetherAIException - {original_exception.message}",
|
|
||||||
model=model,
|
|
||||||
llm_provider="together_ai",
|
|
||||||
request=original_exception.request
|
|
||||||
)
|
|
||||||
elif original_exception.status_code == 429:
|
|
||||||
exception_mapping_worked = True
|
|
||||||
raise RateLimitError(
|
|
||||||
message=f"TogetherAIException - {original_exception.message}",
|
message=f"TogetherAIException - {original_exception.message}",
|
||||||
llm_provider="together_ai",
|
llm_provider="together_ai",
|
||||||
model=model,
|
model=model,
|
||||||
response=original_exception.response
|
|
||||||
)
|
)
|
||||||
elif original_exception.status_code == 524:
|
|
||||||
exception_mapping_worked = True
|
|
||||||
raise Timeout(
|
|
||||||
message=f"TogetherAIException - {original_exception.message}",
|
|
||||||
llm_provider="together_ai",
|
|
||||||
model=model,
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise APIError(
|
raise APIError(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue