The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
feat: add thinking and reasoning parameter support for GitHub Copilot provider
Tim Elfrink0febdf8c1ce8
diff --git a/litellm/llms/github_copilot/chat/transformation.py b/litellm/llms/github_copilot/chat/transformation.pyindex 8ef2a54c62d..e71e9b610ba 100644--- a/litellm/llms/github_copilot/chat/transformation.py+++ b/litellm/llms/github_copilot/chat/transformation.py@@ -82,14 +82,18 @@ class GithubCopilotConfig(OpenAIConfig):Get supported OpenAI parameters for GitHub Copilot.For Anthropic models (like claude-sonnet-4), includes thinking and reasoning parameters.- For other models, returns standard OpenAI parameters.+ For other models, returns standard OpenAI parameters (which may include reasoning_effort for o-series models)."""# Get base OpenAI parametersbase_params = super().get_supported_openai_params(model)- # Add thinking and reasoning parameters for Anthropic Claude models+ # Add Claude-specific parameters for Anthropic modelsif "claude" in model.lower():- base_params.extend(["thinking", "reasoning_effort"])+ if "thinking" not in base_params:+ base_params.append("thinking")+ # reasoning_effort is not included by parent for Claude models, so add it+ if "reasoning_effort" not in base_params:+ base_params.append("reasoning_effort")return base_paramsdiff --git a/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py b/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.pyindex ac7046f8ced..d389c445526 100644--- a/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py+++ b/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py@@ -378,15 +378,17 @@ def test_get_supported_openai_params_claude_model():assert "thinking" in supported_params_claudeassert "reasoning_effort" in supported_params_claude- # Test non-Claude model doesn't include thinking/reasoning parameters+ # Test non-Claude model doesn't include thinking parameters but may include reasoning_effortsupported_params_gpt = config.get_supported_openai_params("gpt-4o")assert "thinking" not in supported_params_gpt+ # gpt-4o should NOT have reasoning_effort (not a reasoning model)assert "reasoning_effort" not in supported_params_gpt- # Test with other non-Claude models+ # Test O-series reasoning models include reasoning_effort but not thinkingsupported_params_o3 = config.get_supported_openai_params("o3-mini")assert "thinking" not in supported_params_o3- assert "reasoning_effort" not in supported_params_o3+ # o3-mini should have reasoning_effort (it's an O-series reasoning model)+ assert "reasoning_effort" in supported_params_o3def test_get_supported_openai_params_case_insensitive():