mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
Merge 9a13294f20 into e9b1c11098
This commit is contained in:
commit
ea5d18b03b
2 changed files with 31 additions and 1 deletions
|
|
@ -137,7 +137,13 @@ 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/", "")
|
||||
# gpt5_series/ is a litellm routing marker, not part of the Azure deployment name
|
||||
return (
|
||||
model.replace("responses/", "")
|
||||
.replace("o_series/", "")
|
||||
.replace("azure_ai/", "")
|
||||
.replace(AzureOpenAIGPT5Config.GPT5_SERIES_ROUTE, "")
|
||||
)
|
||||
|
||||
def _validate_input_param(
|
||||
self, input: str | ResponseInputParam, *, drop_params: bool = False
|
||||
|
|
|
|||
|
|
@ -27,6 +27,30 @@ from litellm.utils import ProviderConfigManager
|
|||
from tests.unit.proxy.conftest import httpx_transport
|
||||
|
||||
|
||||
@pytest.mark.serial
|
||||
def test_get_stripped_model_name_strips_gpt5_series_route():
|
||||
"""The gpt5_series/ routing marker must not be sent to Azure as part of the deployment name."""
|
||||
config = AzureOpenAIResponsesAPIConfig()
|
||||
|
||||
assert (
|
||||
config.get_stripped_model_name("azure/gpt5_series/my-gpt5-deployment")
|
||||
== "azure/my-gpt5-deployment"
|
||||
)
|
||||
assert (
|
||||
config.get_stripped_model_name("azure/responses/gpt5_series/my-gpt5-deployment")
|
||||
== "azure/my-gpt5-deployment"
|
||||
)
|
||||
# existing markers still strip, and plain deployments pass through untouched
|
||||
assert (
|
||||
config.get_stripped_model_name("azure/o_series/my-o3-deployment")
|
||||
== "azure/my-o3-deployment"
|
||||
)
|
||||
assert (
|
||||
config.get_stripped_model_name("azure/my-gpt5-deployment")
|
||||
== "azure/my-gpt5-deployment"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.serial
|
||||
def test_validate_environment_api_key_within_litellm_params():
|
||||
azure_openai_responses_apiconfig = AzureOpenAIResponsesAPIConfig()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue