From 9fb3c93b9de6d2dc2f1956ce0b8981cba10e7511 Mon Sep 17 00:00:00 2001 From: u-yuta Date: Fri, 15 Aug 2025 20:41:20 +0900 Subject: [PATCH 1/3] feat: add tool support for Novita provider models Register major tool-capable models available through Novita provider to enable function calling in Agent mode. --- core/llm/toolSupport.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 40648c702..6b1a6df04 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -325,6 +325,39 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = return true; } + return false; + }, + novita: (model) => { + const lower = model.toLowerCase(); + + // Exact match models + const exactMatches = [ + "deepseek/deepseek-r1-0528", + "deepseek/deepseek-r1-turbo", + "deepseek/deepseek-v3-0324", + "deepseek/deepseek-v3-turbo", + "meta-llama/llama-3.3-70b-instruct", + "qwen/qwen-2.5-72b-instruct", + "zai-org/glm-4.5", + "moonshotai/kimi-k2-instruct", + ]; + + if (exactMatches.includes(lower)) { + return true; + } + + // Prefix match models + const prefixMatches = [ + "qwen/qwen3", + "openai/gpt-oss", + ]; + + for (const prefix of prefixMatches) { + if (lower.startsWith(prefix)) { + return true; + } + } + return false; }, }; From 6e91e3845c2c06cf83076ecf5eb59c0f2f5685ba Mon Sep 17 00:00:00 2001 From: u-yuta Date: Fri, 15 Aug 2025 20:52:01 +0900 Subject: [PATCH 2/3] test: add Novita provider tool support tests Add comprehensive test coverage for Novita provider including exact match models, prefix match models, and unsupported model cases. --- core/llm/toolSupport.test.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/core/llm/toolSupport.test.ts b/core/llm/toolSupport.test.ts index c3397878c..111d183d0 100644 --- a/core/llm/toolSupport.test.ts +++ b/core/llm/toolSupport.test.ts @@ -280,6 +280,34 @@ describe("PROVIDER_TOOL_SUPPORT", () => { }); }); + describe("novita", () => { + const supportsFn = PROVIDER_TOOL_SUPPORT["novita"]; + + it("should return true for exact match models", () => { + expect(supportsFn("deepseek/deepseek-r1-0528")).toBe(true); + expect(supportsFn("deepseek/deepseek-r1-turbo")).toBe(true); + expect(supportsFn("deepseek/deepseek-v3-0324")).toBe(true); + expect(supportsFn("deepseek/deepseek-v3-turbo")).toBe(true); + expect(supportsFn("meta-llama/llama-3.3-70b-instruct")).toBe(true); + expect(supportsFn("qwen/qwen-2.5-72b-instruct")).toBe(true); + expect(supportsFn("zai-org/glm-4.5")).toBe(true); + expect(supportsFn("moonshotai/kimi-k2-instruct")).toBe(true); + }); + + it("should return true for prefix match models", () => { + expect(supportsFn("qwen/qwen3-235b-a22b-instruct-2507")).toBe(true); + expect(supportsFn("openai/gpt-oss-20b")).toBe(true); + expect(supportsFn("openai/gpt-oss-120b")).toBe(true); + }); + + it("should return false for unsupported models", () => { + expect(supportsFn("deepseek/deepseek-chat")).toBe(false); + expect(supportsFn("meta-llama/llama-2-7b")).toBe(false); + expect(supportsFn("qwen/qwen-2.0-7b")).toBe(false); + expect(supportsFn("openai/gpt-4")).toBe(false); + }); + }); + describe("edge cases", () => { it("should handle empty model names", () => { expect(PROVIDER_TOOL_SUPPORT["continue-proxy"]("")).toBe(false); @@ -288,6 +316,7 @@ describe("PROVIDER_TOOL_SUPPORT", () => { expect(PROVIDER_TOOL_SUPPORT["gemini"]("")).toBe(false); expect(PROVIDER_TOOL_SUPPORT["bedrock"]("")).toBe(false); expect(PROVIDER_TOOL_SUPPORT["ollama"]("")).toBe(false); + expect(PROVIDER_TOOL_SUPPORT["novita"]("")).toBe(false); }); it("should handle non-existent provider", () => { From e3155df12c220bd273478d75d56c6e10945c9d4f Mon Sep 17 00:00:00 2001 From: u-yuta Date: Sun, 17 Aug 2025 00:10:25 +0900 Subject: [PATCH 3/3] style: apply prettier formatting --- core/llm/toolSupport.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 6b1a6df04..00efe8def 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -329,7 +329,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = }, novita: (model) => { const lower = model.toLowerCase(); - + // Exact match models const exactMatches = [ "deepseek/deepseek-r1-0528", @@ -341,23 +341,20 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "zai-org/glm-4.5", "moonshotai/kimi-k2-instruct", ]; - + if (exactMatches.includes(lower)) { return true; } - + // Prefix match models - const prefixMatches = [ - "qwen/qwen3", - "openai/gpt-oss", - ]; - + const prefixMatches = ["qwen/qwen3", "openai/gpt-oss"]; + for (const prefix of prefixMatches) { if (lower.startsWith(prefix)) { return true; } } - + return false; }, };