Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(e2e): accept both model-not-found phrasings on a shared proxy

mateo-berrief6af5c61581
diff --git a/tests/e2e/llm_translation/test_audio_transcriptions_e2e.py b/tests/e2e/llm_translation/test_audio_transcriptions_e2e.py
index 92b33fef85f..735f1a4a703 100644
--- a/tests/e2e/llm_translation/test_audio_transcriptions_e2e.py
+++ b/tests/e2e/llm_translation/test_audio_transcriptions_e2e.py
@@ -3,7 +3,10 @@
Registers an OpenAI speech-to-text deployment at runtime and uploads a spoken
weather question (the realtime suite's 24kHz WAV fixture) as multipart, asserting
the returned transcript is non-empty and mentions the word it was asked about.
-Also pins missing file/model negatives.
+Also pins missing file/model negatives. A model-less request comes back as one of
+two 400s depending on whether any wildcard deployment happens to be registered on
+the shared proxy, so the assertion accepts either phrasing and holds both to naming
+the model as the problem.
"""
from __future__ import annotations
@@ -25,6 +28,8 @@ WEATHER_WAV = (
Path(__file__).resolve().parent / "realtime" / "fixtures" / "weather_question_24k.wav"
)
+MISSING_MODEL_PHRASES: Final = ("model=none", "invalid model", "model is required")
+
class _OptionalTranscriptionForm(BaseModel):
model: str | None = None
@@ -105,8 +110,8 @@ class TestAudioTranscriptions:
match result:
case UnknownApiError(status_code=400, body=body):
lowered: Final = body.lower()
- assert "model" in lowered and ("required" in lowered or "invalid model" in lowered), (
- f"missing model error must identify the required model: {body[:300]}"
+ assert any(phrase in lowered for phrase in MISSING_MODEL_PHRASES), (
+ f"missing model error must name the model as the problem: {body[:300]}"
)
case other:
pytest.fail(f"missing model expected a model-specific 400, got {other!r}")