Merge pull request #5598 from continuedev/tomasz/add-qwen3-tool-support
Update Qwen3 tool support
This commit is contained in:
commit
6d7e05e654
2 changed files with 30 additions and 25 deletions
|
|
@ -44,7 +44,7 @@ interface OllamaModelFileParams {
|
|||
min_p?: number;
|
||||
num_gpu?: number;
|
||||
|
||||
// deprecated or not directly supported here:
|
||||
// Deprecated or not directly supported here:
|
||||
num_thread?: number;
|
||||
use_mmap?: boolean;
|
||||
num_gqa?: number;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ export const PROVIDER_TOOL_SUPPORT: Record<
|
|||
if (
|
||||
model.toLowerCase().startsWith("gpt-4") ||
|
||||
model.toLowerCase().startsWith("o3")
|
||||
) return true;
|
||||
)
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
openai: (model) => {
|
||||
|
|
@ -66,7 +67,10 @@ export const PROVIDER_TOOL_SUPPORT: Record<
|
|||
},
|
||||
vertexai: (model) => {
|
||||
// All gemini models except flash 2.0 lite support function calling
|
||||
return model.toLowerCase().includes("gemini") && !model.toLowerCase().includes("lite");;
|
||||
return (
|
||||
model.toLowerCase().includes("gemini") &&
|
||||
!model.toLowerCase().includes("lite")
|
||||
);
|
||||
},
|
||||
bedrock: (model) => {
|
||||
// For Bedrock, only support Claude Sonnet models with versions 3.5/3-5 and 3.7/3-7
|
||||
|
|
@ -81,22 +85,24 @@ export const PROVIDER_TOOL_SUPPORT: Record<
|
|||
},
|
||||
mistral: (model) => {
|
||||
// https://docs.mistral.ai/capabilities/function_calling/
|
||||
return !model.toLowerCase().includes("mamba") &&
|
||||
[
|
||||
"codestral",
|
||||
"mistral-large",
|
||||
"mistral-small",
|
||||
"pixtral",
|
||||
"ministral",
|
||||
"mistral-nemo"
|
||||
].some((part) => model.toLowerCase().includes(part));
|
||||
return (
|
||||
!model.toLowerCase().includes("mamba") &&
|
||||
[
|
||||
"codestral",
|
||||
"mistral-large",
|
||||
"mistral-small",
|
||||
"pixtral",
|
||||
"ministral",
|
||||
"mistral-nemo",
|
||||
].some((part) => model.toLowerCase().includes(part))
|
||||
);
|
||||
},
|
||||
// https://ollama.com/search?c=tools
|
||||
ollama: (model) => {
|
||||
let modelName = "";
|
||||
// Extract the model name after the last slash to support other registries
|
||||
if(model.includes("/")) {
|
||||
let parts = model.split('/');
|
||||
if (model.includes("/")) {
|
||||
let parts = model.split("/");
|
||||
modelName = parts[parts.length - 1];
|
||||
} else {
|
||||
modelName = model;
|
||||
|
|
@ -117,6 +123,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<
|
|||
"llama3.2",
|
||||
"llama3.1",
|
||||
"qwen2",
|
||||
"qwen3",
|
||||
"mixtral",
|
||||
"command-r",
|
||||
"smollm2",
|
||||
|
|
@ -145,19 +152,17 @@ export const PROVIDER_TOOL_SUPPORT: Record<
|
|||
}
|
||||
},
|
||||
deepseek: (model) => {
|
||||
if(model !== "deepseek-reasoner") {
|
||||
if (model !== "deepseek-reasoner") {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
watsonx: (model) => {
|
||||
if (model.toLowerCase().includes("guard")) return false;
|
||||
if ([
|
||||
"llama-3",
|
||||
"llama-4",
|
||||
"mistral",
|
||||
"codestral",
|
||||
"granite-3"
|
||||
].some((part) => model.toLowerCase().includes(part)))
|
||||
return true;
|
||||
}
|
||||
if (model.toLowerCase().includes("guard")) return false;
|
||||
if (
|
||||
["llama-3", "llama-4", "mistral", "codestral", "granite-3"].some((part) =>
|
||||
model.toLowerCase().includes(part),
|
||||
)
|
||||
)
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue