Updated the test case

This commit is contained in:
zishaansunderji 2025-04-07 18:40:56 -04:00
parent 9717d89e69
commit 0cf1d70955
3 changed files with 131 additions and 64 deletions

View file

@ -183,6 +183,13 @@ async def run_async_fallback(
response=response,
attempted_fallbacks=fallback_depth,
)
# If this was a mid-stream fallback, also add that to response headers
if is_mid_stream and hasattr(response, "_hidden_params"):
response._hidden_params.setdefault("additional_headers", {})
response._hidden_params["additional_headers"]["x-litellm-mid-stream-fallback"] = True
response._hidden_params["additional_headers"]["x-litellm-previous-content-length"] = len(previous_content)
# callback for successfull_fallback_event():
await log_success_fallback_event(
original_model_group=original_model_group,