Skip to content

Commit 6dc5603

Browse files
authored
Merge pull request #7172 from u-yuta/feat/novita-tool-support
feat: add tool support for Novita provider models
2 parents a490177 + 8444e83 commit 6dc5603

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

core/llm/toolSupport.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,34 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
280280
});
281281
});
282282

283+
describe("novita", () => {
284+
const supportsFn = PROVIDER_TOOL_SUPPORT["novita"];
285+
286+
it("should return true for exact match models", () => {
287+
expect(supportsFn("deepseek/deepseek-r1-0528")).toBe(true);
288+
expect(supportsFn("deepseek/deepseek-r1-turbo")).toBe(true);
289+
expect(supportsFn("deepseek/deepseek-v3-0324")).toBe(true);
290+
expect(supportsFn("deepseek/deepseek-v3-turbo")).toBe(true);
291+
expect(supportsFn("meta-llama/llama-3.3-70b-instruct")).toBe(true);
292+
expect(supportsFn("qwen/qwen-2.5-72b-instruct")).toBe(true);
293+
expect(supportsFn("zai-org/glm-4.5")).toBe(true);
294+
expect(supportsFn("moonshotai/kimi-k2-instruct")).toBe(true);
295+
});
296+
297+
it("should return true for prefix match models", () => {
298+
expect(supportsFn("qwen/qwen3-235b-a22b-instruct-2507")).toBe(true);
299+
expect(supportsFn("openai/gpt-oss-20b")).toBe(true);
300+
expect(supportsFn("openai/gpt-oss-120b")).toBe(true);
301+
});
302+
303+
it("should return false for unsupported models", () => {
304+
expect(supportsFn("deepseek/deepseek-chat")).toBe(false);
305+
expect(supportsFn("meta-llama/llama-2-7b")).toBe(false);
306+
expect(supportsFn("qwen/qwen-2.0-7b")).toBe(false);
307+
expect(supportsFn("openai/gpt-4")).toBe(false);
308+
});
309+
});
310+
283311
describe("openrouter", () => {
284312
const supportsFn = PROVIDER_TOOL_SUPPORT["openrouter"];
285313

@@ -297,6 +325,7 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
297325
expect(PROVIDER_TOOL_SUPPORT["gemini"]("")).toBe(false);
298326
expect(PROVIDER_TOOL_SUPPORT["bedrock"]("")).toBe(false);
299327
expect(PROVIDER_TOOL_SUPPORT["ollama"]("")).toBe(false);
328+
expect(PROVIDER_TOOL_SUPPORT["novita"]("")).toBe(false);
300329
});
301330

302331
it("should handle non-existent provider", () => {

core/llm/toolSupport.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,36 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
334334
return true;
335335
}
336336

337+
return false;
338+
},
339+
novita: (model) => {
340+
const lower = model.toLowerCase();
341+
342+
// Exact match models
343+
const exactMatches = [
344+
"deepseek/deepseek-r1-0528",
345+
"deepseek/deepseek-r1-turbo",
346+
"deepseek/deepseek-v3-0324",
347+
"deepseek/deepseek-v3-turbo",
348+
"meta-llama/llama-3.3-70b-instruct",
349+
"qwen/qwen-2.5-72b-instruct",
350+
"zai-org/glm-4.5",
351+
"moonshotai/kimi-k2-instruct",
352+
];
353+
354+
if (exactMatches.includes(lower)) {
355+
return true;
356+
}
357+
358+
// Prefix match models
359+
const prefixMatches = ["qwen/qwen3", "openai/gpt-oss"];
360+
361+
for (const prefix of prefixMatches) {
362+
if (lower.startsWith(prefix)) {
363+
return true;
364+
}
365+
}
366+
337367
return false;
338368
},
339369
};

0 commit comments

Comments
 (0)