fix(proxy): correct placement of response_format check in audio_transcriptions

This commit is contained in:
dfatima504 2026-06-27 17:15:25 +05:00
parent 14613f8b2f
commit 21cb1cdd65

View file

@ -9643,10 +9643,6 @@ async def embeddings(
version=version,
)
if data.get("response_format") in ("text", "srt", "vtt"):
from fastapi.responses import Response as FastAPIResponse
return FastAPIResponse(content=response.text, media_type="text/plain")
return response
except Exception as e:
# Use unified error handler
@ -10055,6 +10051,10 @@ async def audio_transcriptions(
if callback_headers:
fastapi_response.headers.update(callback_headers)
if data.get("response_format") in ("text", "srt", "vtt"):
from fastapi.responses import Response as FastAPIResponse
return FastAPIResponse(content=response.text, media_type="text/plain")
return response
except Exception as e:
await proxy_logging_obj.post_call_failure_hook(