fix(proxy): return text/plain for audio transcriptions when response_format=text/srt/vtt

This commit is contained in:
dfatima504 2026-06-27 16:42:53 +05:00
parent 5a395ef909
commit 14613f8b2f

View file

@ -9643,6 +9643,10 @@ 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