mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
Merge c0289ad3ae into f2118fc767
This commit is contained in:
commit
217e3053e7
2 changed files with 8 additions and 17 deletions
|
|
@ -58,9 +58,6 @@ def _with_responses_api_version(api_base: str | None, litellm_params: Mapping[st
|
|||
|
||||
|
||||
class AzureOpenAIResponsesAPIConfig(OpenAIResponsesAPIConfig):
|
||||
# Parameters not supported by Azure Responses API
|
||||
AZURE_UNSUPPORTED_PARAMS = ["context_management"]
|
||||
|
||||
@property
|
||||
def custom_llm_provider(self) -> LlmProviders:
|
||||
return LlmProviders.AZURE
|
||||
|
|
@ -81,13 +78,6 @@ class AzureOpenAIResponsesAPIConfig(OpenAIResponsesAPIConfig):
|
|||
def _effort_resolves_to_none(model: str, effort: str | None) -> bool:
|
||||
return AzureOpenAIGPT5Config.effort_resolves_to_none(model, effort)
|
||||
|
||||
def get_supported_openai_params(self, model: str) -> list:
|
||||
"""
|
||||
Azure Responses API does not support context_management (compaction).
|
||||
"""
|
||||
base_supported_params: Final = super().get_supported_openai_params(model)
|
||||
return [param for param in base_supported_params if param not in self.AZURE_UNSUPPORTED_PARAMS]
|
||||
|
||||
def validate_environment(self, headers: dict, model: str, litellm_params: GenericLiteLLMParams | None) -> dict:
|
||||
return BaseAzureLLM.base_validate_azure_environment(headers=headers, litellm_params=litellm_params)
|
||||
|
||||
|
|
|
|||
|
|
@ -608,14 +608,15 @@ class TestAzureResponsesAPIConfig:
|
|||
|
||||
assert "tools" not in response_api_params
|
||||
|
||||
def test_azure_responses_api_context_management_unsupported(self):
|
||||
"""Test that context_management is not in Azure supported params.
|
||||
def test_azure_responses_api_supports_context_management(self):
|
||||
supported_params = self.config.get_supported_openai_params("gpt-5.1")
|
||||
|
||||
Azure does not support context_management (compaction). It should be
|
||||
excluded from supported params so it gets dropped.
|
||||
"""
|
||||
supported = self.config.get_supported_openai_params(self.model)
|
||||
assert "context_management" not in supported
|
||||
assert "context_management" in supported_params
|
||||
|
||||
o_series_config = AzureOpenAIOSeriesResponsesAPIConfig()
|
||||
o_series_supported = o_series_config.get_supported_openai_params("o_series/gpt-o1")
|
||||
assert "context_management" in o_series_supported
|
||||
assert "temperature" not in o_series_supported
|
||||
|
||||
def _anyof_tool(self):
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue