This commit is contained in:
Clément Fiere 2026-11-04 00:20:14 +00:00 • committed by GitHub
commit 36fee30f0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -120,7 +120,8 @@ class AzureOpenAIResponsesAPIConfig(OpenAIResponsesAPIConfig):
return BaseAzureLLM.base_validate_azure_environment(headers=headers, litellm_params=litellm_params)
def get_stripped_model_name(self, model: str) -> str:
return model.replace("responses/", "").replace("o_series/", "").replace("azure_ai/", "")
stripped: Final = model.replace("responses/", "").replace("o_series/", "").replace("azure_ai/", "")
return stripped.removeprefix(AzureOpenAIGPT5Config.GPT5_SERIES_ROUTE)
def _handle_reasoning_item(self, item: dict[str, Any]) -> Mapping[str, object]:
"""

View file

@ -1297,6 +1297,23 @@ def test_azure_responses_sends_the_deployment_name_when_azure_ai_prefix_survives
assert request["model"] == "gpt-5.4-nano"
def test_gpt5_series_selector_is_not_sent_as_part_of_the_deployment_name(respx_mock: respx.MockRouter) -> None:
route: Final = respx_mock.post(host="example-resource.openai.azure.com").mock(
return_value=httpx.Response(200, json=_COMPLETED_RESPONSE)
)
response: Final = litellm.responses(
model="azure/gpt5_series/my-gpt-5-deployment",
input="hi",
api_base=_AZURE_RESOURCE,
api_key="azure-test-key",
)
assert response.output[0].content[0].text == "Done."
assert route.call_count == 1
assert json.loads(route.calls[0].request.content)["model"] == "my-gpt-5-deployment"
@pytest.mark.asyncio
async def test_azure_responses_api_status_error():
"""