This commit is contained in:
Timothy Jaeryang Baek
2026-02-15 17:55:59 -06:00
parent e1b3e7252c
commit 319d3e8856
2 changed files with 24 additions and 22 deletions
+8 -7
View File
@@ -639,13 +639,14 @@ def transcription_handler(request, file_path, metadata, user=None):
if user and ENABLE_FORWARD_USER_INFO_HEADERS:
headers = include_user_info_headers(headers, user)
r = requests.post(
url=f"{request.app.state.config.STT_OPENAI_API_BASE_URL}/audio/transcriptions",
headers=headers,
files={"file": (filename, open(file_path, "rb"))},
data=payload,
timeout=AIOHTTP_CLIENT_TIMEOUT,
)
with open(file_path, "rb") as audio_file:
r = requests.post(
url=f"{request.app.state.config.STT_OPENAI_API_BASE_URL}/audio/transcriptions",
headers=headers,
files={"file": (filename, audio_file)},
data=payload,
timeout=AIOHTTP_CLIENT_TIMEOUT,
)
if r.status_code == 200:
# Successful transcription