Merge pull request #7172 from u-yuta/feat/novita-tool-support
feat: add tool support for Novita provider models
This commit is contained in:
commit
6dc5603622
2 changed files with 59 additions and 0 deletions
|
|
@ -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("openrouter", () => {
|
||||
const supportsFn = PROVIDER_TOOL_SUPPORT["openrouter"];
|
||||
|
||||
|
|
@ -297,6 +325,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", () => {
|
||||
|
|
|
|||
|
|
@ -334,6 +334,36 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => 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;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue