From 251f26d48adf9087717a456469921b9085ef1e44 Mon Sep 17 00:00:00 2001 From: Umesh Yadav <23421535+imumesh18@users.noreply.github.com> Date: Mon, 5 May 2025 17:29:12 +0530 Subject: [PATCH] copilot: Add support for tool_calls for gpt-4.1, gpt-4o, o4-mini (#29369) Github Copilot currently supports following models for agent mode with tool calls. Currently we are only supporting anthropic models and not openai and gemini. This PR add support for the openai models. I have tested it and it works for all of them. For gemini models it seems there is a issues from copilot side so not adding that in this PR as enabling gemini model breaks it in the ask mode as well. image - [x] GPT-4.1 - [x] GPT-4.0 - [x] o4-mini Release Notes: - agent: Add tool calling support for gpt-4.1, gpt-4o, o4-mini when using Copilot Chat as a provider Signed-off-by: Umesh Yadav --- crates/language_models/src/provider/copilot_chat.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/language_models/src/provider/copilot_chat.rs b/crates/language_models/src/provider/copilot_chat.rs index 9d91be8fb6..976c577699 100644 --- a/crates/language_models/src/provider/copilot_chat.rs +++ b/crates/language_models/src/provider/copilot_chat.rs @@ -188,7 +188,10 @@ impl LanguageModel for CopilotChatLanguageModel { fn supports_tools(&self) -> bool { match self.model { - CopilotChatModel::Claude3_5Sonnet + CopilotChatModel::Gpt4o + | CopilotChatModel::Gpt4_1 + | CopilotChatModel::O4Mini + | CopilotChatModel::Claude3_5Sonnet | CopilotChatModel::Claude3_7Sonnet | CopilotChatModel::Claude3_7SonnetThinking => true, _ => false,