test(openai): unbreak audio chat and Azure embedding integration tests (#37589)

Two unrelated nightly-CI failures rooted in upstream API drift. OpenAI
retired `gpt-4o-audio-preview` (now 404) and Azure embedding deployments
running `text-embedding-3-*` with truncated `dimensions` no longer
return unit-norm vectors.
This commit is contained in:
Mason Daugherty
2026-05-20 20:00:52 -05:00
committed by GitHub
parent 4d2efcd756
commit 515f1f4536
3 changed files with 3 additions and 15 deletions

View File

@@ -898,7 +898,7 @@ def test_json_schema_openai_format(
def test_audio_output_modality() -> None:
llm = ChatOpenAI(
model="gpt-4o-audio-preview",
model="gpt-audio",
temperature=0,
model_kwargs={
"modalities": ["text", "audio"],
@@ -926,7 +926,7 @@ def test_audio_output_modality() -> None:
def test_audio_input_modality() -> None:
llm = ChatOpenAI(
model="gpt-4o-audio-preview",
model="gpt-audio",
temperature=0,
model_kwargs={
"modalities": ["text", "audio"],

View File

@@ -104,7 +104,7 @@ def test_audio_model() -> None:
@property
def chat_model_params(self) -> dict:
return {
"model": "gpt-4o-audio-preview",
"model": "gpt-audio",
"temperature": 0,
"model_kwargs": {
"modalities": ["text", "audio"],

View File

@@ -119,15 +119,3 @@ def test_azure_openai_embedding_with_empty_string() -> None:
)
assert np.allclose(output[0], expected_output, atol=0.001)
assert len(output[1]) == 1536
@pytest.mark.scheduled
def test_embed_documents_normalized() -> None:
output = _get_embeddings().embed_documents(["foo walked to the market"])
assert np.isclose(np.linalg.norm(output[0]), 1.0)
@pytest.mark.scheduled
def test_embed_query_normalized() -> None:
output = _get_embeddings().embed_query("foo walked to the market")
assert np.isclose(np.linalg.norm(output), 1.0)