fix: add transcription model fallback chain

This commit is contained in:
2026-06-08 06:43:41 +00:00
parent f629794a50
commit b6223382dd
2 changed files with 37 additions and 25 deletions
+3 -4
View File
@@ -5,7 +5,7 @@ from pathlib import Path
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
from openrouter_client import _audio_format, _build_transcription_payload
from openrouter_client import TRANSCRIPTION_MODELS, _audio_format, _build_transcription_payload
def test_audio_format_defaults_to_wav_when_missing_suffix(tmp_path: Path):
@@ -18,9 +18,8 @@ def test_build_transcription_payload_uses_base64_json_shape(tmp_path: Path):
path = tmp_path / "meeting.wav"
path.write_bytes(b"RIFFdemo")
payload = _build_transcription_payload(str(path))
payload = _build_transcription_payload(str(path), TRANSCRIPTION_MODELS[0])
assert payload["model"] == "openai/whisper-large-v3"
assert payload["language"] == "en"
assert payload["model"] == "openai/gpt-4o-mini-transcribe"
assert payload["input_audio"]["format"] == "wav"
assert payload["input_audio"]["data"] == base64.b64encode(b"RIFFdemo").decode("ascii")