mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
Merge 2b6c30c2d9 into c2c2a623c0
This commit is contained in:
commit
4a682fdf9e
2 changed files with 21 additions and 0 deletions
|
|
@ -12,6 +12,12 @@ from ...openai.chat.gpt_transformation import OpenAIGPTConfig
|
|||
|
||||
|
||||
class DashScopeChatConfig(OpenAIGPTConfig):
|
||||
def get_supported_openai_params(self, model: str) -> list[str]: # mutable-ok: base class contract returns a list
|
||||
return [ # mutable-ok: base class contract returns a list
|
||||
*super().get_supported_openai_params(model=model),
|
||||
"reasoning_effort",
|
||||
]
|
||||
|
||||
def remove_cache_control_flag_from_messages_and_tools(
|
||||
self,
|
||||
model: str,
|
||||
|
|
|
|||
|
|
@ -164,6 +164,21 @@ class TestDashScopeConfig:
|
|||
|
||||
assert transformed_messages[0].get("cache_control") == {"type": "ephemeral"}
|
||||
|
||||
@pytest.mark.parametrize("reasoning_effort", ["none", "minimal", "low", "high"])
|
||||
def test_dashscope_forwards_reasoning_effort(self, reasoning_effort: str):
|
||||
"""DashScope supports reasoning_effort, so it must reach the provider instead of being dropped."""
|
||||
assert "reasoning_effort" in DashScopeChatConfig().get_supported_openai_params(
|
||||
model="qwen3.7-plus"
|
||||
)
|
||||
|
||||
optional_params = litellm.get_optional_params(
|
||||
model="qwen3.7-plus",
|
||||
custom_llm_provider="dashscope",
|
||||
reasoning_effort=reasoning_effort,
|
||||
)
|
||||
|
||||
assert optional_params["reasoning_effort"] == reasoning_effort
|
||||
|
||||
def test_dashscope_preserves_cache_control_in_tools(self):
|
||||
"""DashScope should NOT strip cache_control from tools."""
|
||||
config = DashScopeChatConfig()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue