mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
Merge 99d54ff085 into de7bb21887
This commit is contained in:
commit
36fee30f0f
2 changed files with 19 additions and 1 deletions
|
|
@ -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]:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue