mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix: restrict thinking/reasoning_effort parameters to models with extended thinking support
Only models in the 4 family and 3-7 family support extended thinking features. Previously all models would incorrectly receive these parameters. Now uses supports_reasoning() to check model registry for actual capability.
This commit is contained in:
parent
0febdf8c1c
commit
8b66b50c31
1 changed files with 8 additions and 3 deletions
|
|
@ -81,14 +81,19 @@ class GithubCopilotConfig(OpenAIConfig):
|
|||
"""
|
||||
Get supported OpenAI parameters for GitHub Copilot.
|
||||
|
||||
For Anthropic models (like claude-sonnet-4), includes thinking and reasoning parameters.
|
||||
For Claude models that support extended thinking (Claude 4 family and Claude 3-7), includes thinking and reasoning_effort parameters.
|
||||
For other models, returns standard OpenAI parameters (which may include reasoning_effort for o-series models).
|
||||
"""
|
||||
from litellm.utils import supports_reasoning
|
||||
|
||||
# Get base OpenAI parameters
|
||||
base_params = super().get_supported_openai_params(model)
|
||||
|
||||
# Add Claude-specific parameters for Anthropic models
|
||||
if "claude" in model.lower():
|
||||
# Add Claude-specific parameters for models that support extended thinking
|
||||
if "claude" in model.lower() and supports_reasoning(
|
||||
model=model,
|
||||
custom_llm_provider="github_copilot",
|
||||
):
|
||||
if "thinking" not in base_params:
|
||||
base_params.append("thinking")
|
||||
# reasoning_effort is not included by parent for Claude models, so add it
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue