diff --git a/core/llm/llms/CometAPI.ts b/core/llm/llms/CometAPI.ts index 68e91f47af..d98e7d1b3b 100644 --- a/core/llm/llms/CometAPI.ts +++ b/core/llm/llms/CometAPI.ts @@ -205,6 +205,7 @@ class CometAPI extends OpenAI { "claude-3-5-haiku-latest", // Gemini series + "gemini-3-pro-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", diff --git a/core/llm/toolSupport.test.ts b/core/llm/toolSupport.test.ts index 30056f85a0..2f0f566e7e 100644 --- a/core/llm/toolSupport.test.ts +++ b/core/llm/toolSupport.test.ts @@ -1,5 +1,5 @@ // core/llm/toolSupport.test.ts -import { PROVIDER_TOOL_SUPPORT } from "./toolSupport"; +import { PROVIDER_TOOL_SUPPORT, isRecommendedAgentModel } from "./toolSupport"; describe("PROVIDER_TOOL_SUPPORT", () => { describe("continue-proxy", () => { @@ -354,3 +354,140 @@ describe("PROVIDER_TOOL_SUPPORT", () => { }); }); }); + +describe("isRecommendedAgentModel", () => { + describe("OpenAI models", () => { + it("should return true for o1, o3, o4 models", () => { + expect(isRecommendedAgentModel("o1")).toBe(true); + expect(isRecommendedAgentModel("o1-preview")).toBe(true); + expect(isRecommendedAgentModel("o3")).toBe(true); + expect(isRecommendedAgentModel("o3-mini")).toBe(true); + expect(isRecommendedAgentModel("o4")).toBe(true); + }); + + it("should return true for GPT-5 models", () => { + expect(isRecommendedAgentModel("gpt-5")).toBe(true); + expect(isRecommendedAgentModel("gpt-5-turbo")).toBe(true); + }); + + it("should return false for GPT-4 models", () => { + expect(isRecommendedAgentModel("gpt-4")).toBe(false); + expect(isRecommendedAgentModel("gpt-4-turbo")).toBe(false); + }); + }); + + describe("DeepSeek models", () => { + it("should return true for DeepSeek R1/Reasoner models", () => { + expect(isRecommendedAgentModel("deepseek-r1")).toBe(true); + expect(isRecommendedAgentModel("deepseek-r1-0528")).toBe(true); + expect(isRecommendedAgentModel("deepseek-reasoner")).toBe(true); + }); + + it("should return false for non-reasoner DeepSeek models", () => { + expect(isRecommendedAgentModel("deepseek-chat")).toBe(false); + expect(isRecommendedAgentModel("deepseek-coder")).toBe(false); + }); + }); + + describe("Gemini models", () => { + it("should return true for Gemini 2.5 Pro models", () => { + expect(isRecommendedAgentModel("gemini-2.5-pro")).toBe(true); + expect(isRecommendedAgentModel("gemini-2.5-pro-preview")).toBe(true); + }); + + it("should return true for Gemini 3 Pro models", () => { + expect(isRecommendedAgentModel("gemini-3-pro-preview")).toBe(true); + expect(isRecommendedAgentModel("gemini-3-pro")).toBe(true); + }); + + it("should return false for Gemini Flash models", () => { + expect(isRecommendedAgentModel("gemini-2.5-flash")).toBe(false); + expect(isRecommendedAgentModel("gemini-3-flash")).toBe(false); + }); + + it("should return false for Gemini models without pro designation", () => { + expect(isRecommendedAgentModel("gemini-2.5")).toBe(false); + expect(isRecommendedAgentModel("gemini-3")).toBe(false); + }); + + it("should return false for older Gemini versions", () => { + expect(isRecommendedAgentModel("gemini-1.5-pro")).toBe(false); + expect(isRecommendedAgentModel("gemini-2.0-pro")).toBe(false); + }); + }); + + describe("Claude models", () => { + it("should return true for Claude Sonnet 3.7 and later models", () => { + expect(isRecommendedAgentModel("claude-3-7-sonnet")).toBe(true); + expect(isRecommendedAgentModel("claude-3.7-sonnet")).toBe(true); + expect(isRecommendedAgentModel("claude-sonnet-4")).toBe(true); + expect(isRecommendedAgentModel("claude-4-sonnet")).toBe(true); + }); + + it("should return true for Claude Opus 4 models", () => { + expect(isRecommendedAgentModel("claude-opus-4")).toBe(true); + }); + + it("should return true for Claude 4-5 models", () => { + expect(isRecommendedAgentModel("claude-4-5")).toBe(true); + }); + + it("should return false for Claude 3.5 Sonnet models", () => { + expect(isRecommendedAgentModel("claude-3-5-sonnet")).toBe(false); + expect(isRecommendedAgentModel("claude-3.5-sonnet")).toBe(false); + }); + + it("should return false for Claude Haiku models", () => { + expect(isRecommendedAgentModel("claude-3-7-haiku")).toBe(false); + expect(isRecommendedAgentModel("claude-3.7-haiku")).toBe(false); + }); + + it("should return false for older Claude models", () => { + expect(isRecommendedAgentModel("claude-3-opus")).toBe(false); + expect(isRecommendedAgentModel("claude-2")).toBe(false); + }); + }); + + describe("xAI models", () => { + it("should return true for Grok Code models", () => { + expect(isRecommendedAgentModel("grok-code")).toBe(true); + expect(isRecommendedAgentModel("grok-code-beta")).toBe(true); + }); + + it("should return false for non-code Grok models", () => { + expect(isRecommendedAgentModel("grok-3")).toBe(false); + expect(isRecommendedAgentModel("grok-4")).toBe(false); + }); + }); + + describe("case insensitivity", () => { + it("should handle uppercase model names", () => { + expect(isRecommendedAgentModel("GEMINI-3-PRO-PREVIEW")).toBe(true); + expect(isRecommendedAgentModel("CLAUDE-4-SONNET")).toBe(true); + expect(isRecommendedAgentModel("DEEPSEEK-R1")).toBe(true); + expect(isRecommendedAgentModel("O3-MINI")).toBe(true); + }); + + it("should handle mixed case model names", () => { + expect(isRecommendedAgentModel("Gemini-3-Pro")).toBe(true); + expect(isRecommendedAgentModel("Claude-Opus-4")).toBe(true); + expect(isRecommendedAgentModel("DeepSeek-Reasoner")).toBe(true); + }); + }); + + describe("edge cases", () => { + it("should return false for empty string", () => { + expect(isRecommendedAgentModel("")).toBe(false); + }); + + it("should return false for random strings", () => { + expect(isRecommendedAgentModel("random-model")).toBe(false); + expect(isRecommendedAgentModel("test")).toBe(false); + }); + + it("should return false for partial matches", () => { + expect(isRecommendedAgentModel("gemini-pro")).toBe(false); + expect(isRecommendedAgentModel("claude-sonnet")).toBe(false); + }); + }); +}); diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index f609b5df38..01ad207983 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -391,7 +391,7 @@ export function isRecommendedAgentModel(modelName: string): boolean { const recs: RegExp[][] = [ [/o[134]/], [/deepseek/, /r1|reasoner/], - [/gemini/, /2\.5/, /pro/], + [/gemini/, /2\.5|3/, /pro/], [/gpt/, /-5|5\.1/], [/claude/, /sonnet/, /3\.7|3-7|-4/], [/claude/, /opus/, /-4/], diff --git a/docs/customize/model-roles/chat.mdx b/docs/customize/model-roles/chat.mdx index f08193583c..d247ba0ea7 100644 --- a/docs/customize/model-roles/chat.mdx +++ b/docs/customize/model-roles/chat.mdx @@ -114,20 +114,20 @@ If you prefer to use a model from [xAI](../model-providers/more/xAI), then we re -### Gemini 2.0 Flash from Google +### Gemini 3 Pro from Google -If you prefer to use a model from [Google](../model-providers/top-level/gemini), then we recommend Gemini 2.0 Flash. +If you prefer to use a model from [Google](../model-providers/top-level/gemini), then we recommend Gemini 3 Pro. - Add the [Gemini 2.0 Flash block](https://hub.continue.dev/google/gemini-2.0-flash) from the hub + Add the [Gemini 3 Pro block](https://hub.continue.dev/google/gemini-3-pro-preview) from the hub ```yaml title="config.yaml" models: - - name: Gemini 2.0 Flash + - name: Gemini 3 Pro provider: gemini - model: gemini-2.0-flash + model: gemini-3-pro-preview apiKey: ``` diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index e6f2f9b9a6..d4aa50a846 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -913,6 +913,20 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["gemini"], isOpenSource: false, }, + gemini3ProPreview: { + title: "Gemini 3 Pro", + description: + "Google's latest Pro model with up to 64k output context. Best for complex tasks involving reasoning.", + params: { + title: "Gemini 3 Pro", + model: "gemini-3-pro-preview", + contextLength: 1_048_576, + apiKey: "", + }, + icon: "gemini.png", + providerOptions: ["gemini"], + isOpenSource: false, + }, c4aiAyaExpanse8B: { title: "C4AI Aya Expanse 8B", description: diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 420a76fcab..428e7d0e82 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -600,6 +600,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n models.gemini20FlashLite, models.gemini20FlashImageGeneration, models.gemini25ProExp, + models.gemini3ProPreview, ], apiKeyUrl: "https://aistudio.google.com/app/apikey", }, diff --git a/packages/llm-info/src/providers/cometapi.ts b/packages/llm-info/src/providers/cometapi.ts index e7b41e75e7..bb11aea616 100644 --- a/packages/llm-info/src/providers/cometapi.ts +++ b/packages/llm-info/src/providers/cometapi.ts @@ -135,6 +135,15 @@ export const CometAPI: ModelProvider = { }, // Gemini Series + { + model: "gemini-3-pro-preview", + displayName: "Gemini 3 Pro Preview", + contextLength: 2000000, + maxCompletionTokens: 8192, + description: + "Gemini flagship model with high precision multimodal capabilities.", + recommendedFor: ["chat"], + }, { model: "gemini-2.5-pro", displayName: "Gemini 2.5 Pro", diff --git a/packages/llm-info/src/providers/gemini.ts b/packages/llm-info/src/providers/gemini.ts index 6a6944ba0a..81606f1890 100644 --- a/packages/llm-info/src/providers/gemini.ts +++ b/packages/llm-info/src/providers/gemini.ts @@ -3,11 +3,22 @@ import { AllMediaTypes, ModelProvider } from "../types.js"; // See https://ai.google.dev/gemini-api/docs/models export const Gemini: ModelProvider = { models: [ + { + model: "gemini-3-pro-preview", + displayName: "Gemini 3 Pro Preview", + description: + "Google's flagship frontier model with high precision multimodal capabilities.", + contextLength: 1048576, + maxCompletionTokens: 65536, + mediaTypes: AllMediaTypes, + regex: /gemini-3-pro-preview/i, + recommendedFor: ["chat"], + }, { model: "gemini-2.5-pro-preview-05-06", displayName: "Gemini 2.5 Pro Preview", description: - "Google's most advanced model with strong reasoning, multimodal capabilities, and advanced coding skills", + "Google's advanced model with strong reasoning, multimodal capabilities, and advanced coding skills", contextLength: 1048576, maxCompletionTokens: 65536, mediaTypes: AllMediaTypes,