forked from phoenix/litellm-mirror
Merge pull request #3828 from BerriAI/litellm_outage_alerting
fix(slack_alerting.py): support region based outage alerting
This commit is contained in:
commit
d25ed9c4d3
9 changed files with 414 additions and 78 deletions
|
@ -420,6 +420,8 @@ def mock_completion(
|
|||
api_key="mock-key",
|
||||
)
|
||||
if isinstance(mock_response, Exception):
|
||||
if isinstance(mock_response, openai.APIError):
|
||||
raise mock_response
|
||||
raise litellm.APIError(
|
||||
status_code=500, # type: ignore
|
||||
message=str(mock_response),
|
||||
|
@ -463,7 +465,9 @@ def mock_completion(
|
|||
|
||||
return model_response
|
||||
|
||||
except:
|
||||
except Exception as e:
|
||||
if isinstance(e, openai.APIError):
|
||||
raise e
|
||||
traceback.print_exc()
|
||||
raise Exception("Mock completion response failed")
|
||||
|
||||
|
@ -864,6 +868,7 @@ def completion(
|
|||
user=user,
|
||||
optional_params=optional_params,
|
||||
litellm_params=litellm_params,
|
||||
custom_llm_provider=custom_llm_provider,
|
||||
)
|
||||
if mock_response:
|
||||
return mock_completion(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue