This commit is contained in:
JiriUhlir
2026-07-10 10:08:51 +02:00
parent 57faf12d97
commit d55089b1c8
5 changed files with 105 additions and 37 deletions
+2 -1
View File
@@ -20,7 +20,8 @@ async def transcribe(
"""Přepíše audio přes OpenAI Whisper (/audio/transcriptions) a vrátí text."""
headers = {"Authorization": f"Bearer {api_key}"}
files = {"file": (filename or "audio.mp3", audio, content_type or "application/octet-stream")}
form = {"model": model}
# temperature=0 => deterministický přepis, méně halucinací na tichu/šumu.
form = {"model": model, "temperature": "0"}
if language:
form["language"] = language
url = f"{OPENAI_BASE_URL}/audio/transcriptions"