diff --git a/core/llm/toolSupport.test.ts b/core/llm/toolSupport.test.ts index af980c3f1d8..3f6ff7bd7b1 100644 --- a/core/llm/toolSupport.test.ts +++ b/core/llm/toolSupport.test.ts @@ -260,6 +260,13 @@ describe("PROVIDER_TOOL_SUPPORT", () => { expect(supportsFn("devstral-24b")).toBe(true); }); + it("should return true for Gemma models", () => { + expect(supportsFn("gemma3")).toBe(true); + expect(supportsFn("gemma4")).toBe(true); + expect(supportsFn("gemma3:27b")).toBe(true); + expect(supportsFn("gemma4:27b")).toBe(true); + }); + it("should return false for explicitly unsupported models", () => { expect(supportsFn("vision")).toBe(false); expect(supportsFn("math")).toBe(false); @@ -292,6 +299,14 @@ describe("PROVIDER_TOOL_SUPPORT", () => { expect(supportsFn("mistral-7b")).toBe(true); }); + it("should return true for Gemma models via LM Studio", () => { + // Gemma 3/4 support function calling per Google's documentation + expect(supportsFn("gemma3")).toBe(true); + expect(supportsFn("gemma4")).toBe(true); + expect(supportsFn("Gemma-3-27B-Instruct-GGUF")).toBe(true); + expect(supportsFn("Gemma-4-27B-Instruct-GGUF")).toBe(true); + }); + it("should return true for LM Studio hyphenated model IDs", () => { // LM Studio uses hyphenated model identifiers like "Meta-Llama-3.1-8B-Instruct-GGUF" expect(supportsFn("Meta-Llama-3.1-8B-Instruct-GGUF")).toBe(true); diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 1b74d6188b6..5d6c8ee980a 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -213,6 +213,8 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "glm-5", "deepseek", "dolphin", + // https://ai.google.dev/gemma/docs/capabilities/function-calling + "gemma", ].some((part) => modelName.toLowerCase().includes(part)) ) { return true;