Skip to content

Update Qwen3 tool support #5598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 29 additions & 24 deletions core/llm/toolSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -117,6 +123,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<
"llama3.2",
"llama3.1",
"qwen2",
"qwen3",
"mixtral",
"command-r",
"smollm2",
Expand Down Expand Up @@ -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