mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
add mock InternalServerError
This commit is contained in:
parent
5fffb2245d
commit
e1365fdc2d
1 changed files with 9 additions and 0 deletions
|
|
@ -524,6 +524,15 @@ def mock_completion(
|
|||
llm_provider=getattr(mock_response, "llm_provider", custom_llm_provider or "openai"), # type: ignore
|
||||
model=model,
|
||||
)
|
||||
elif (
|
||||
isinstance(mock_response, str)
|
||||
and mock_response == "litellm.InternalServerError"
|
||||
):
|
||||
raise litellm.InternalServerError(
|
||||
message="this is a mock internal server error",
|
||||
llm_provider=getattr(mock_response, "llm_provider", custom_llm_provider or "openai"), # type: ignore
|
||||
model=model,
|
||||
)
|
||||
elif isinstance(mock_response, str) and mock_response.startswith(
|
||||
"Exception: content_filter_policy"
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue