diff --git a/litellm/llms/github_copilot/chat/transformation.py b/litellm/llms/github_copilot/chat/transformation.py index e71e9b610b..2aab0207ca 100644 --- a/litellm/llms/github_copilot/chat/transformation.py +++ b/litellm/llms/github_copilot/chat/transformation.py @@ -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