fix(router.py): check if azure returns 'content_filter' response + fallback available -> fallback

Exception maps azure content filter response exceptions
This commit is contained in:
Krrish Dholakia 2024-06-22 19:10:15 -07:00
parent f814f24d9d
commit 2c7a80d08d
8 changed files with 100 additions and 70 deletions

View file

@ -477,6 +477,9 @@ def mock_completion(
if time_delay is not None:
time.sleep(time_delay)
if isinstance(mock_response, dict):
return ModelResponse(**mock_response)
model_response = ModelResponse(stream=stream)
if stream is True:
# don't try to access stream object,